ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Henning Hraban Ramm via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Henning Hraban Ramm <texml@fiee.net>
Subject: Bloody PDF boxes and cr*p marks!
Date: Tue, 12 Oct 2021 12:36:42 +0200	[thread overview]
Message-ID: <CDD10C33-BF1B-45BD-B94E-5CB13490EFB2@fiee.net> (raw)

Comrades!

There must have been a time when PDF boxes (i.e. CropBox, TrimBox, BleedBox) worked as they should, but it must have been a short time.
The wiki page https://wiki.contextgarden.net/PDF_Boxes is mostly a documentation of bugs and workarounds, but even that is not entirely correct (any more?).
I gave up on that subject and still fix the boxes with Acrobat Pro whenever I need them to be correct. But that’s no solution.
(And it’s probably also my fault, since I was one of those who wanted this implemented and then didn’t check enough if it does what it should.)

Ok, calm down, try again...

* MediaBox is supposed to be the biggest, i.e. print sheet.
* CropBox is the viewable area – usually same as MediaBox or TrimBox makes sense.
* BleedBox must be TrimBox plus bleed.
* ArtBox is neglectable for whole layouts (same as TrimBox might make sense), just interesting in \externalfigure.

According to PDF Standard, MediaBox is the only required one; but CropBox is the most important one, since PDF viewers rely on it.

With
\setuppaper[A4]
all boxes can be the same (or undefined). Status quo.

With
\setuppaper[A4][A4,oversized]
I’d expect ConTeXt to set...
* MediaBox and CropBox to the bigger format
* TrimBox to the page format (A4)
* BleedBox also to the page format, while no bleed is defined

Status quo: no additional boxes defined.

Beware, \showframe draws a green box at the paper size (supposed TrimBox), this is misleading in Acrobat Reader & Pro, where the TrimBox is shown in green (if this option is activated)!

Bleed is to be defined in \setuplayout:

\showframe
\setuppapersize[A4][A4,oversized]
\setuplayout[
  location=middle,
  bleedoffset=-5mm,
  marking=on,
]
%\setupinteractionscreen[width=max,height=max]

\starttext
X

\stoptext

Status quo: 
* works only with \setupinteractionscreen
* bleedoffset must be negative
* BleedBox is set, but not TrimBox (TB > BB is a nesting error)

Beware, \setupbleeding refers only to stretching of images (\externalfigure)!


This gives more or less correct results:
\setuplayout[
  location=middle,
  trimoffset=-7.5mm,
  bleedoffset=3mm,
  marking=on,
]

* still works only with \setupinteractionscreen
* negative trimoffset defines the TrimBox (actual page size), value is subtracted from sheet size.
* positive bleedoffset (internally added to trimoffset)
* to define trimoffset, I must know the difference between paper size and sheet size ("oversized" adds 15 mm).

I.e. ConTeXt “thinks” from the sheet size instead from the (IMO more natural) paper size.

For me, the more natural setup would be:
\setuplayout[
  trimoffset=0mm, % from the paper size outward
  bleedoffset=3mm, % same, independent of trimoffset
]
% ... and no dependency on interactionscreen!

So far, I ignored cropoffset.
The parameter in itself works as I expected it to: cropoffset=3mm decreases the visible area by 3mm on each side.
But it also moves the other boxes by that value!
IMO that makes no sense, CropBox can be completely independent of the other boxes!
It would be logical to use negative values here, since the size decreases, in opposite to my suggested handling of the other parameters.

Yes, that would mean a backward incompatible change. But how many of us rely on the strange current behavior?
Please let us fix this!


In some cases it makes sense to have different values on e.g. inner and outer edges; I feat that would add a plethora of additional parameters (leftbleedoffset, innerbleedoffset...).
Maybe give a list like in CSS? bleedoffset={3mm,3mm,3mm,0mm} – top, right, bottom, left order implied; not very “ConTeXt style”.


Hraban




___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

             reply	other threads:[~2021-10-12 10:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-12 10:36 Henning Hraban Ramm via ntg-context [this message]
2021-10-12 11:15 ` Hans Hagen via ntg-context
2021-10-12 16:18   ` Henning Hraban Ramm via ntg-context
2021-10-12 18:48     ` Hans Hagen via ntg-context
2021-10-19 20:10       ` Henning Hraban Ramm via ntg-context
2021-10-30 19:21         ` Henning Hraban Ramm via ntg-context
2021-11-01  5:45           ` Duncan Hothersall via ntg-context
2021-11-01  7:05           ` Floris van Manen via ntg-context
2021-11-01  7:58             ` Color profiles (was: Bloody PDF boxes) Henning Hraban Ramm via ntg-context
2021-11-01  8:07               ` Henning Hraban Ramm via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CDD10C33-BF1B-45BD-B94E-5CB13490EFB2@fiee.net \
    --to=ntg-context@ntg.nl \
    --cc=texml@fiee.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).