4

Background

Printed pages have crop, bleed, trim, and other regions. Settings for these regions were added to ConTeXt a while ago (see the PDF Boxes wiki page). In ConTeXt, there does not appear to be a way to enable visibility of bleeding or trimming.

The \showframe command is useful, along with marking=on to show crop marks, but those don't show all the different regions. This makes it difficult to visually see where the page will be trimmed and how much area is used for bleed.

The \usexternalfigure command documentation suggests that images can be constrained to various box PDF sizes, including: none, media, crop, trim, and art. Examples are hard to find.

Problem

A printshop has given the following specifications:

Print Specifications

I'm trying to produce a layout that meets those specifications and see the different regions. Ideally, the different regions would appear in the generated PDF similar to the dotted frames in the following illustration (the box labels are not necessary):

Print Markings

Code

Thus far:

\setupinteractionscreen[
  width=max,
  height=max,
]

\definepapersize[BookPageSize][
  width=11.75in,
  height=11.75in,
]

\definepapersize[BookPageSizeBleed][
  width=11.875in,
  height=12.000in,
]

\definepapersize[BookMediaSize][
  width=12.75in,
  height=12.75in,
]

\setuppapersize[BookPageSize][BookPageSizeBleed,BookMediaSize]

\setuplayout[
  rightmargin=0in,
  leftmargin=0in,
  header=0in,
  footer=0in,
  location=middle,
  width=middle,
  height=middle,
  %cropoffset=.25in,
  %trimoffset=0.25in,
  %bleedoffset=-.125in,
  marking=on,
]

\definelayer[BookBleedLayer][
  x=1.4in,
  y=1in,
]

\setlayerframed[BookBleedLayer][
  frame=on,
  background=color,
  backgroundcolor=lightgray,
  width=\bleedwidth,
  height=\bleedheight,
]{bleed}

\setupbackgrounds[page][
  background=BookBleedLayer,
  align=middle,
  location=middle,
]

\setupheadertexts[]
\setupfootertexts[]

\showframe
\starttext Hello A \stoptext

Produces:

Page Bleed

Questions

An answer to the first question will be most helpful for others; the second would be useful for anyone looking for an example of how to apply printer specifications to a ConTeXt document layout:

  • How would you configure and show the boxes (crop, bleed, trim, and media)?
  • How would you change the code to conform to the given specifications?

Related

2

There does not appear to be a way to show the various boxes as defined by the crop, trim, and bleed offset settings. Using page background layers, it is possible to visually depict the different regions according to the printshop's specifications.

% Page Specifications (in inches, width x height)

% Exported PDF: 11.875 x 12.000
% Page size: 11.75 x 11.75
% Bleed (top, bottom, outside edges): 0.125
% Margin inset (top, bottom, outside edges): 0.25
% Margin gutter (binding edge): 0.625

\setuppagenumbering[alternative=doublesided]

% Set these to the final PDF export size.
\newdimen\BookExportWidth
\BookExportWidth=11.875in
\newdimen\BookExportHeight
\BookExportHeight=12.000in

\newdimen\BookPageWidth
\BookPageWidth=11.75in
\newdimen\BookPageHeight
\BookPageHeight=11.75in

% Safe area for text falls between the margins.
\newdimen\BookPageMargin
\BookPageMargin=.25in

% Areas outside the safe text area that may be cropped.
\newdimen\BookPageBleed
\BookPageBleed=.125in

% The inside margin differs from the outside margins.
\newdimen\BookPageMarginGutter
\BookPageMarginGutter=.625in

Each area is assigned its own colour:

% Shows as a light red border.
\definecolor[BookDiagnosticBleed][r=1, t=.075, a=0]

% Shows as a purple border.
\definecolor[BookDiagnosticPage][b=1, t=.075, a=0]

% Shows as a gray region.
\definecolor[BookDiagnosticText][g=1, t=.075, a=0]

Calculations for configuring the various area layouts:

\newdimen\BookPageMarginBleed
\BookPageMarginBleed=\the\dimexpr \BookPageMargin + \BookPageBleed \relax

\newdimen\BookPageWidthSafe
\BookPageWidthSafe=\the\dimexpr \BookPageWidth - \BookPageMarginGutter - \BookPageMargin \relax

\newdimen\BookPageHeightMargin
\BookPageHeightMargin=\the\dimexpr \BookPageHeight - \BookPageMargin - 2 \BookPageBleed \relax

\newdimen\BookPageBleedWidth
\BookPageBleedWidth=\the\dimexpr \BookPageWidth + \BookPageBleed \relax
\newdimen\BookPageBleedHeight
\BookPageBleedHeight=\the\dimexpr \BookPageHeight + 2 \BookPageBleed \relax

The paper size definitions are necessary to reveal the crop marks. Here, "Export Size" is equivalent to "Media Size". Changing the value of \BookExportWidth and \BookExportHeight to values larger than \BookPageBleedWidth and \BookPageBleedHeight, respectively, will permit the crop marks to appear.

\definepapersize[BookExportSize][
  width=\BookExportWidth,
  height=\BookExportHeight,
]

\definepapersize[BookPageSizeBleed][
  width=\BookPageBleedWidth,
  height=\BookPageBleedHeight,
]

\definepapersize[BookPageSize][
  width=\BookPageWidth,
  height=\BookPageHeight,
]

\setuppapersize[BookPageSizeBleed][BookPageSize, BookExportSize]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Define the safe area for text. These measurements take into consideration
% bleed and safe margins. The calculations are for a two-page spread.
%
% Always define the layout for a right-hand page.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setuplayout[
  grid=yes,
  location=middle,
  rightmargin=\zeropoint,
  leftmargin=\zeropoint,
  header=\zeropoint,
  footer=\zeropoint,
  width=\BookPageWidthSafe,
  height=middle,
  topspace=\BookPageMarginBleed,
  backspace=\BookPageMarginGutter,
  marking=on,
]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Define a layer that represents the bleed area.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\definelayer[BookLayerBleed][
  state=repeat,
]

\setlayerframed[BookLayerBleed][
  frame=off,
  background=color,
  backgroundcolor=BookDiagnosticBleed,
  offset=\zeropoint,
  overlay=\zeropoint,
  width=\BookPageBleedWidth,
  height=\BookPageBleedHeight,
]{}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Define a layer that indicates where content may go. Images within this
% area may be affected slightly when the physical page is trimmed. Content
% meant to extend to the edge of the page must overrun into the bleed area
% (above). Ensure critical details are fully within the text region (below).
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\definelayer[BookLayerPageRight][
  state=repeat,
]

\setlayerframed[BookLayerPageRight][
  frame=off,
  background=color,
  backgroundcolor=BookDiagnosticPage,
  offset=\zeropoint,
  overlay=\zeropoint,
  width=\BookPageWidth,
  height=\BookPageHeight,
  voffset=\BookPageBleed,
  hoffset=\zeropoint,
]{}

\definelayer[BookLayerPageLeft][
  state=repeat,
]

\setlayerframed[BookLayerPageLeft][
  frame=off,
  background=color,
  backgroundcolor=BookDiagnosticPage,
  offset=\zeropoint,
  overlay=\zeropoint,
  width=\BookPageWidth,
  height=\BookPageHeight,
  voffset=\BookPageBleed,
  hoffset=\BookPageBleed,
]{}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Define a layer that indicates the safe area for text and other content.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\definelayer[BookLayerTextRight][
  state=repeat,
]

\setlayerframed[BookLayerTextRight][
  frame=off,
  background=color,
  backgroundcolor=BookDiagnosticText,
  offset=\zeropoint,
  overlay=\zeropoint,
  width=\BookPageWidthSafe,
  height=\BookPageHeightMargin,
  voffset=\BookPageMarginBleed,
  hoffset=\BookPageMarginGutter,
]{}

\definelayer[BookLayerTextLeft][
  state=repeat,
]

\setlayerframed[BookLayerTextLeft][
  frame=off,
  background=color,
  backgroundcolor=BookDiagnosticText,
  offset=\zeropoint,
  overlay=\zeropoint,
  width=\BookPageWidthSafe,
  height=\BookPageHeightMargin,
  voffset=\BookPageMarginBleed,
  hoffset=\BookPageMarginBleed,
]{}

A fairly minimal test page that sets the background for the left/right pages:

\starttext
  \startbodymatter
    \setupbackgrounds[page][background=]
    Page 1
    \page
    \setupbackgrounds[rightpage][
      background={BookLayerBleed, BookLayerPageRight, BookLayerTextRight},
    ]
    \setupbackgrounds[leftpage][
      background={BookLayerBleed, BookLayerPageLeft, BookLayerTextLeft},
    ]

    \dorecurse{5} {
      \page
      \dorecurse{7}{\input lorem \input ward}
      \dorecurse{1}{\input ward}
    }
  \stopbodymatter
\stoptext

The PDF file includes left/right pages that resemble:

Adjusted page margins

Now we can visually confirm that the text area conforms to the publisher's specifications:

  • Bleed is light red: .125 inch margin
  • Page is magenta: .25 inch margin plus bleed
  • Text area is gray: .625 inch gutter

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.