Set Page Boxes

Set Page Boxes

Set Page Boxes is a REST API tool that allows precise control over PDF page boundaries, enabling developers to set or edit the MediaBox (page size), CropBox (visible content area for cropping PDF and removing white space), BleedBox (extra margin for professional printing with bleed), TrimBox (final printed page dimensions), and ArtBox (boundary of the artwork or content).

Key Benefits of Set Page Boxes API

  • Offers granular control over PDF page dimensions by allowing users to set or modify the MediaBox, CropBox, BleedBox, TrimBox, and ArtBox.
  • Crop PDF files by setting the CropBox to focus on essential content and remove unwanted white space for cleaner viewing and printing.
  • Control the overall dimensions of your PDF by setting the MediaBox, allowing you to resize PDF pages.
  • Configure the BleedBox to extend content beyond the TrimBox, ensuring accurate trimming and eliminating white edges in professionally printed documents.
  • Set the TrimBox to specify the intended final dimensions of the printed page after it has been cut.
  • Use the ArtBox to define the precise boundaries of the artwork or meaningful visual elements on the page, crucial for design and prepress workflows.
Build Your Solution

You have document processing problems, we have Solutions. Explore the many ways pdfRest can align your documents with your business objectives.

Browse all solutions
The pdfRest logo is added to the Microsoft Power Automate logo with a representation of a PNG to PDF conversion workflow
Integrate pdfRest with Microsoft Power Automate
Remove White Space from PDF for Professional Printing
Remove White Space from PDF for Professional Printing
Ensure GDPR Compliance for PDF Processing with EU-Based Cloud API
Ensure GDPR Compliance for PDF Processing with EU-Based Cloud API
Resize PDF Pages for Consistent Archiving
Resize PDF Pages for Consistent Archiving
Crop PDF Files to Optimize Scanned Documents
Crop PDF Files to Optimize Scanned Documents
The Salesforce logo with APEX programming language is connected with the pdfRest logo around a PDF toolkit icon
Integrate PDF API Tools with Salesforce Apex Code
Why is pdfRest the best API to set PDF page boundary boxes?
pdfRest provides the best API to set PDF page boundary boxes because it offers precise control over all five box types (MediaBox, CropBox, BleedBox, TrimBox, ArtBox), leverages advanced PDF technology for accuracy, and enables seamless integration for automated workflows.

Precise Control to Set and Edit All PDF Page Boundaries

Set Page Boxes API offers unparalleled precision when managing PDF page boundaries. Unlike many tools with limited functionality, this API provides the ability to directly set or edit all five critical PDF page boundary boxes:

  • MediaBox: Defines the physical media size of the page.
  • CropBox: Specifies the region to be displayed or printed.
  • BleedBox: Determines the area to extend beyond the trim box to account for printing inaccuracies.
  • TrimBox: Indicates the final intended size of the printed page after trimming.
  • ArtBox: Defines the boundary of the artwork or meaningful content on the page.

This comprehensive control empowers developers to fine-tune the visual presentation and technical specifications of their PDF documents with accuracy for each of these boundaries.

Accurate PDF Boundary Definition with Advanced Technology

The pdfRest Set Page Boxes API is built upon robust Adobe PDF processing technology, ensuring accurate and reliable manipulation of page boundary boxes. This foundation guarantees that the coordinates and dimensions you specify to set the MediaBox, edit the CropBox, define the BleedBox, adjust the TrimBox, and specify the ArtBox are precisely applied to the PDF document. By leveraging this advanced technology, you can avoid inconsistencies or errors that might arise with less sophisticated tools when attempting to modify PDF page boxes.

Furthermore, the API is designed to handle various PDF versions and complexities, providing a consistent and dependable solution for tasks like setting the CropBox or defining the BleedBox across different document types. This reliability is crucial for automated workflows and ensures that your processes involving PDF page box manipulation are robust and error-free.

Streamlined Integration for Automated PDF Page Box Workflows

Integrating the pdfRest Set Page Boxes API into your existing applications and workflows is a seamless process. The RESTful interface allows for easy communication with various programming languages and platforms, enabling developers to quickly incorporate the ability to set page boundary boxes into their automated PDF processing pipelines.

This streamlined integration is particularly beneficial for tasks such as:

  • Dynamically adjusting the CropBox based on content.
  • Automatically setting the BleedBox for print-ready PDFs.
  • Standardizing the MediaBox sizes across a batch of documents.
  • Defining the ArtBox for specific design or pre-press requirements.

By utilizing this API, you can automate these crucial steps, saving time, reducing manual intervention, and ensuring consistent application of PDF page boundary settings at scale.

Customize Your Solution

Learn about the parameters for this tool to create your custom solution.

Boxes

The boxes parameter accepts a JSON string structured to define the page boundary boxes you wish to set or edit.

This JSON string should contain a top-level "boxes" key, whose value is an array of box definition objects. Each of these objects requires a "box" key, specifying the type of box to modify (e.g., "media", "crop", "bleed", "trim", "art"), and a "pages" key. The "pages" key holds an array of page specifications, allowing you to target specific page ranges with corresponding margin adjustments.

Each page specification object within the "pages" array must include a "range" key, which can accept a single page number ("1"), a page range ("1-3"), "all", "even", "odd", or include "last" (e.g., "2-last"). Additionally, each page specification object should contain "top", "bottom", "left", and "right" keys, defining the margin values (in PDF Units, where 72 PDF Units = 1 inch) to apply for the specified box type and page range.

For example, the following JSON structure sets a CropBox with 36-point margins on all sides for the first 10 pages and 72-point margins for the remaining pages, and also sets a BleedBox with 144-point margins on all sides for all pages:

{
    "boxes": [
        {
            "box": "crop",
            "pages": [
                {
                    "range": "1-10",
                    "left": 36,
                    "top": 36,
                    "bottom": 36,
                    "right": 36
                },
                {
                    "range": "11-last",
                    "left": 72,
                    "top": 72,
                    "bottom": 72,
                    "right": 72
                }
            ]
        },
        {
            "box": "bleed",
            "pages": [
                {
                    "range": "1-last",
                    "left": 144,
                    "top": 144,
                    "bottom": 144,
                    "right": 144
                }
            ]
        }
    ]
}

Safe & Secure

Confidently process your sensitive data with pdfRest. Our platform is fortified for robust, Enterprise-grade security and compliance, including GDPR, HIPAA, and SOC 2 Type 2 certification in progress. Your data's protection is our priority.

Frequently Asked Questions
Need more help? Contact Us or visit our documentation.

The Set Page Boxes API is a REST API tool that provides precise control over PDF page boundaries. It allows you to programmatically set or edit any of the five main page boxes, which are crucial for defining a document’s size, content area, and print specifications.

A PDF page can contain up to five different page boxes, each serving a specific purpose:

  • MediaBox: The largest box, defining the physical dimensions of the page media. It determines the overall page size.
  • CropBox: Specifies the visible content area. By adjusting this box, you can effectively crop the PDF and remove unwanted white space.
  • BleedBox: An area that extends beyond the trim box. It's used to ensure content runs to the very edge of the final printed page without leaving a white margin after trimming.
  • TrimBox: Defines the final intended dimensions of the document after it has been professionally cut.
  • ArtBox: The smallest box, defining the precise boundary of the artwork or other meaningful content on the page.

This API is essential for prepress workflows. By setting the BleedBox and TrimBox, you can precisely prepare a document for professional printing, ensuring that your final product is accurately trimmed and free of unsightly white edges. For example, you can set the TrimBox to be the exact final size of a brochure and the BleedBox to extend 1/8 of an inch beyond that, as is standard practice in many printing processes.

To crop a PDF, you use the CropBox parameter. You can specify the new margins (top, bottom, left, and right) to redefine the visible area of the page. This is a powerful way to remove excess white space from scanned documents or focus on a specific area of content.

To change the overall dimensions of a PDF, you adjust the MediaBox. You can set new margin values to either enlarge or reduce the size of the entire page, which is useful for standardizing page sizes across a batch of documents or resizing files for different platforms.

pdfRest offers the best solution for managing PDF page boundaries because it provides precise control over all five box types. The API is built on advanced PDF technology to ensure accurate manipulation, and its RESTful design enables seamless integration for automated workflows, allowing you to streamline tasks like dynamic cropping and batch standardization.

The API uses a flexible JSON format to specify box settings. You can target a specific box type (e.g., "crop" or "media"), apply margins to single pages or a range of pages (e.g., "1", "1-10", "even", "all"), and define precise margin values in PDF Units (72 units per inch) for the top, bottom, left, and right sides of the page.

Ensuring the security and privacy of your data is a top priority at pdfRest. Our platform is built for robust, enterprise-grade security and compliance, including GDPR and HIPAA. All your files are secured with encryption during both transit and at-rest, and they are permanently deleted after the stated file retention period (30 minutes for most plans). For complete details, please refer to our Data Processing Agreement (DPA).

To facilitate GDPR compliance for your page box workflows, pdfRest processes your data within the European Union and adheres to other strict data protection requirements. You can ensure all processing occurs within the EU by sending your API calls to the dedicated EU endpoint. Please note that a GDPR usage fee may apply for some plans. For more information, please review our Data Processing Agreement.

Integrating the Set Page Boxes API is straightforward. We offer comprehensive API documentation and code samples in many programming languages. The API Lab also allows you to test and generate code snippets directly from your browser, simplifying the setup and ensuring a smooth integration experience.

You can use API Lab for a no-code solution directly from your browser. The API Lab provides a simple, visual interface where you can upload your PDF, build the JSON parameter, and send API calls without writing a single line of code.

Yes, pdfRest offers two self-hosted options. The pdfRest API Toolkit on AWS allows you to deploy and manage your own backend processing infrastructure within your AWS environment with pay-as-you-go pricing through the AWS Marketplace. The pdfRest API Toolkit Container provides ultimate environmental control as a Docker Container, giving you the flexibility to run the API in on-premises data centers or public/private cloud environments with a flexible, custom licensing model.

Generate a self-service API Key now!
Create your FREE API Key to start processing PDFs in seconds, only possible with pdfRest.