Some test text!


Saving the updated PDF

Once you've applied changes to the document data you'll probably want to do something with the updated PDF like letting the user download it or sending it back to your server.

If you just want to let the user download the edited file then no extra changes are necessary as pressing the download button will save the modified PDF to the user's computer.

If you want to get the modified PDF as an ArrayBuffer then you can use the getFileData function on Document. For example:

  .then(instance => {
    const { docViewer, annotManager } = instance;

    docViewer.on('documentLoaded', async () => {
      const doc = docViewer.getDocument();
      const xfdfString = await annotManager.exportAnnotations();
      const options = { xfdfString };
      const data = await doc.getFileData(options);
      const arr = new Uint8Array(data);
      const blob = new Blob([arr], { type: 'application/pdf' });
      // upload blob to your server

Get the answers you need: Support


Free Trial

Get unlimited trial usage of PDFTron SDK to bring accurate, reliable, and fast document processing capabilities to any application or workflow.

Select a platform to get started with your free trial.

Unlimited usage. No email address required.