ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* ConTeXt ignores crop in some pdf graphics
@ 2018-09-03 15:31 Mari Voipio
  2018-09-04  7:00 ` Henning Hraban Ramm
  0 siblings, 1 reply; 8+ messages in thread
From: Mari Voipio @ 2018-09-03 15:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1319 bytes --]

Hello!

After updating ConTeXt I found out that it has suddenly started to
ignore the crop in some of my pdf graphics. These graphics look ok
(=cropped) in Acrobat and SumatraPDF, but when the graphic is placed,
the cropbox (?) is ignored and there's all this blank space around the
graphic, space that shouldn't be there. This is new behaviour, all of
the graphics worked as expected in my previous ConTeXt (from September
2017). Minimal sample is attached to this email, hopefully it is small
enough to make it to the mailing list.

After a quick look it seems that all the problematic graphics are pdf
output from CorelDraw, from different versions of that. Oddly the
problem doesn't affect all cropped graphics that originate from
CorelDraw, just some of them. There are even graphics that have been
outputted from one and same file where one works and the other
doesn't.

If this only concerns files from Corel (and not those I cropped in
Acrobat), I can fix it in Corel if necessary. However, it would be
preferable if ConTeXt can be forced to take the cropping into account.
I tried looking for a solution on the wiki, but it wasn't very helpful
(or I don't know what I'm looking for). I thought adding something to
\externalfigure might do the trick, but there doesn't seem to be a
suitable key.


Thanks,
Mari

[-- Attachment #2: cropping_problem.pdf --]
[-- Type: application/pdf, Size: 10003 bytes --]

[-- Attachment #3: cropping_problem.tex --]
[-- Type: application/octet-stream, Size: 314 bytes --]

\starttext

\placefigure
    [here][fig:ex symbol]
    {EX symbol for instruments for hazardous atmosphere}
    {\externalfigure[ex][frame=on]}


% \placefigure
%     [here][fig:ethernet connection]
%     {Ethernet connector location}
%     {\externalfigure[ethernet_connector][frame=on]}

\stoptext

[-- Attachment #4: ex.pdf --]
[-- Type: application/pdf, Size: 6337 bytes --]

[-- Attachment #5: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

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

* Re: ConTeXt ignores crop in some pdf graphics
  2018-09-03 15:31 ConTeXt ignores crop in some pdf graphics Mari Voipio
@ 2018-09-04  7:00 ` Henning Hraban Ramm
  2018-09-04 19:22   ` Pablo Rodriguez
  0 siblings, 1 reply; 8+ messages in thread
From: Henning Hraban Ramm @ 2018-09-04  7:00 UTC (permalink / raw)
  To: ntg-context

Hi Mari,
I can confirm the same behaviour with graphics from other sources like
Illustrator - seems like ConTeXt doesn't use the CropBox (visible size)
any more, but the MediaBox (full sheet). Or maybe the TrimBox (cut size).
It would make sense to have than configurable, but the change in
behaviour is really inconvenient.

Greetlings from one row in front of you ;)
Hraban

Am 03.09.2018 um 17:31 schrieb Mari Voipio:
> Hello!
> 
> After updating ConTeXt I found out that it has suddenly started to
> ignore the crop in some of my pdf graphics. These graphics look ok
> (=cropped) in Acrobat and SumatraPDF, but when the graphic is placed,
> the cropbox (?) is ignored and there's all this blank space around the
> graphic, space that shouldn't be there. This is new behaviour, all of
> the graphics worked as expected in my previous ConTeXt (from September
> 2017). Minimal sample is attached to this email, hopefully it is small
> enough to make it to the mailing list.
> 
> After a quick look it seems that all the problematic graphics are pdf
> output from CorelDraw, from different versions of that. Oddly the
> problem doesn't affect all cropped graphics that originate from
> CorelDraw, just some of them. There are even graphics that have been
> outputted from one and same file where one works and the other
> doesn't.
> 
> If this only concerns files from Corel (and not those I cropped in
> Acrobat), I can fix it in Corel if necessary. However, it would be
> preferable if ConTeXt can be forced to take the cropping into account.
> I tried looking for a solution on the wiki, but it wasn't very helpful
> (or I don't know what I'm looking for). I thought adding something to
> \externalfigure might do the trick, but there doesn't seem to be a
> suitable key.
> 
> 
> Thanks,
> Mari
> 
> 
> 
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
> 

___________________________________________________________________________________
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
___________________________________________________________________________________

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

* Re: ConTeXt ignores crop in some pdf graphics
  2018-09-04  7:00 ` Henning Hraban Ramm
@ 2018-09-04 19:22   ` Pablo Rodriguez
  2018-09-04 20:40     ` Henning Hraban Ramm
  0 siblings, 1 reply; 8+ messages in thread
From: Pablo Rodriguez @ 2018-09-04 19:22 UTC (permalink / raw)
  To: ntg-context

On 09/04/2018 09:00 AM, Henning Hraban Ramm wrote:
> Hi Mari,
> I can confirm the same behaviour with graphics from other sources like
> Illustrator - seems like ConTeXt doesn't use the CropBox (visible size)
> any more, but the MediaBox (full sheet). Or maybe the TrimBox (cut size).
> It would make sense to have than configurable, but the change in
> behaviour is really inconvenient.

Hi Mari and Hraban,

I have just discovered that \setupexternalfigure has a "size" option
with values "none media crop trim art".

They don’t seem to work, but I wonder whether this might be the
configuration command that you are looking for (which might have a bug).

Just in case it helps,

Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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
___________________________________________________________________________________

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

* Re: ConTeXt ignores crop in some pdf graphics
  2018-09-04 19:22   ` Pablo Rodriguez
@ 2018-09-04 20:40     ` Henning Hraban Ramm
  2018-09-05 14:37       ` Pablo Rodriguez
  0 siblings, 1 reply; 8+ messages in thread
From: Henning Hraban Ramm @ 2018-09-04 20:40 UTC (permalink / raw)
  To: ntg-context

Am 04.09.2018 um 21:22 schrieb Pablo Rodriguez:
> On 09/04/2018 09:00 AM, Henning Hraban Ramm wrote:
>> Hi Mari,
>> I can confirm the same behaviour with graphics from other sources like
>> Illustrator - seems like ConTeXt doesn't use the CropBox (visible size)
>> any more, but the MediaBox (full sheet). Or maybe the TrimBox (cut size).
>> It would make sense to have than configurable, but the change in
>> behaviour is really inconvenient.
> 
> Hi Mari and Hraban,
> 
> I have just discovered that \setupexternalfigure has a "size" option
> with values "none media crop trim art".
> 
> They don’t seem to work, but I wonder whether this might be the
> configuration command that you are looking for (which might have a bug).

Hi Pablo,

Hans investigated and could trace my problem to an Acrobat bug (or at
least it doesn't adhere to the PDF specs): I had my logo exported from
Illustrator and changed the boxes in Acrobat Pro 9, then saved. But if
you don't "save as", Acrobat creates a XForm inside a page, but doesn't
set the boxes correctly for the page (CropBox missing, Artbox was what I
needed).

While all(?) viewers work around this, ConTeXt's new PDF handler, the
ppl library, adheres strictly to the PDF specs and falls back to
MediaBox if CropBox is missing.

I tried size=artbox and box=artbox, but size=art actually does what I
need - thanks for the hint!

Greetlings, 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
___________________________________________________________________________________

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

* Re: ConTeXt ignores crop in some pdf graphics
  2018-09-04 20:40     ` Henning Hraban Ramm
@ 2018-09-05 14:37       ` Pablo Rodriguez
  2018-09-05 15:01         ` luigi scarso
  2018-09-05 17:56         ` Mari Voipio
  0 siblings, 2 replies; 8+ messages in thread
From: Pablo Rodriguez @ 2018-09-05 14:37 UTC (permalink / raw)
  To: ntg-context

On 09/04/2018 10:40 PM, Henning Hraban Ramm wrote:
> [...]
> Hans investigated and could trace my problem to an Acrobat bug (or at
> least it doesn't adhere to the PDF specs): I had my logo exported from
> Illustrator and changed the boxes in Acrobat Pro 9, then saved. But if
> you don't "save as", Acrobat creates a XForm inside a page, but doesn't
> set the boxes correctly for the page (CropBox missing, Artbox was what I
> needed).

Hi Hraban,

the document sent by Mari (ex.pdf) contains the following information:

    4 0 obj

    <<

      /CropBox [ 265.961 392.102 329.315 445.535 ]

      /Parent 2 0 R

      /Contents 5 0 R

      /BleedBox [ 265.961 392.102 329.315 445.535 ]

      /MediaBox [ -9 -9 604.276 850.89 ]

      /TrimBox [ 265.961 392.102 329.315 445.535 ]

      /Resources <<

        /ProcSet [ /PDF ]

        /ExtGState <<

          /GS6 6 0 R

        >>

      >>

      /Type /Page

    >>

    endobj


I would say, that in the following sample:

    \starttext

    \externalfigure[ex.pdf][size=crop]

    \stoptext


the option "size" doesn’t seem to work.

Or is the original ex.pdf document flawed?

Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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
___________________________________________________________________________________

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

* Re: ConTeXt ignores crop in some pdf graphics
  2018-09-05 14:37       ` Pablo Rodriguez
@ 2018-09-05 15:01         ` luigi scarso
  2018-09-05 17:56         ` Mari Voipio
  1 sibling, 0 replies; 8+ messages in thread
From: luigi scarso @ 2018-09-05 15:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1450 bytes --]

On Wed, Sep 5, 2018 at 4:37 PM Pablo Rodriguez <oinos@gmx.es> wrote:

> On 09/04/2018 10:40 PM, Henning Hraban Ramm wrote:
> > [...]
> > Hans investigated and could trace my problem to an Acrobat bug (or at
> > least it doesn't adhere to the PDF specs): I had my logo exported from
> > Illustrator and changed the boxes in Acrobat Pro 9, then saved. But if
> > you don't "save as", Acrobat creates a XForm inside a page, but doesn't
> > set the boxes correctly for the page (CropBox missing, Artbox was what I
> > needed).
>
> Hi Hraban,
>
> the document sent by Mari (ex.pdf) contains the following information:
>
>     4 0 obj
>
>     <<
>
>       /CropBox [ 265.961 392.102 329.315 445.535 ]
>
>       /Parent 2 0 R
>
>       /Contents 5 0 R
>
>       /BleedBox [ 265.961 392.102 329.315 445.535 ]
>
>       /MediaBox [ -9 -9 604.276 850.89 ]
>
>       /TrimBox [ 265.961 392.102 329.315 445.535 ]
>
>       /Resources <<
>
>         /ProcSet [ /PDF ]
>
>         /ExtGState <<
>
>           /GS6 6 0 R
>
>         >>
>
>       >>
>
>       /Type /Page
>
>     >>
>
>     endobj
>
>
> I would say, that in the following sample:
>
>     \starttext
>
>     \externalfigure[ex.pdf][size=crop]
>
>     \stoptext
>
>
> the option "size" doesn’t seem to work.
>
> Or is the original ex.pdf document flawed?
>

we are working to extend luatex to manage these situations.


-- 
luigi

[-- Attachment #1.2: Type: text/html, Size: 2108 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

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

* Re: ConTeXt ignores crop in some pdf graphics
  2018-09-05 14:37       ` Pablo Rodriguez
  2018-09-05 15:01         ` luigi scarso
@ 2018-09-05 17:56         ` Mari Voipio
  2018-09-05 20:08           ` Pablo Rodriguez
  1 sibling, 1 reply; 8+ messages in thread
From: Mari Voipio @ 2018-09-05 17:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 2890 bytes --]

Hello Pablo,

thank you for digging up all of that. What I found out today is that
while a graphic outputted from an old Corel (output e.g. pdf 1.3) has
all that extra whitespace, a graphic outputted from my newish Corel
2017 (pdf 1.7) seems to have  a working cropbox as does the old
graphic recropped with Acrobat as Hraban's Save As trick). I've
included an old graphic (fm.pdf), the same outputted today
(fm_corel_2017) and the old one after recropping it (I reset old
cropbox and cropped again) (fm_cropped), if somebody feels like
investigating further.

While the cropbox problem meant that I had to spend a few hours today
fixing problematic graphics in my big old file, the fact that output
from my current Corel works means that any future graphics will be
fine and I don't have to change my workflows. This reduces the problem
into the level of minor annoyance, assuming it can't be fixed.

Thank you everybody for your help,

Mari
On Wed, Sep 5, 2018 at 5:40 PM Pablo Rodriguez <oinos@gmx.es> wrote:
>
> On 09/04/2018 10:40 PM, Henning Hraban Ramm wrote:
> > [...]
> > Hans investigated and could trace my problem to an Acrobat bug (or at
> > least it doesn't adhere to the PDF specs): I had my logo exported from
> > Illustrator and changed the boxes in Acrobat Pro 9, then saved. But if
> > you don't "save as", Acrobat creates a XForm inside a page, but doesn't
> > set the boxes correctly for the page (CropBox missing, Artbox was what I
> > needed).
>
> Hi Hraban,
>
> the document sent by Mari (ex.pdf) contains the following information:
>
>     4 0 obj
>
>     <<
>
>       /CropBox [ 265.961 392.102 329.315 445.535 ]
>
>       /Parent 2 0 R
>
>       /Contents 5 0 R
>
>       /BleedBox [ 265.961 392.102 329.315 445.535 ]
>
>       /MediaBox [ -9 -9 604.276 850.89 ]
>
>       /TrimBox [ 265.961 392.102 329.315 445.535 ]
>
>       /Resources <<
>
>         /ProcSet [ /PDF ]
>
>         /ExtGState <<
>
>           /GS6 6 0 R
>
>         >>
>
>       >>
>
>       /Type /Page
>
>     >>
>
>     endobj
>
>
> I would say, that in the following sample:
>
>     \starttext
>
>     \externalfigure[ex.pdf][size=crop]
>
>     \stoptext
>
>
> the option "size" doesn’t seem to work.
>
> Or is the original ex.pdf document flawed?
>
> Pablo
> --
> http://www.ousia.tk
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

[-- Attachment #2: fm.pdf --]
[-- Type: application/pdf, Size: 6201 bytes --]

[-- Attachment #3: fm_corel_2017.pdf --]
[-- Type: application/pdf, Size: 1986 bytes --]

[-- Attachment #4: fm_cropped.pdf --]
[-- Type: application/pdf, Size: 5680 bytes --]

[-- Attachment #5: fm_test.tex --]
[-- Type: application/octet-stream, Size: 353 bytes --]

\starttext

\placefigure
    [here][]
    {FM approved (old)}
    {\externalfigure[fm][frame=on]}

\page

\placefigure
    [here][]
    {FM approved (Corel 2017)}
    {\externalfigure[fm_corel_2017][frame=on]}

\placefigure
    [here][]
    {FM approved (cropped in Acrobat)}
    {\externalfigure[fm_cropped][frame=on]}


\stoptext

[-- Attachment #6: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

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

* Re: ConTeXt ignores crop in some pdf graphics
  2018-09-05 17:56         ` Mari Voipio
@ 2018-09-05 20:08           ` Pablo Rodriguez
  0 siblings, 0 replies; 8+ messages in thread
From: Pablo Rodriguez @ 2018-09-05 20:08 UTC (permalink / raw)
  To: ntg-context

On 09/05/2018 07:56 PM, Mari Voipio wrote:
> Hello Pablo,
> 
> thank you for digging up all of that. What I found out today is that
> while a graphic outputted from an old Corel (output e.g. pdf 1.3) has
> all that extra whitespace, a graphic outputted from my newish Corel
> 2017 (pdf 1.7) seems to have  a working cropbox as does the old
> graphic recropped with Acrobat as Hraban's Save As trick). I've
> included an old graphic (fm.pdf), the same outputted today
> (fm_corel_2017) and the old one after recropping it (I reset old
> cropbox and cropped again) (fm_cropped), if somebody feels like
> investigating further.

Hello Mari,

only a comment, Corel 2017 sets all boxes with the same values:

  /MediaBox [ -1 -1 48.9999 23.8555 ]
  /TrimBox [ -1 -1 48.9999 23.8555 ]
  /CropBox [ -1 -1 48.9999 23.8555 ]

Also your "fm.pdf" works fine when the media box has the same values as
the other boxes.

Best wishes,

Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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
___________________________________________________________________________________

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

end of thread, other threads:[~2018-09-05 20:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-03 15:31 ConTeXt ignores crop in some pdf graphics Mari Voipio
2018-09-04  7:00 ` Henning Hraban Ramm
2018-09-04 19:22   ` Pablo Rodriguez
2018-09-04 20:40     ` Henning Hraban Ramm
2018-09-05 14:37       ` Pablo Rodriguez
2018-09-05 15:01         ` luigi scarso
2018-09-05 17:56         ` Mari Voipio
2018-09-05 20:08           ` Pablo Rodriguez

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