How to Resize a PDF Document for Print in Node.JS

npm install cloudmersive-convert-api-client --save
"dependencies": {
"cloudmersive-convert-api-client": "^2.4.8"
}
var CloudmersiveConvertApiClient = require('cloudmersive-convert-api-client');
var defaultClient = CloudmersiveConvertApiClient.ApiClient.instance;
// Configure API key authorization: Apikey
var Apikey = defaultClient.authentications['Apikey'];
Apikey.apiKey = 'YOUR API KEY';
var apiInstance = new CloudmersiveConvertApiClient.EditPdfApi();var inputFile = Buffer.from(fs.readFileSync("C:\\temp\\inputfile").buffer); // File | Input file to perform the operation on.var paperSize = "paperSize_example"; // String | The desired paper size for the resized PDF document. Size ranges from A7 (smallest) to A0 (largest).var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.editPdfResize(inputFile, paperSize, callback);

--

--

--

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

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Dart Const and Final, what is the Difference

Angular framework for frontend development

Create your first app with Svelte

Writing a RESTful micro-service API using NodeJS+TypeScript+ExpressJS+Prisma — Part 1

A journey through ReactDOM.render — An explanation of how React manages the DOM and state

Art Collector

Category and subcategory in Reactjs/Nextjs based on selection

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

Cloudmersive

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

More from Medium

Install MongoDB in Ubuntu with Authentication

Simple BackEnd Application #2 | REST Web Service

How to Install KeyCloak 17 on Windows Machine

Convert Node.js App into Docker Container