Bug 48302 - Prepress extensions: media-box used as image size when embedding in PDF
Summary: Prepress extensions: media-box used as image size when embedding in PDF
Status: NEW
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: pdf (show other bugs)
Version: trunk
Hardware: PC Windows XP
: P3 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-30 08:06 UTC by Pascal Sancho
Modified: 2012-09-26 11:43 UTC (History)
0 users



Attachments
fop_ouput.pdf: what I get (16.88 KB, application/pdf)
2009-11-30 08:06 UTC, Pascal Sancho
Details
pdf_pdf.fo: main source FO file (1.08 KB, application/octet-stream)
2009-11-30 08:09 UTC, Pascal Sancho
Details
prepress.fo: source FO used for embedded PDF files (10.26 KB, application/octet-stream)
2009-11-30 08:11 UTC, Pascal Sancho
Details
prepress_media.pdf: PDF with crop-box = media-box (6.86 KB, application/pdf)
2009-11-30 08:13 UTC, Pascal Sancho
Details
prepress_trim.pdf: PDF with crop-box = trim-box (6.85 KB, application/pdf)
2009-11-30 08:13 UTC, Pascal Sancho
Details
PDF output with trunk (r1390401) (17.02 KB, application/pdf)
2012-09-26 11:23 UTC, Pascal Sancho
Details
PDF with crop-box = media-box, against latest fop/pdf-image trunks (6.83 KB, application/pdf)
2012-09-26 11:42 UTC, Pascal Sancho
Details
PDF with crop-box = trim-box, against latest fop/pdf-image trunks (6.81 KB, application/pdf)
2012-09-26 11:43 UTC, Pascal Sancho
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal Sancho 2009-11-30 08:06:44 UTC
Created attachment 24633 [details]
fop_ouput.pdf: what I get

FOP TRUNK r884526
fop-pdf-images-2.0.0.SNAPSHOT.jar

I am playing with fox:external-document and fo:external-graphic to embed external PDF.

PDF to insert are both made with FOP, using prepress new feature:
 - prepress_trim.pdf uses fox:crop-box="trim-box"
 - prepress_media.pdf uses fox:crop-box="media-box"

For both FOs, the result is not what I expect (see fop_output.pdf).

I suspect several things:
 - resetting media-box lower-left corner to 0.
 - using media-box size instead of trim-box (fo:external-graphic)
 - using media-box size for all *-box (fox:external-document)

I wonder whether negative coordinates in PDF *-box are valid or not (I've sawn similar issues using Adobe Illustrator with FOP PDFs).
Comment 1 Pascal Sancho 2009-11-30 08:09:42 UTC
Created attachment 24634 [details]
pdf_pdf.fo: main source FO file

FO used to generate the fo_output.pdf file
Comment 2 Pascal Sancho 2009-11-30 08:11:42 UTC
Created attachment 24635 [details]
prepress.fo: source FO used for embedded PDF files

The 2 PDF sources are generated with this unique source FO:
 - prepress_trim.pdf uses fox:crop-box="trim-box"
 - prepress_media.pdf uses fox:crop-box="media-box"
Comment 3 Pascal Sancho 2009-11-30 08:13:21 UTC
Created attachment 24636 [details]
prepress_media.pdf: PDF with crop-box = media-box
Comment 4 Pascal Sancho 2009-11-30 08:13:55 UTC
Created attachment 24637 [details]
prepress_trim.pdf: PDF with crop-box = trim-box
Comment 5 Glenn Adams 2012-04-07 01:41:30 UTC
resetting P2 open bugs to P3 pending further review
Comment 6 Mehdi Houshmand 2012-09-26 10:43:28 UTC
Pascal, could you try the latest pdf-image plugin please? Let me know what you think and we can change the way the current if you think it necessary.
Comment 7 Pascal Sancho 2012-09-26 11:21:32 UTC
(In reply to comment #6)
> Pascal, could you try the latest pdf-image plugin please? Let me know what
> you think and we can change the way the current if you think it necessary.

Just tried after update/build on both fop & pdf-image:

output is better: trim-box is now taken into account for the size of the rectangle containing the pdf (both as external graphics and fox:document).

But the image position is always shifted to the bottom-left corner, probably with the value of the difference between media-box and trim-box.

I'll attach pdf output from FOP trunk
Comment 8 Pascal Sancho 2012-09-26 11:23:45 UTC
Created attachment 29417 [details]
PDF output with trunk (r1390401)
Comment 9 Pascal Sancho 2012-09-26 11:42:11 UTC
Created attachment 29418 [details]
PDF with crop-box = media-box, against latest fop/pdf-image trunks
Comment 10 Pascal Sancho 2012-09-26 11:43:30 UTC
Created attachment 29419 [details]
PDF with crop-box = trim-box, against latest fop/pdf-image trunks

Note that 2 new versions do not change anything.