---
title: "Print Base64 PDF using JavaScript | Nutrient SDK"
canonical_url: "https://www.nutrient.io/guides/web/print/from-base64/"
md_url: "https://www.nutrient.io/guides/web/print/from-base64.md"
last_updated: "2026-05-25T18:42:17.831Z"
description: "If you want to start printing a document encoded in Base64, load it by passing it to the document option in your configuration as a data URI."
---

# Print PDFs from Base64 using JavaScript

If you want to start printing a document encoded in Base64, load it by passing it to the document option in your configuration as a data URI, and then call [`instance.print()`](https://www.nutrient.io/api/web/NutrientViewer.Instance.html#print) when the SDK has loaded.

When the SDK has finished loading, call this method and the printing dialog should display indicating the PDF has started printing:

```js

NutrientViewer.load({
  document: "data:application/pdf;base64,<your base 64 string goes here>"
  //...
}).then((instance) => {
    // Print when loaded.
    instance.print();
  }).catch((error) => {
    console.error("Failed to load document:", error.message);
  });

```
---

## Related pages

- [Print PDFs from a Blob using JavaScript](/guides/web/print/from-blob.md)
- [Auto print PDFs using JavaScript](/guides/web/print/auto-print.md)
- [Disable print options in PDFs using JavaScript](/guides/web/print/disable-printing.md)
- [Print PDFs from URLs using JavaScript](/guides/web/print/from-url.md)
- [Print PDFs without annotations using JavaScript](/guides/web/print/without-annotations.md)
- [JavaScript library to print PDFs](/guides/web/print.md)
- [Print PDFs without opening using JavaScript](/guides/web/print/without-opening-pdf.md)
- [Print to PDFs programmatically using JavaScript](/guides/web/features/printing.md)
- [Print modes in our JavaScript PDF viewer](/guides/web/print/print-modes.md)

