How to Resize a PDF File in PHP

Looking to resize a PDF for a project? If so, we have an API that can fit your needs. Using the PHP programming language, the following API can resize a PDF file to the input paper size; sizes run from A7 (smallest) to A0 (largest).

Our first step is to run this command to install the client:

composer require cloudmersive/cloudmersive_document_convert_api_client

Next, we can create an instance of the API and call the resize function:

require_once(__DIR__ . '/vendor/autoload.php');

In no time at all, your PDF has been tailored to meet your measurements. To retrieve your free API key, simply head to the Cloudmersive website to gain access to 800 monthly calls across our library of APIs.

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