[jira] [Created] (FOP-2850) Rotated PDF files included with <fo:external-graphic> are misplaced

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (FOP-2850) Rotated PDF files included with <fo:external-graphic> are misplaced

Andreas Joseph Krogh (Jira)
Robin Jansohn created FOP-2850:
----------------------------------

             Summary: Rotated PDF files included with <fo:external-graphic> are misplaced
                 Key: FOP-2850
                 URL: https://issues.apache.org/jira/browse/FOP-2850
             Project: FOP
          Issue Type: Bug
    Affects Versions: 2.3
         Environment: Windows 10
JDK8 64bit
fop 2.3
fop-pdf-images 2.3

            Reporter: Robin Jansohn
         Attachments: fop-settings.xml, test-no-rotation.pdf, test-rotated.pdf, test.fo, test_reproducer_4608614100576861701.pdf, test_workaround_1175329208771328730.pdf, workaround.fo

I've stumbled upon an issue when including PDF files with a rotation angle (e.g. 90 degrees) with {{fo:external-graphic}}. The included PDF graphic overlaps with the previous block in the output PDF. My guess is that somehow width and height are mixed up in the process.

As a workaround it is possible to undo the rotation and fix the paper size of the included PDF before actually creating the result PDF with FOP. In this case the graphic is correctly placed inside the block.

I've attached the necessary files to this issue. I've also created a reproducer application on GitHub so this can be easily reproduced:
https://github.com/jansohn/fop-rotation

----

PDF information with rotation angle
{noformat}
> pdfinfo.exe -box test-rotated.pdf
Creator:        pdftk 2.02 - www.pdftk.com
Producer:       itext-paulo-155 (itextpdf.sf.net-lowagie.com)
CreationDate:   03/06/19 15:51:18
ModDate:        03/06/19 15:51:18
Tagged:         no
Form:           none
Pages:          1
Encrypted:      no
Page size:      595.32 x 841.92 pts (A4) (rotated 90 degrees)
MediaBox:           0.00     0.00   595.32   841.92
CropBox:            0.00     0.00   595.32   841.92
BleedBox:           0.00     0.00   595.32   841.92
TrimBox:            0.00     0.00   595.32   841.92
ArtBox:             0.00     0.00   595.32   841.92
File size:      24801 bytes
Optimized:      no
PDF version:    1.5
{noformat}

PDF information without rotation angle
{noformat}
> pdfinfo.exe -box test-no-rotation.pdf
Creator:        pdftk 2.02 - www.pdftk.com
Producer:       itext-paulo-155 (itextpdf.sf.net-lowagie.com)
CreationDate:   03/06/19 15:51:18
ModDate:        03/07/19 13:44:28
Tagged:         no
Form:           none
Pages:          1
Encrypted:      no
Page size:      842 x 596 pts (A4) (rotated 0 degrees)
MediaBox:           0.00  -596.00   842.00     0.00
CropBox:            0.00  -596.00   842.00     0.00
BleedBox:           0.00  -596.00   842.00     0.00
TrimBox:            0.00  -596.00   842.00     0.00
ArtBox:             0.00  -596.00   842.00     0.00
File size:      31578 bytes
Optimized:      no
PDF version:    1.5
{noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)