pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Chojecki <i...@rayman2200.de>
Subject Re: Acrobat reader's extended features with PDFBOX
Date Sat, 05 Oct 2013 08:14:49 GMT
Am Thu, 3 Oct 2013 15:07:20 +0200
schrieb Peter Nick <peter.nick69@gmail.com>:

> Hello,

> I have a PDF with Acrobat extended features, which has a form.  I
> have a program using PDFBox which adds data to certain fields in the
> form and saves it. The partially filled in form is sent to user who
> then fills in the remaining forms.
> The problem I am facing is that when the above is done, the PDF is
> flattened and the form fields (coloring etc) are gone. Acrobat also
> shows a warning that the document's extended features are not
> available since the document was modified.
> Is there a way with PDFBox to add data to this kind of form while
> keeping the form fields available for manual entry later?
> (By the way, I noticed such a thing is possible with iText,
> http://support.itextpdf.com/node/6. )

| Remove the usage rights. This will result in a form that is 
| no longer Reader enabled. For instance: if the creator of the 
| document allowed that the filled out form could be saved 
| locally, this will no longer be possible after removing the 
| usage rights.

For removing user rights, take a look at PDDocument#isEncrypted() and
PDDocument#decrypt(""). For decrypting you can use an empty string. If
I understand it correctly, then this solution isn't what you are
searching for.

| Fill out the form in append mode. This will result in a bigger 
| file size, but Reader enabling will be preserved.

Appending mode is implemented only for digital signatures. The pdf
writer (COSWriter) is working recursive from the document root, so it
isn't possible to "simply" append changes. You would need to know the
document structure and do some special treatment in your code.

So I think it isn't possible right now in pdfbox. Maybe in  future

> Thanks,
> Peter
Best regards

View raw message