[ 
https://issues.apache.org/jira/browse/PDFBOX-4640?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16919690#comment-16919690
 ] 

Daniel Martin Garcia commented on PDFBOX-4640:
----------------------------------------------

Hi Tilman,

This is a similar code

PDFMergerUtility ut = *new* PDFMergerUtility();

*for* (File pdf : pdfs) {

PDDocument sourceDocument = *null*;

*try* {

sourceDocument = PDDocument._load_(sourceFile, 
MemoryUsageSetting._setupTempFileOnly_());

docs.add(sourceDocument);

sourceDocument.getDocumentCatalog().setDocumentOutline(*null*);

PDAcroForm acroForm = sourceDocument.getDocumentCatalog().getAcroForm();

*if* (acroForm != *null*) {

acroForm.flatten();

acroForm.getFields().clear();

}

ut.appendDocument(document, sourceDocument);

}

catch(Exception ex) {

}

 

document is the PDDocument I am merging with, so I am merging a lot of pdfs 
with the document file.

 

Thanks

 

> PDF Annotations missed when merging documents
> ---------------------------------------------
>
>                 Key: PDFBOX-4640
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4640
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 2.0.16
>            Reporter: Daniel Martin Garcia
>            Priority: Major
>              Labels: merge
>         Attachments: highlighted pdf.pdf
>
>
> Hi,
> There is a bug when PDFBox merges documents with annotations, but the 
> annotation opacity is not 100%. If the opacity is less than 100%, the 
> annotation is lost.
>  
> I attach a document with an annotation which opacity is 60%, if you create a 
> test to merge this pdf with other PDF, the annotation won't be in the merged 
> pdf.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to