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

When laying out a style sheet or sharing a set of images, it may be easier to compile your array in a PDF document rather than sending as a PNG. By sharing the images as PDF, you can control the size of the images as well as set your preferred viewing order. This API will allow you to instantly convert a PNG image array to PDF with one image per page. Varied image sizes are supported for input.

Image for post
Image for post

To use this API, run this command to install the SDK:

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

You can also 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;

With this, you can convert up to ten PNGs to PDF, to improve your ability to share images with partners and clients.

You can retrieve the API Key from the Cloudmersive website at no cost and with no commitment. This will provide you with 800 monthly calls across our library of APIs.

Written by

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