Sub topic 12
How a PDF Records Trim and Bleed
This chapter assumes you can already set up a document with bleed and a safe area in a layout application, and that you know what trim size and bleed mean. Here you will learn how a PDF stores that information, how to read it, and what goes wrong when it is missing.
Why the PDF needs to say it
A PDF page is a rectangle of content. A printer's software has to know which part of that rectangle is the finished piece and which part is extra artwork to be cut away. Without that, the file is just a page of some size.
If you export a flyer with 3 mm of bleed, the page contains the trim area plus the bleed. The exported page is 216 × 303 mm, not 210 × 297 mm. The PDF can store both sizes at once. It does this with page boxes. Each box is a rectangle with its own job.
The five page boxes
Every PDF page can carry up to five boxes. Each is defined by four numbers: the lower-left and upper-right corners, in points. A point is 1/72 inch, which is about 0.3528 mm.
| Box | What it describes | Typical use |
|---|---|---|
| MediaBox | The full physical page, including marks and slug | Required. Defines the sheet the page is laid out on |
| CropBox | The region shown or printed by a viewer | What most viewers display |
| BleedBox | The area including bleed | Where the printer should clip output for production |
| TrimBox | The final finished size | Where the piece will be cut |
| ArtBox | The meaningful content area | Rarely used in print workflows |
Only the MediaBox is required. If the others are absent, readers fall back to defaults: the CropBox defaults to the MediaBox, and the BleedBox, TrimBox, and ArtBox default to the CropBox.
That fallback is the source of most problems. A PDF with no TrimBox is not wrong, but it carries no statement of where to cut. The printer's software then has to guess from the page size, or from crop marks if you included them.
How the boxes nest
The boxes sit inside each other. TrimBox is inside BleedBox, and BleedBox is inside MediaBox. When you export with crop marks, MediaBox is larger still, because it must also hold the marks and any slug area.
The safe area is not a PDF box. It is a design rule you follow when placing content, so nothing in the file records it. You can only check it by looking at the layout.
Worked example: an A4 flyer with 3 mm bleed
Take the A4 flyer from the earlier setup. The trim is 210 × 297 mm and the bleed is 3 mm per side.
The box sizes in millimeters are as follows.
- TrimBox is 210 × 297 mm.
- BleedBox is 216 × 303 mm.
- MediaBox is 216 × 303 mm if you export without marks.
With crop marks, the MediaBox grows. The marks need room outside the bleed. Many applications add an offset between the bleed edge and the marks, plus the mark length. The exact amount depends on the application and your settings, so read it from the exported file instead of assuming a number.
Converted to points, the A4 trim is about 595.28 × 841.89 pt. The BleedBox is about 612.28 × 858.90 pt. Page boxes are written as coordinates, so a TrimBox inset 3 mm from a MediaBox at the origin starts at about 8.50, 8.50 pt.
Reading the boxes with pdfinfo
You do not need to open the PDF in an editor to check this. The pdfinfo tool from poppler-utils prints every box when you pass -box.
pdfinfo -box flyer.pdfThe output includes lines like these.
Page size: 216 x 303 pts
MediaBox: 0.00 0.00 612.28 858.90
CropBox: 0.00 0.00 612.28 858.90
BleedBox: 0.00 0.00 612.28 858.90
TrimBox: 8.50 8.50 603.78 850.39
ArtBox: 0.00 0.00 612.28 858.90Read each row as left, bottom, right, top. The values above are illustrative of a correct export. Your numbers will differ with your page size.
Check three things.
- TrimBox is smaller than BleedBox on every side.
- The gap between them equals your bleed. Here, 8.50 pt is 3 mm.
- TrimBox, converted to millimeters, equals the finished size you ordered.
Checking the arithmetic in code
You can verify the bleed from the box coordinates. This script converts points to millimeters and reports the bleed on each side. It does not parse a PDF. You supply the box values read from pdfinfo.
PT_PER_INCH = 72
MM_PER_INCH = 25.4
def pt_to_mm(pt):
return pt / PT_PER_INCH * MM_PER_INCH
def bleed_per_side(bleed_box, trim_box):
"""Each box is (left, bottom, right, top) in points. Returns mm per side."""
bl, bb, br, bt = bleed_box
tl, tb, tr, tt = trim_box
return {
"left": round(pt_to_mm(tl - bl), 2),
"bottom": round(pt_to_mm(tb - bb), 2),
"right": round(pt_to_mm(br - tr), 2),
"top": round(pt_to_mm(bt - tt), 2),
}
bleed_box = (0.00, 0.00, 612.28, 858.90)
trim_box = (8.50, 8.50, 603.78, 850.39)
print(bleed_per_side(bleed_box, trim_box))
# {'left': 3.0, 'bottom': 3.0, 'right': 3.0, 'top': 3.0}If any side comes out as 0, that side carries no bleed. If a value is negative, the TrimBox extends past the BleedBox, which is an invalid file.
What the box values mean in practice
A printer's prepress software, often a RIP or imposition tool, reads these boxes to place your page on a press sheet. It uses the TrimBox to position the page and to draw its own cut marks. It uses the BleedBox to decide how much extra artwork to keep.
This has consequences.
- If the TrimBox is correct and the bleed is present, the printer can impose many pages on one sheet without asking you anything.
- If the TrimBox is missing, the software may treat the whole MediaBox as the trim. The page would then be cut at the bleed edge, and your artwork would print with no margin of error.
- If the TrimBox is wrong, for example set to the bleed size, the job is positioned incorrectly even though the artwork looks fine on screen.
Common errors
Bleed exists in the artwork but not in the boxes. You extended the background, but the export used the trim size as the page size. The bleed was cropped away. In pdfinfo, MediaBox equals TrimBox. Re-export with the bleed option enabled.
Bleed is in the boxes but the artwork stops short. The page is 216 × 303 mm, but the background ends at the trim line. The boxes are right and the file still fails. The printer will see a white sliver after cutting. No box check catches this, so you must look at the artwork.
Marks and slug cause the wrong size to be reported. When crop marks are on, the MediaBox is larger than the BleedBox. A viewer that shows the MediaBox will report a page bigger than your order. That is normal. Check the TrimBox for the finished size.
Viewers show a different size than the print box. Many viewers display the CropBox. If the CropBox was set to the trim size, you see a clean page and the bleed seems to be missing. It is still in the file, outside the displayed region. Use pdfinfo -box to confirm.
Using a pre-trimmed PDF/X preset by mistake. PDF/X standards, such as PDF/X-1a and PDF/X-4, require a TrimBox or ArtBox. Presets named after them usually write the boxes for you. A custom preset might not, so check the output rather than trusting the preset name.
Setting the boxes in your application
Most layout applications write the boxes for you. In InDesign, enabling "Use Document Bleed Settings" in the export dialog sets the BleedBox from your document. The TrimBox is taken from the page size. Applications from other makers expose similar options under names such as "Include bleed". The exact menu path differs between versions.
If you export without these options, only the page size is recorded, and TrimBox equals MediaBox. That is the situation you want to avoid.
Exercise
A PDF reports MediaBox 0 0 612.28 858.90 and TrimBox 0 0 612.28 858.90. The artwork was designed with 3 mm bleed. What is wrong, and what do you change?
Show answer
The TrimBox equals the MediaBox, so the file records no bleed. Either the bleed was not exported or the TrimBox was not set, so the printer would treat the whole page as the finished size and cut at the edge of the artwork. Re-export with the document bleed setting enabled. Then run pdfinfo -box again and confirm the TrimBox is inset about 8.50 pt (3 mm) from the BleedBox on every side.
Exercise
A BleedBox is 0 0 595.28 841.89 and the TrimBox is 14.17 14.17 581.11 827.72. How much bleed is on each side in millimeters, and does it match a 5 mm bleed request?
Show answer
The inset is 14.17 pt on each side. 14.17 / 72 × 25.4 is about 5.0 mm. Yes, it matches the 5 mm bleed request.