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).

Image for post
Image for post

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:

<?php
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.

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