[tex-live] How to set TrimBox, BleedBox in LaTeX + dvips

Zdenek Wagner zdenek.wagner at gmail.com
Sun Oct 4 09:55:56 CEST 2009

2009/10/3 Axel Strübing <axel.struebing at freenet.de>:
> Dear all,
> the cited question is from an old entry on the pdftex list. In my opinion an
> answer is better placed here.
That's my intention to do it in my zwpagelayout package. I often get
responses that my files are usable but lack some PDF/X data. I know
that there are packages that can do it but they depend on hyperref.
Unfortunatelly, hyperref is very huge and conflicts with other
packages (at least some versions), e.g. with Velthuis Devanagari (I
have not tried the latest version, maybe it was fixed). I want a
simple solution. Anyway, a file that should be used for printing and
never for use as a hypertext document does not need hyperref. I also
want to have my files verified on a real phototypesetter so it will
take some time to find the solution and I will have to reread the
specification. If someone has macros to share with me I would
certainly appreciate it.

> I did come across the very same problem David asked there.
> We can achieve this by means of the following pdfmark command '[ {ThisPage} <<
> /#1 [#2] >> /PUT pdfmark'. Because all box entries besides CropBox have to be
> specified for every single page in its pdfdict this lead to using the bop-hook
> from dvips. I do not know if a mechanism is desired for setting different
> values for different pages (this is impossible with my implementation).
> I would be glad if someone has any suggestions or comments about the following
> two macros.
> The first collects the box specifications in a macro.
> \let\@processPdfBoxSpec\@empty%
> \newcommand{\@setPdfBox}[2]{%
>  \xdef\@processPdfBoxSpec{%
>    [ {ThisPage} << /#1 [#2] >> /PUT pdfmark
>    \@processPdfBoxSpec
>  }%
> }
> The second writes a \special and defines the postscript procedure that calls
> the pdfmark commands that inserts the box specifications into the
> pagedictionary. Furthermore the old definition of bop-hook (if any) is saved
> and bop-hook is defined as the union of the old definition and @setpdfboxes:
> \newcommand{\@setPdfBoxes}{%
>  \ifx\@processPdfBoxSpec\@empty{\relax}%
>  \else%
>  {%
>  \special{!userdict begin^^J%
>    /@setpdfboxes{\@processPdfBoxSpec} def^^J%
>    /bop-hook where{pop /@pdfboxbophook /bop-hook load def^^J%
>    /bop-hook{ @pdfboxbophook @setpdfboxes } def }{/bop-hook {@setpdfboxes}
> def^^J%
>    }ifelse end}%
>  }%
> \fi%
> }%
> \@onlypreamble\@setPdfBoxes
> \@onlypreamble\@setPdfBox
>>Dear All,
>>Can anyone tell that how we can set the TrimBox, BleedBox using LaTeX
>>commands or directly in PS file using postscript commands to appear
>>same in resulting PDF when viewed in Acrobat.
>>I understand that in PDFLaTeX one can set this using \pdfpageattr and
>>\pdfpagesattr but I want to know that how we can achieve same in LaTeX
>>or in resulting PS using postscript command or pdfmarks for the same.
> regards
> Axel Strübing

Zdeněk Wagner

More information about the tex-live mailing list