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 do get the modified PDF as an ArrayBuffer then you can use the getFileData function on Document. For example:

viewerElement.addEventListener('documentLoaded', function() {   
  var docViewer = myWebViewer.getInstance().docViewer;
  var doc = docViewer.getDocument();
  // include annotations with the document
  var options = {
    xfdfString: docViewer.getAnnotationManager().exportAnnotations()
  doc.getFileData(options).then(function(data) {
    var arr = new Uint8Array(data);
    var blob = new Blob([arr], { type: 'application/pdf' });
    // upload blob to your server

Get the answers you need: Support