[
https://issues.apache.org/jira/browse/PDFBOX-2857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14617983#comment-14617983
]
tmjee commented on PDFBOX-2857:
-------------------------------
Tired to modify a pdf with xfa through
{code:borderStyle=solid}
COSStream cosout = new COSStream(new RandomAccessBuffer());
OutputStream out = cosout.createUnfilteredStream();
...
// write to out and put cosout in cosArray
PDXFA xfaout = new PDXFA(cosArray);
form.setXFA(xfaout);
doc.save(...);
{code}
The output file looses all extended features. Try stripping code down to bare
minimum as in this jira description but still get the prompt saying all
extended features are lost when opening the written pdf with xfa file.
It doesn't happen in extremely simple pdf xfa.
> Saving XFA document caused prompt saying Extended features has been disabled
> ----------------------------------------------------------------------------
>
> Key: PDFBOX-2857
> URL: https://issues.apache.org/jira/browse/PDFBOX-2857
> Project: PDFBox
> Issue Type: Bug
> Affects Versions: 1.8.9, 2.0.0
> Environment: Windows, Linux
> Reporter: tmjee
> Attachments: sample.pdf
>
>
> Using the following code to read and write back a pdf (with xfa) caused the
> newly written pdf when opened be prompted with
> "This document enabled extended features in Adobe Reader. The document has
> been changed since it was created and use of extended features is no longer
> available. Please contact the author for the original version of this
> document".
> {code:borderStyle=solid}
> File f1 = new File(...);
> PDDocument doc = PDDocument.load(f1);
> doc.setAllSecurityToBeRemoved(true);
> File f = new File(....); // output file
> try (FileOutputStream fos = new FileOutputStream(f)) {
> doc.save(fos);
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]