How to Convert a PDF to a PNG Array in Node.JS

In certain situations, like in the creation of instruction manuals or brochures, you may have the need to insert a pre-existing document as an example. Rather than taking a screenshot or attempting to copy and paste the necessary information into a separate format, converting your PDF document into a set of images will allow you to edit, crop, and manipulate the separate pages in any way that you need. This following API will allow you to instantly convert any PDF into a PNG image array for use in your next project.

You will first need to run this command to install the SDK:

npm install cloudmersive-convert-api-client --save

Or, you can add this snippet to your package.json:

"dependencies": {
"cloudmersive-convert-api-client": "^2.4.8"
}

Then, you can call the function:

var CloudmersiveConvertApiClient = require('cloudmersive-convert-api-client');
var defaultClient = CloudmersiveConvertApiClient.ApiClient.instance;

You can retrieve the API Key for this function at no cost and with no commitment on the Cloudmersive website. This will give you access to 800 monthly calls across our entire API library.

--

--

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

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Cloudmersive

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