Some test text!

menu

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:

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

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

Get the answers you need: Support

close

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.