[ 
https://issues.apache.org/jira/browse/FOP-3365?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tilman Hausherr updated FOP-3365:
---------------------------------
    Attachment: screenshot-1.png

> /StructureTreeRoot/ParentTreeNextKey is missing in accessible PDF output file
> -----------------------------------------------------------------------------
>
>                 Key: FOP-3365
>                 URL: https://issues.apache.org/jira/browse/FOP-3365
>             Project: FOP
>          Issue Type: Bug
>          Components: renderer/pdf
>    Affects Versions: 2.12
>            Reporter: Tilman Hausherr
>            Priority: Minor
>         Attachments: fop.pdf, screenshot-1.png
>
>
> Out of curiosity I've been looking at the PDF file generated by 
> {{testMultipleStaticContentArtifact()}} and ran one of the PDFBox tests on it 
> (you need the PDFMergerUtilityTest code in the PDFBox project).
> {code:java}
>         try (PDDocument doc = Loader.loadPDF(file))
>         {
>             PDStructureTreeRoot structureTreeRoot = 
> doc.getDocumentCatalog().getStructureTreeRoot();
>             if (structureTreeRoot != null && 
> structureTreeRoot.getParentTree() != null)
>             {
>                 checkWithNumberTree(doc);
>                 checkForPageOrphans(doc);
>                 Map<String, PDStructureElement> idTreeMap = 
> Collections.emptyMap();
>                 PDNameTreeNode<PDStructureElement> idTree = 
> structureTreeRoot.getIDTree();
>                 if (idTree != null)
>                 {
>                     idTreeMap = idTree.getTreeAsMap();
>                 }
>                 checkForIDTreeOrphans(doc.getPages(), idTreeMap);
>             }
>         }
>         checkStructTreeRootCount(file);
> {code}
> /StructureTreeRoot/ParentTreeNextKey (the next available free key) is missing 
> and should be 2 for the attached file, because keys 0 and 1 are used.
>  
> {code:java}
> assertEquals(2, 
> pdfDocument.getDocumentCatalog().getStructureTreeRoot().getParentTreeNextKey());
> {code}
>  



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to