Uploaded image for project: 'FOP'
  1. FOP
  2. FOP-2850

Rotated PDF files included with <fo:external-graphic> are misplaced

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.3
    • None
    • None
    • None
    • Windows 10
      JDK8 64bit
      fop 2.3
      fop-pdf-images 2.3

    Description

      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

      > 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
      

      PDF information without rotation angle

      > 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
      

      Attachments

        1. s1s.patch
          3 kB
          Dave Roxburgh
        2. test_reproducer_4608614100576861701.pdf
          29 kB
          Robin Jansohn
        3. test_workaround_1175329208771328730.pdf
          29 kB
          Robin Jansohn
        4. test-rotated.pdf
          24 kB
          Robin Jansohn
        5. test-no-rotation.pdf
          31 kB
          Robin Jansohn
        6. workaround.fo
          1 kB
          Robin Jansohn
        7. test.fo
          1 kB
          Robin Jansohn
        8. fop-settings.xml
          0.3 kB
          Robin Jansohn

        Activity

          People

            daveroxburgh Dave Roxburgh
            jansohn Robin Jansohn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: