[NTG-context] Trouble setting PDF boxes

Jack Steyn steynjack at gmail.com
Sat Apr 25 18:42:36 CEST 2020

After much searching, my probably laughable attempt consists of combining
the answer to the question at
what I can see in the source at

      local formatters = string.formatters

      local pdfverbose = lpdf.verbose
      local pdfarray = lpdf.array

      local factor  = number.dimenfactors.bp
      local f_value = formatters["\letterpercent.6N"]

      local function boxvalue(n)
          return pdfverbose(f_value(factor * n))

      lpdf.addtopageattributes("TrimBox", pdfarray {
\to \aftereverypage

This code throws no errors, but unfortunately it also has no effect. What
am I doing wrong?


On Sat, 25 Apr 2020 at 22:37, Jack Steyn <steynjack at gmail.com> wrote:

> Hi,
> I am having trouble setting the PDF boxes to my desired dimensions.
> Suppose I have \setuppapersize[*a*][*b*]. I want CropBox = MediaBox = *b*.
> So far, so good: I can just use cropoffset=0mm in \setuplayout. But I want
> TrimBox = *a*. However, as far as I can see, I can't achieve this using
> trimoffset in \setuplayout unless (width of *b*) – (width of *a*) =
> (height of *b*) – (height of *a*), which does not hold in my case. So it
> looks like I need to find another way to set the TrimBox (and the BleedBox,
> which I want to be 3mm wider and taller than the TrimBox). Does anyone know
> how to do this?
> Best,
> Jack
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20200426/8648268b/attachment.htm>

More information about the ntg-context mailing list