Crop PDF using PHP
PDF cropping programmatically using Aspose.PDF for PHP via Java Library
Crop PDF with PHP
In order to crop PDF file, we’ll use Aspose.PDF for PHP via Java API which is a feature-rich, powerful and easy-to-use document manipulation tool in php-java. Install Tomcat 9.0 version on any location, add Aspose.PDF.war, for more details check the GitHub page.
How to Crop PDF using PHP
You need Aspose.PDF for PHP via Java to try the code in your environment.
- Open a PDF document using Document object.
- Choose the type of box and create new Box Rectagle
- Save the updated document to the new path using the Save() method.
If you want to crop a PDF page, a cropping solution can help. With this powerful Aspose.PDF PHP via Java library, you can change your PDF while keeping its quality. This professional tool uses PHP to crop PDF effectively. The following example demonstrates how to modify a PDF document in PHP:
Crop PDF Files - PHP
This sample code shows how to Crop PDF Page - PHP
Input file:
File not added
Output format:
Output file:
About Aspose.PDF for PHP via Java API
Aspose.PDF for PHP via Java is a powerful API designed to assist developers in creating, manipulating, and converting PDF documents programmatically. Aspose.PDF allows developers to create PDF documents from scratch or convert other document formats (such as HTML, XML, and images) to PDF. This is useful for generating reports, invoices, or any document type. It also recommends viewing a Documentation.