This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/web/save-a-document/to-arraybuffer.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Save and download PDF from ArrayBuffer using JavaScript | Nutrient

Exporting a PDF to an ArrayBuffer can be done with a single API call to instance.exportPDF():

try {
const documentBuffer = await instance.exportPDF();
console.log("PDF exported successfully");
} catch (error) {
console.error("Failed to export PDF:", error.message);
}

Try this example in the Playground(opens in a new tab).

The resolved ArrayBuffer can then be handled as desired — for example, send it to your server or download it to a local storage.

Under AutoSaveMode.DISABLED, the exported file doesn’t include unsaved annotations. The export succeeds, and instance.hasUnsavedChanges() stays true. In standalone mode, unsaved form field values may already be present in the export, because NutrientViewer.Options.PDF_JAVASCRIPT is enabled by default. An export without a save can therefore contain some pending edits but not others. Call instance.save() before you export to include everything. In server-backed mode, saving also persists those changes to Document Engine.

When exporting a document, you have several options. Refer to our guides on flattening annotations and incremental saving for more details.

Auto saving can be configured for different scenarios and use cases. You can find more information in our auto save guide.