[XeTeX] Synching PDF paper size with typesetting size

William Adams will.adams at frycomm.com
Mon Nov 7 13:43:04 CET 2011

On Nov 5, 2011, at 5:14 PM, Karljurgen Feuerherm wrote:

> It is true, of course, that one may *not* want B5 pdf when the page is
> B5 (say to allow for trim), so forcing the two to be identical wouldn't
> be the thing to do either...


I've posted code for handling this here --- you also need to put in a special to get the crop, trim and bleed boxes correct.

something like:



%170mm x 240mm. I must have these margins: top: 25mm, bottom: 30mm;
%outside: 25mm; inside: 25mm.

%\stockheight \stockwidth
%converted to BP 'cause using mm made Acrobat 8 report an error
%\paperheight \paperwidth
%\trimtop \trimedge
%top form, first argument is preferred version ---
%figure out your typesize leading and set the proper number of lines
%\textheight \textwidth
%\spinemargin \foremargin
\setulmargins{70.865bp}{*}{1.2}%25mm * 1.2 == 30mm
%\uppermargin \lowermargin
%\headheight \footskip
%\headdrop \headsep
%\marginparsep \marginparwidth \marginparpush



\AtBeginShipout{\special{pdf: put @thispage <</TrimBox [36.0 36.0 517.9 716.3]>>}}
\special{pdf: put @thispage <</TrimBox [36.0 36.0 517.9 716.3]>>}

Test\clearpage Test
William Adams
senior graphic designer
Fry Communications
Sphinx of black quartz, judge my vow.

More information about the XeTeX mailing list