Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-1360

Adding page from one doc to another (as a layer) results in faulty doc


    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.7.0
    • Fix Version/s: None
    • Component/s: Utilities
    • Environment:
      Windows (x64), JRE 1.6u29 (x86)


      Using the process laid out in testLayerImport() of http://java2s.com/Open-Source/Java/PDF/PDFBox-1.4.0/org/apache/pdfbox/util/TestLayerUtility.java.htm , a PDF document is generated that can be viewed in both Adobe Reader X (10.1.3) and SumatraPDF.

      But when opening some of the tools in Reader X, an error box gets displayed. It warns about a potentially corrupt file and potentially incorrect display

      For example, opening the resulting PDF, pressing F4 to view the layer utils will trigger this behavior.

      I used page 1 from

      respectively, to create a PDF with page 1 of (1) overlayed with page 1 of (2).
      These are just random Google results. The error was triggered with more concrete files of my own as well

      Since the PDF displays fine on initial load, it wouldn't be so bad if it wasn't exactly the layering I was after (overlaying, toggling display of individual layers)

      I tried different variations:

      • created a new document and importPage() from (1)
      • did not create a new document but used (1) directly
      • a few permutations of adding page/saving/re-loading or not

      Alternatively - is there a way to add a layer/OCG without creating an XObject form off it?



          Issue Links



              • Assignee:
                lehmi Andreas Lehmkühler
                tbskrmn Tobias Skarman
              • Votes:
                0 Vote for this issue
                2 Start watching this issue


                • Created: