[
https://issues.apache.org/jira/browse/PDFBOX-5276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17409980#comment-17409980
]
Tilman Hausherr commented on PDFBOX-5276:
-----------------------------------------
I haven't tested it myself but I just looked into the code, the new document
doesn't get the encryption info at all?!
{code}
protected PDDocument createNewDocument() throws IOException
{
PDDocument document = memoryUsageSetting == null ?
new PDDocument() : new
PDDocument(memoryUsageSetting);
document.getDocument().setVersion(getSourceDocument().getVersion());
document.setDocumentInformation(getSourceDocument().getDocumentInformation());
document.getDocumentCatalog().setViewerPreferences(
getSourceDocument().getDocumentCatalog().getViewerPreferences());
return document;
}
{code}
Did you call save() on the original document?
> Encryption on Split documents
> -----------------------------
>
> Key: PDFBOX-5276
> URL: https://issues.apache.org/jira/browse/PDFBOX-5276
> Project: PDFBox
> Issue Type: Bug
> Reporter: Dustin
> Priority: Major
> Attachments: ShouldNotBeEncrypted.pdf
>
>
> Splitting a two page document into two separate documents via
> org.apache.pdfbox.multipdf.Splitter
> Then using the List<PDDocument> returned to encrypt the first document causes
> weird side effects on the second document in the list. It will still open
> with the owner password of the first document (Even though it shouldn't be
> encrypted), but it is unreadable.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]