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

Simon Steiner updated PDFBOX-5834:
----------------------------------
    Description: 
java -jar app/target/pdfbox-app-2.0.32-SNAPSHOT.jar PDFSplit xxx.pdf

I would expect to see the names dict inside the documentCatalog which is used 
to store pdf templates

Maybe Splitter createNewDocument should have:
        if (getSourceDocument().getDocumentCatalog().getNames() != null &&
                
getSourceDocument().getDocumentCatalog().getNames().getCOSDictionary().containsKey("Templates"))
 {
            document.getDocumentCatalog().setNames(
                    getSourceDocument().getDocumentCatalog().getNames());
            
document.getDocumentCatalog().getNames().getCOSDictionary().removeItem(COSName.PAGES);
        }

  was:
java -jar app/target/pdfbox-app-2.0.32-SNAPSHOT.jar PDFSplit xxx.pdf

I would expect to see the names dict inside the documentCatalog which is used 
to store pdf templates

Maybe Splitter createNewDocument should have:

document.getDocumentCatalog().setNames(
                getSourceDocument().getDocumentCatalog().getNames());


> PDF split missing names from documentCatalog
> --------------------------------------------
>
>                 Key: PDFBOX-5834
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5834
>             Project: PDFBox
>          Issue Type: Bug
>            Reporter: Simon Steiner
>            Priority: Major
>
> java -jar app/target/pdfbox-app-2.0.32-SNAPSHOT.jar PDFSplit xxx.pdf
> I would expect to see the names dict inside the documentCatalog which is used 
> to store pdf templates
> Maybe Splitter createNewDocument should have:
>         if (getSourceDocument().getDocumentCatalog().getNames() != null &&
>                 
> getSourceDocument().getDocumentCatalog().getNames().getCOSDictionary().containsKey("Templates"))
>  {
>             document.getDocumentCatalog().setNames(
>                     getSourceDocument().getDocumentCatalog().getNames());
>             
> document.getDocumentCatalog().getNames().getCOSDictionary().removeItem(COSName.PAGES);
>         }



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to