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
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
Control your Backend with pdfRest API Toolkit Self-Hosted
Control your Backend with pdfRest API Toolkit Self-Hosted
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.

Start from Code Examples
See more code examples in our GitHub repository
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
                }
            ]
        }
    ]
}
Generate a self-service API Key now!
Create your FREE API Key to start processing PDFs in seconds, only possible with pdfRest.