Fwd: [DVIPDFMx] supporting trimbox, &c. when making a .pdf

William Adams will.adams at frycomm.com
Thu Jul 31 20:25:47 KST 2008


Okay, I forwarded this on to Heiko and he was kind enough to respond  
--- see below.

At Peter Wilson's suggestion I'm going to go try to work up a package  
for memoir which will provide an interface for setting up .pdf boxes  
--- if anyone has any insight or comments, I'd be grateful.

William

Begin forwarded message:

> From: Heiko Oberdiek <oberdiek at uni-freiburg.de>
> Date: July 31, 2008 12:59:40 AM EDT
> To: William Adams <will.adams at frycomm.com>
> Subject: Re: Fwd: [DVIPDFMx] supporting trimbox, &c. when making  
> a .pdf
>
> Hello,
>
> On Wed, Jul 30, 2008 at 08:17:39AM -0400, William Adams wrote:
>
>> Thought you might find this of interest. I had to download the latest
>> atbegshi.dtx and install it, so I don't think I'm not up-to-date.
>
>> Begin forwarded message:
>
> Thanks for forwarding, I am not subscribed in these lists.
> Please forward my answer as well.
>
>>> From: William Adams <will.adams at frycomm.com>
>>> Date: July 30, 2008 8:16:19 AM EDT
>>> To: dvipdfmx at ktug.or.kr, Unicode-based TeX for Mac OS X and other
>>> platforms <xetex at tug.org>
>>> Subject: Re: [DVIPDFMx] supporting trimbox, &c. when making a .pdf
>>>
>>> On Jul 30, 2008, at 8:08 AM, Alexander Grahn wrote:
>>>
>>>> Not quite, sorry. /AtBeginShipout seems to forget the first page.
>>>>
>>>> An explicit \special{...} right before \begin{document} does the
>>>> trick:
>
>>> \documentclass{minimal}
>>>
>>> \usepackage[paperwidth=630bp,paperheight=810bp]{geometry}
>>>
>>> \usepackage{atbegshi}
>>> \AtBeginShipout{\special{pdf: put @thispage <</TrimBox [9.0 9.0
>>> 621.0 801.0]>>}}
>
> From the documentation:
> | \AtBeginShipout { code }
> |     Execute the code for every page. The page contents is held
> |     in box register \AtBeginShipoutBox and may be modified.
>
> At the time, <code> is called, the box \AtBeginShipoutBox
> is to be shipped out. The <code> with the \special doesn't
> put the \special in that box, thus the \special goes into
> the main vertical list. The unmodified box without the \special
> is then shipped out. The \special will follow on one of the
> next pages (in most cases the next page).
>
> \AtBeginShipout{%
>  \setbox\AtBeginShipoutBox=\hbox{%
>    \special{pdf: put @thispage <</TrimBox[9 9 621 801]>>}%
>    \box\AtBeginShipoutBox
>  }%
> }
>
> BTW, the "\setbox wrapper" is not necessary/allowed in the
> application macros \AtBeginShipoutFirst, \AtBeginShipoutUpperLeft
> and \AtBeginShipoutUpperLeftForeground.
>
> Yours sincerely
>  Heiko <oberdiek at uni-freiburg.de>

-- 
William Adams
senior graphic designer
Fry Communications





More information about the dvipdfmx mailing list