ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* /CropBox overflows /MediaBox
@ 2023-02-28 17:23 Pablo Rodriguez via ntg-context
  2023-02-28 20:18 ` Hans Hagen via ntg-context
       [not found] ` <a64d5f5b-5bfa-920d-eebf-195287f2eda7@xs4all.nl>
  0 siblings, 2 replies; 6+ messages in thread
From: Pablo Rodriguez via ntg-context @ 2023-02-28 17:23 UTC (permalink / raw)
  To: ConTeXt users; +Cc: Pablo Rodriguez

Dear list,

I have the following source:

  \nopdfcompression
  \setupinteractionscreen
    [width=max]
  \setuplayout
    [standard]
    [backspace=.7\textwidth,
     cutspace=\cutspace,
     width=middle]
  \starttext
  \startmakeup[page]
  \null
  \stopmakeup
  \startmakeup[standard]
  \null
  \stopmakeup
  \stoptext

Boxes are defined in the following objects:

  3 0 obj
  [ 0 0 595.275590072 841.88975789 ]
  endobj

  5 0 obj
  [ 0 0 595.27559 841.889758 ]
  endobj

  8 0 obj
  [ 0 0 968.199847 841.889758 ]
  endobj

Page 1 has /MediaBox redirected to object 3 and /CropBox redirected to
object 5.

Page 2 has /MediaBox redirected to object 3 and /CropBox redirected to
object 8.

I’m not sure whether the oversized /CropBox in the sample above is a
bug triggered by the use of "\setupinteractionscreen[width=fit]".

From the PDF–1.7 specification
(https://opensource.adobe.com/dc-acrobat-sdk-docs/standards/pdfstandards/pdf/PDF32000_2008.pdf#page=636):

  The crop, bleed, trim, and art boxes shall not ordinarily extend
  beyond the boundaries of the media box. If they do, they are
  effectively reduced to their intersection with the media box.

https://wiki.contextgarden.net/PDF_Boxes displays an image of (what I
guess) the ordinary case: /CropBox fits inside /MediaBox.

Could anyone be so kind to confirm the issue or to explain the
rationale behind the oversized /CropBox?

Many thanks for your help,

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

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: /CropBox overflows /MediaBox
  2023-02-28 17:23 /CropBox overflows /MediaBox Pablo Rodriguez via ntg-context
@ 2023-02-28 20:18 ` Hans Hagen via ntg-context
  2023-03-01 15:44   ` Pablo Rodriguez via ntg-context
       [not found] ` <a64d5f5b-5bfa-920d-eebf-195287f2eda7@xs4all.nl>
  1 sibling, 1 reply; 6+ messages in thread
From: Hans Hagen via ntg-context @ 2023-02-28 20:18 UTC (permalink / raw)
  To: Pablo Rodriguez via ntg-context; +Cc: Hans Hagen

On 2/28/2023 6:23 PM, Pablo Rodriguez via ntg-context wrote:
> Dear list,
> 
> I have the following source:
> 
>    \nopdfcompression
>    \setupinteractionscreen
>      [width=max]
>    \setuplayout
>      [standard]
>      [backspace=.7\textwidth,
>       cutspace=\cutspace,
>       width=middle]
>    \starttext
>    \startmakeup[page]
>    \null
>    \stopmakeup
>    \startmakeup[standard]
>    \null
>    \stopmakeup
>    \stoptext
> 
> Boxes are defined in the following objects:
> 
>    3 0 obj
>    [ 0 0 595.275590072 841.88975789 ]
>    endobj
> 
>    5 0 obj
>    [ 0 0 595.27559 841.889758 ]
>    endobj
> 
>    8 0 obj
>    [ 0 0 968.199847 841.889758 ]
>    endobj
> 
> Page 1 has /MediaBox redirected to object 3 and /CropBox redirected to
> object 5.
> 
> Page 2 has /MediaBox redirected to object 3 and /CropBox redirected to
> object 8.
> 
> I’m not sure whether the oversized /CropBox in the sample above is a
> bug triggered by the use of "\setupinteractionscreen[width=fit]".
> 
>  From the PDF–1.7 specification
> (https://opensource.adobe.com/dc-acrobat-sdk-docs/standards/pdfstandards/pdf/PDF32000_2008.pdf#page=636):
> 
>    The crop, bleed, trim, and art boxes shall not ordinarily extend
>    beyond the boundaries of the media box. If they do, they are
>    effectively reduced to their intersection with the media box.
> 
> https://wiki.contextgarden.net/PDF_Boxes displays an image of (what I
> guess) the ordinary case: /CropBox fits inside /MediaBox.
> 
> Could anyone be so kind to confirm the issue or to explain the
> rationale behind the oversized /CropBox?
different code path (dates from mkiv but i can adapt it for lmtx)

anyway, overflow is in the 7th decimal so quite harmless i guess

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------

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

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: /CropBox overflows /MediaBox
  2023-02-28 20:18 ` Hans Hagen via ntg-context
@ 2023-03-01 15:44   ` Pablo Rodriguez via ntg-context
  0 siblings, 0 replies; 6+ messages in thread
From: Pablo Rodriguez via ntg-context @ 2023-03-01 15:44 UTC (permalink / raw)
  To: Hans Hagen via ntg-context; +Cc: Pablo Rodriguez

On 2/28/23 21:18, Hans Hagen via ntg-context wrote:
> On 2/28/2023 6:23 PM, Pablo Rodriguez via ntg-context wrote:
>> [...]
>> Could anyone be so kind to confirm the issue or to explain the
>> rationale behind the oversized /CropBox?
> different code path (dates from mkiv but i can adapt it for lmtx)
>
> anyway, overflow is in the 7th decimal so quite harmless i guess

Many thanks for your reply, Hans.

Sorry, I’m afraid my explanation was poor.

/MediaBox for both pages is [ 0 0 595.275590072 841.88975789 ].

/CropBox for page 1 is [ 0 0 595.27559 841.889758 ] (which is fine, no
problem here).

/CropBox for page 2 is [ 0 0 968.199847 841.889758 ] (which is a much
wider box, converting it from portrait to landscape).

I hope it is clearer now.

Many thanks for your help,

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

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: /CropBox overflows /MediaBox
       [not found] ` <a64d5f5b-5bfa-920d-eebf-195287f2eda7@xs4all.nl>
@ 2023-03-06 18:02   ` Pablo Rodriguez via ntg-context
  2023-03-06 22:06     ` Hans Hagen via ntg-context
  0 siblings, 1 reply; 6+ messages in thread
From: Pablo Rodriguez via ntg-context @ 2023-03-06 18:02 UTC (permalink / raw)
  To: ConTeXt users; +Cc: Pablo Rodriguez

On 3/2/23 00:20, Hans Hagen wrote:
> On 2/28/2023 6:23 PM, Pablo Rodriguez via ntg-context wrote:
>> [...]
> I only see one size. Anyway, attached a fix for the different rounding.

Sorry, Hans, I copied the wrong sample (value for "width" in
"\setupinteractionscreen" should read "fit" instead of "max"):

  \nopdfcompression
  \setupinteractionscreen
    [width=fit]
  \setuplayout
    [standard]
    [backspace=.7\textwidth,
     cutspace=\cutspace,
     width=middle]
  \starttext
  \startmakeup[page]
  \null
  \stopmakeup
  \startmakeup[standard]
  \null
  \stopmakeup
  \stoptext

Here are the boxes (using current latest from today [2023.03.06 14:48]):

  3 0 obj
  [ 0 0 595.275590072 841.88975789 ]
  endobj

  7 0 obj
  [ 0 0 968.199847496 841.88975789 ]
  endobj

Page 1 (object 4) uses object 3 as /CropBox, /MediaBox and /TrimBox.

Page 2 (object 7) uses object 3 as /MediaBox and object 7 as /CropBox
and /TrimBox (I have just discovered it).

I think it is better to avoid having a page with a /CropBox larger than
its /MediaBox.

But I’m afraid that it is wrong to have a /TrimBox larger than the
/MediaBox for the same page.

I hope it is clear now. Sorry for the mistake in copying the wrong sample.

Many thanks for your help,

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

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: /CropBox overflows /MediaBox
  2023-03-06 18:02   ` Pablo Rodriguez via ntg-context
@ 2023-03-06 22:06     ` Hans Hagen via ntg-context
  2023-03-07 14:38       ` Pablo Rodriguez via ntg-context
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen via ntg-context @ 2023-03-06 22:06 UTC (permalink / raw)
  To: ntg-context; +Cc: Hans Hagen

On 3/6/2023 7:02 PM, Pablo Rodriguez via ntg-context wrote:

> But I’m afraid that it is wrong to have a /TrimBox larger than the
> /MediaBox for the same page.

Afaik the standard permits is to one gets what one asks. I will add some 
checks plus a warning and hopefully not break something.

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------

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

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: /CropBox overflows /MediaBox
  2023-03-06 22:06     ` Hans Hagen via ntg-context
@ 2023-03-07 14:38       ` Pablo Rodriguez via ntg-context
  0 siblings, 0 replies; 6+ messages in thread
From: Pablo Rodriguez via ntg-context @ 2023-03-07 14:38 UTC (permalink / raw)
  To: Hans Hagen via ntg-context; +Cc: Pablo Rodriguez

On 3/6/23 23:06, Hans Hagen via ntg-context wrote:
> On 3/6/2023 7:02 PM, Pablo Rodriguez via ntg-context wrote:
> 
>> But I’m afraid that it is wrong to have a /TrimBox larger than the
>> /MediaBox for the same page.
> 
> Afaik the standard permits is to one gets what one asks. I will add some 
> checks plus a warning and hopefully not break something.

Many thanks for the check that avoids this issue.

As for the specification in re with boxes larger than the media box:

In theory, trim and crop boxes may be larger than the media box. But the
specification also warns that in that case, “they [would be] effectively
reduced to their intersection with the media box”

In practice, I see that as an issue of logical consistence. I don’t see
a way of cropping or trimming an A5 page inside the boundaries of an A3
page.

Of course, I may be missing something, but I see crop and trim as
synonyms for cut or reduce.

Many thanks again for your help,

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

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-03-07 14:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-28 17:23 /CropBox overflows /MediaBox Pablo Rodriguez via ntg-context
2023-02-28 20:18 ` Hans Hagen via ntg-context
2023-03-01 15:44   ` Pablo Rodriguez via ntg-context
     [not found] ` <a64d5f5b-5bfa-920d-eebf-195287f2eda7@xs4all.nl>
2023-03-06 18:02   ` Pablo Rodriguez via ntg-context
2023-03-06 22:06     ` Hans Hagen via ntg-context
2023-03-07 14:38       ` Pablo Rodriguez via ntg-context

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).