Input and compilation/PDF/PDF boxes

Unofficial ConTeXt Wiki mirror

Last modified: 2025-01-05

Basics

PDF Boxes

While PostScript (and EPS, that is) knows only one kind of page size, defined by the BoundingBox (or HiResBoundingBox), the size of PDF pages can have different meanings – e.g. the visible page, the printed page, the cropped printed page. Therefore the PDF standard defines a set of "boxes":

Name Meaning
MediaBox Size of the physical medium (print sheet); this is the page format.
CropBox Page size that is visible in a viewer.
BleedBox Page size plus bleed (cut space); defines the trimmed page plus the bleed.
TrimBox Size of trimmed (cut) page, “final” page size; the net result document format.
ArtBox Size of the page content (artwork); might be used for imposition purposes; typically, it can be used to specify any section of the page.

In PDF/X, if ArtBox is defined at all, it must not differ from TrimBox.

In ConTeXt

\setuppapersize[A5][A5,oversized]

\setuplayout
 [location=middle,
  cropoffset=0mm,% default
  trimoffset=-7.5mm,% negative offset from MediaBox to TrimBox
  bleedoffset=3mm,% bleed size
]
\setupinteractionscreen[width=max,height=max]

\starttext
\showlayout
\stoptext

Complete Example

This uses a print mode:

\setuppapersize[A5][A5,oversized] % oversized adds 15mm, enough for the crop marks

\setuplayout[
  location=middle,
  marking=on,
]

\startmode[print]
\setuplayout[
  cropoffset=0mm,% default
  bleedoffset=3mm,% bleed
  trimoffset=-7.5mm,% half of negative size difference of sheet and paper
]
\stopmode

\startnotmode[print]
\setuplayout[
  cropoffset=7.5mm,% shrink the visible page to the final paper size
  bleedoffset=3mm,
  trimoffset=0mm,% the TrimBox is influenced by the CropBox
]
\stopnotmode

\setupinteractionscreen[width=max,height=max]% activate!

\starttext
\showlayout
\stoptext