Cloudmersive

How to Linearize a PDF in JavaScript

Getting tired of those lengthy download times for large files? Us too. To cut down on your wait time and boost productivity, you can use the following API in JavaScript to linearize the contents of a PDF and optimize the file for streaming download. This simple process will enable you to view the document as it loads; once the download is complete, you may already be halfway through your related task.

Let’s start things off by installing the jQuery library:

bower install jquery

With the installation out of the way, we are ready to input the PDF file and call the function:

var form = new FormData();
form.append("inputFile", fileInput.files[0], "file");

To retrieve your API key, visit the Cloudmersive website and register for a free account; this will provide 800 calls/month across our entire library of APIs.

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.