Some test text!

menu
search
Save a documentkeyboard_arrow_down

Saving a document

After getting a Blob object, it's possible to save it from the browser using a library like FileSaver.js.

// using the FileSaver.js library saveAs function, but any technique to save a Blob from the browsers works
window.saveAs(blob, 'downloaded.pdf');

Alternatively, to send document blob data to your remote server.

var data = new FormData();
data.append('mydoc.pdf', blob, 'mydoc.pdf');
// depending on the server, 'FormData' might not be required and can just send the Blob directly

var req = new XMLHttpRequest();
req.open("POST", '/api/test', true);
req.onload = function (oEvent) {
  // Uploaded.
};

req.send(data);

linkGet document data as a blob

After annotating or modifying a document you may want to save the entire document to your server. The most common way to send a document to a server is as a Blob object and WebViewer makes this easy by providing functions to get the document data as a Blob.

Get document data with a viewer
To get document data as a blob with a viewer.

Get document data without a viewer
To get document data as a blob without a viewer.

linkLearn more

Saving the updated PDF
To save an modified PDF changes back to a server or for downloading it.

Loading and saving annotations
To import/load and export/save annotations with a PDF document.

linkAdditional external resources

Sending data with XMLHttpRequest
Mozilla documentation on sending binary data using XMLHttpRequest.

Sending data with fetch
Google documentation on working with fetch API.

Sending post request with jQuery
jQuery documentation on using post requests.

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.

PDFTron Receives USD$71 Million Growth Investment Led By Silversmith Capital Partners

Learn More
close