[
https://issues.apache.org/jira/browse/PDFBOX-2861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14620556#comment-14620556
]
Andrew Crowe commented on PDFBOX-2861:
--------------------------------------
In trying to recreate a PDF with this issue I found the problem. It wasn't
down to PDFBOX. It was down to the tool 'PDFPen Pro' that one of our users was
using to protect the PDF. It seems that PDFPen Pro looses its values for
select boxes when it encrypts the document!
So sorry for the false ticket.
> PDChoiceField values being lost when decrypting an encrypted PDF
> ----------------------------------------------------------------
>
> Key: PDFBOX-2861
> URL: https://issues.apache.org/jira/browse/PDFBOX-2861
> Project: PDFBox
> Issue Type: Bug
> Components: AcroForm, PDModel
> Affects Versions: 1.8.9
> Environment: Java 1.7, Mac OSX 10.10.2
> Reporter: Andrew Crowe
>
> I load a PDDocument from a byte stream as follows,
> {code}
> byte[] body = BASE64EncoderDecoder.decodeBuffer(BASE64body);
> ByteArrayInputStream bis = new ByteArrayInputStream(body);
> pdfDocument = PDDocument.load(bis);
>
> // Unlock it if needed
> if (pdfDocument.isEncrypted())
> {
> StandardDecryptionMaterial sdm = new
> StandardDecryptionMaterial(password);
> pdfDocument.openProtection(sdm);
> }
> {code}
> If there is no encryption then all is fine. However, as soon as I put a
> password on the PDF the values of the 'PDChoiceField' type lose their values
> <null>. All other field types come out correctly.
> getSelectedOptions brings back null, and 'getValue()' also returns null with
> the encrypted PDF, but work fine when not encrypted.
> Many thanks
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]