Hello Barry,

You created that file with a user password "abcd" and an empty owner password.

PDFBox first tries to open the file with the owner password, and succeeds.

Adobe Reader and PDF.js apparently insist on the user password, and don't expect the owner password to be empty.

That it didn't work in 1.8.* is because there, even a file encrypted with an empty user or owner password must be decrypted with openProtection() or decrypt(). (You can also decrypt it there with an empty password)

==> recreate your file with a non empty owner password, or talk with the people who created this file.

To clarify:
- the user password is to open the file with restricted rights, e.g. forbid printing. It is usually empty. - the owner password is to open the file with full rights, e.g. to make changes like in tools like Adobe Acrobat Professional.

Tilman

Am 05.07.2016 um 05:28 schrieb zhaozhao:
Hi Tilman,

Thanks for your response first.

I upgraded PDFBox from 2.0.1 to 2.0.2. And I tested again using the code I
sent in the last email.

And here are the steps.

1.  Run my code with PDFBox 2.0.2 using the provided pdf file.

2.  [Expected result]

The schema like: ?__^?k_?7

PDTextbox

3.  [What I got]

firstName

PDTextField

Above result is a part. 'firstName'is one field name of the acroform and
'PDTextfield'is the type of the corresponding form component.

And what I really concern is that without decrypting the encrypted pdf file,
can I get correct schema name?

I have shared the pdf file. (password for this file is abcd)

Please visit this link:
https://drive.google.com/a/tibco.com/file/d/0B2RK53mIzwataGxRVnMtem81cUE/vie
w?usp=sharing

On 2016-07-02 01:45 (+0800), Tilman Hausherr <[email protected]> wrote:
Hello Barry,>

- we're already at 2.0.2, so don't bother with 2.0.1 :-)>
- please upload your PDF file to a public place (e.g. dropbox, google >
drive, or a sharehoster), because attachments are blocked here>
- you mention "If I use PDFBox 2.0.1, then I will get the right name of >
the form fields" - this sounds like all is ok in 2.0.1, isn't it? Maybe >
this is a misunderstanding - please tell us what you get with the >
different versions, and explain what you expected.>

(The ideal bug report includes 1) what you did, 2) what you expected, 3) >
what you got instead)>

Tilman>


Am 01.07.2016 um 11:16 schrieb Barry Zhao [Zhao]:>
Hello team,>
I found a weird thing when upgrading pdfbox from 1.8.7 to 2.0.1.>
Here is my scenario below.>
I used a pdf template which was encrypted. And my code is like below.>
/import java.io.File;/>
/import java.io.IOException;/>
/import java.util.List;/>
/import javax.xml.parsers.ParserConfigurationException;/>
/import org.apache.pdfbox.pdmodel.PDDocument;/>
/im



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to