[
https://issues.apache.org/jira/browse/PDFBOX-2858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17215002#comment-17215002
]
Maruan Sahyoun commented on PDFBOX-2858:
----------------------------------------
After PDFBOX-45 being resolved by [~tilman] this now works as follows adding
the changed objects explicitly to the change set
{code}
PDField field = testPdf.getDocumentCatalog().getAcroForm().getField("IBAN
Antragsteller");
Set<COSDictionary> objectsToWrite = new HashSet<>();
if (field instanceof PDTextField)
{
PDTextField txField = (PDTextField) field;
txField.setValue("12345678901234567890");
objectsToWrite.add(txField.getCOSObject());
objectsToWrite.add(txField.getWidgets().get(0).getAppearance().getCOSObject());
objectsToWrite.add(txField.getWidgets().get(0).getAppearance().getNormalAppearance().getCOSObject());
}
FileOutputStream fis = new FileOutputStream(new
File("santander_freistellungsauftrag-pdfbox.pdf"));
testPdf.saveIncremental(fis, objectsToWrite);
{code}
> Saving document caused prompt saying Extended features has been disabled
> ------------------------------------------------------------------------
>
> Key: PDFBOX-2858
> URL: https://issues.apache.org/jira/browse/PDFBOX-2858
> Project: PDFBox
> Issue Type: New Feature
> Components: AcroForm
> Affects Versions: 2.0.0
> Reporter: Tilman Hausherr
> Priority: Major
> Attachments: santander_freistellungsauftrag.pdf,
> santander_freistellungsauftrag_modified.pdf
>
>
> I had the same problem last night (getting the message box "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") as in
> PDFBOX-2857 with this file
> http://www.santander.de/media/pdf/formulare/AL004_FSA.pdf
> after I modified the field "IBAN Antragsteller" with "12345678901234567890".
> But that one isn't an XFA form?!
> {code}
> PDField field =
> pdf.getDocumentCatalog().getAcroForm().getField("IBAN Antragsteller");
> if (field instanceof PDTextField)
> {
> PDTextField txField = (PDTextField) field;
> txField.setValue("12345678901234567890");
>
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]