You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Ralf Hauser (JIRA)" <ji...@apache.org> on 2014/10/23 18:09:34 UTC
[jira] [Comment Edited] (PDFBOX-2447) "Cannot save a document which
has been closed" when encrypting
[ https://issues.apache.org/jira/browse/PDFBOX-2447?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14181510#comment-14181510 ]
Ralf Hauser edited comment on PDFBOX-2447 at 10/23/14 4:09 PM:
---------------------------------------------------------------
good point, but I guess the patch works with a minor enhancment as per patch2447a.txt
was (Author: hauser@acm.org):
good point, but I guess the patch works with a minor enhancment
> "Cannot save a document which has been closed" when encrypting
> --------------------------------------------------------------
>
> Key: PDFBOX-2447
> URL: https://issues.apache.org/jira/browse/PDFBOX-2447
> Project: PDFBox
> Issue Type: Bug
> Components: PDModel
> Affects Versions: 2.0.0
> Environment: java7 deb7
> Reporter: Ralf Hauser
> Attachments: patch2447.txt, patch2447a.txt
>
>
> InputStream content = ...;
> int keyLength = 256;
> AccessPermission ap = new AccessPermission();
> StandardProtectionPolicy spp = new StandardProtectionPolicy(
> symmPw, symmPw, ap);
> spp.setEncryptionKeyLength(keyLength);
> document.protect(spp);
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> document.save(baos);
> in the save() the above mentioned exception is thrown (wasn't with the 2013-11 snapshot)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)