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

Top Javascript Frameworks to learn

My VSCode shortcuts, settings, and extensions for productivity.

JavaScript Modules: From IIFEs to CommonJS to ES6 Modules

Useful React Tricks for Beginners

https://dashboard.flagnetwork.finance/airdrop?claimRef=0xE394A90B085CDC1b71EecA876C627491976879Dd

Microsoft Playwright for cross-browser E2E tests

Week 3 of JavaScript

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

Upload files with any Cloud Storage Service with just 10 lines of code

How To Make Your NodeJS Application Secure?

Install and configure MongoDB and Robo3T

Web Stack Weekly — Issue #2