pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: About decrypt pdf using pdfbox 2.0.1
Date Fri, 01 Jul 2016 17:45:47 GMT
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;/
> /import org.apache.pdfbox.pdmodel.PDDocumentCatalog;/
> /import org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm;/
> /import org.apache.pdfbox.pdmodel.interactive.form.PDField;/
> /import org.xml.sax.SAXException;/
> /
> /
> /public class Testpdf9 {/
> /
> /
> /public static void main(String[] args) throws IOException, 
> ParserConfigurationException, SAXException {/
> /String file = "E:\\pdf_issues\\Items\\samplepdfread1.pdf";/
> /PDDocument doc = PDDocument.load(new File(file));/
> /PDDocumentCatalog catalog = doc.getDocumentCatalog();/
> /PDAcroForm form = catalog.getAcroForm();/
> /List fields = form.getFields();/
> /for(int i=0;i<fields.size();i++){/
> /Object field = fields.get(i);/
> /System.out.println(((PDField)field).getFullyQualifiedName());/
> /System.out.println(field.getClass().getSimpleName());/
> /}/
> /doc.close();/
> /}/
> /}/
>
> 1. If I use PDFBox 1.8.7, then I will get the messy code of the form 
> field names.
> 2. If I use PDFBox 2.0.1, then I will get the right name of the form 
> fields.
> 3. If I use PDFBox 1.8.7, then I must modify my code to decrypt the 
> pdf and then I can get the right names. While changing to PDFBox 
> 2.0.1, I don't need to do additional change.
>
> You can run my code by using my attaching file. The password is abcd.
>
> So above all, my question is that, is this an issue in PDFBox 2.0.1? 
> Or some other reasons?
>
> Please let me know your reply. Thank you in advance.
>
>
> -- 
> Best Regards,
> Barry
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message