Encrypted PDF form document without password to open file
Hello. I have PDF file with filled form. Document is encrypted (128bits AES). It is possible to open file and fill form wihout password (under Adobe Reader). It it possible to open document under PDFBox and export data from form? When I try to do this I always get PDAcroForm wihout any fields. Maybe I do something wrong? Thank you in advance for answer. With best regards Peter
Input fields in PDF
How do I list and set/update the input fields in the attached PDF document using PDFBox? In the code snippet below form is null. If my PDF does not contain a PDAcroForm how do I access the input fields? try { pdf = PDDocument.load(new File(fileName)); PDAcroForm form = pdf.getDocumentCatalog().getAcroForm(); if (form == null) { System.err.println("Error: This PDF does not contain a form."); } else { for(PDField pdField : form.getFields()){ System.out.println(pdField.getValueAsString()); } } } finally { close(fdf); close(pdf); } JR - To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org For additional commands, e-mail: users-h...@pdfbox.apache.org
Re: Overlaying PDFs > 1.4 fails & Hyperlinks are not clickable in overlays
I've also created issue https://issues.apache.org/jira/browse/PDFBOX-3263 which is somewhat related to your problem. Tilman - To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org For additional commands, e-mail: users-h...@pdfbox.apache.org
Re: JBIG2 Images
Am 09.03.2016 um 15:11 schrieb Felix Hermann: Hello, we use PDFBox 2.0.0 for converting PDF to images. We also want to support JBIG2 images. Therefore we would like to use the JBIG2-Image-Decoder, which is proposed on your website. (See: https://pdfbox.apache.org/2.0/dependencies.html ) On your website it says: "These libraries are optional and will be loaded if present on the classpath, otherwise support for these image formats will be disable and a warning will be logged when an unsupported image is encountered." I downloaded the source code, created a jar-file and put it onto the classpath. However it didn't work. I'm getting the following error: [09.03.2016 14:37:59] ERROR org.apache.pdfbox.contentstream.PDFStreamEngine (PDFStreamEngine.java:851) - Cannot read JBIG2 image: jbig2-imageio is not installed I also tried 'JBIG2 ImageIO' by 'levigo'. This worked. However we cannot use it, as it is under the GPL-Licence. That is the reason why we don't distribute the levigo software. Solutions for you: - Distribute your software without it and have your users download it - Write your own decoder (you could take the one in PDF.js and write it in java, it is Apache licensed) - Ask levigo for an apache license. Tilman Any help will be appreciated Regards Felix - To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org For additional commands, e-mail: users-h...@pdfbox.apache.org - To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org For additional commands, e-mail: users-h...@pdfbox.apache.org
Re: PDFPagePanel deprecated in 2.0 ?
It was deleted in 2.0 because it made too many problems. See in the source code of the PDFDebugger subproject for inspiration. The simplest is to create a BufferedImage and to display that one in a scroll panel, see org.apache.pdfbox.debugger.pagepane.PagePane. Tilman Am 09.03.2016 um 15:52 schrieb Marcello Magaldi: Hi, I cannot see PDFPagePanel class in pdfbox 2.0 , is this deprecated ? If so, how can I show a pdf page into a jpanel or a jframe ? I tried with 1.8.x but in my case it doesn't work so I need to use 2.0 version and downgrading, I think, is not an option. Thanks in advance Best Regards Marcello Magaldi - To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org For additional commands, e-mail: users-h...@pdfbox.apache.org
Re: creating a rectangle around the whole pdf
Hello Diane, To draw a rectangle, see the ShowColorBoxes.java example in the source code download. However set the stroking color and call stroke() instead of fill(). To draw a form, use the CreateSimpleForm.java example. Creating forms is still somewhat tricky, so after having done what you can, please post your code and ask more. Tilman Am 08.03.2016 um 23:12 schrieb Haddy, Diane E: Hello I am very new to PDFBox. I am creating a pdf form of which I need to create an outer rectangle around the whole form and then in the center I need to create two rectangles adjacent to one another. Also the header info. to surround the two adjacent rectangles is in its own rectangle and the background is pale gray. Can someone provide me a snippet of code and perhaps a pdf for visual purposes? I do have the PDFBox api but not sure which classes to use to achieve what I want. Also for this line in the pdf, is there a way to add an underline to what is highlighted in red? This is my java code:title.drawString("Request form must be used within 30 days of " + formatDate ); Request form must be used within 30 days of 03/07/2016 Thanks in advance for any help in this matter. Diane Diane Haddy Health Care Information Systems Application Developer 3281 Ridgeway Dr Coralville, IA 52241 Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited. Please reply to the sender that you have received the message in error, then delete it. Thank you. - To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org For additional commands, e-mail: users-h...@pdfbox.apache.org
Re: Overlaying PDFs > 1.4 fails & Hyperlinks are not clickable in overlays
Result of PDFBox 2.0.0-RC3: http://www.elisanet.fi/jakorasia/ANNA/result-PDFBox2.pdf Result of PDFBox 1.8.11: http://www.elisanet.fi/jakorasia/ANNA/result-PDFBox18.pdf -anna- On 07.03.2016 19:19, Tilman Hausherr wrote: Could you upload two documents, one good and one bad? I'll have a look with PDFDebugger to find out what's wrong. Tilman Am 07.03.2016 um 16:30 schrieb Anna Taracha: Hi, I am having trouble overlaying PDFs of version 1.5 (or higher) when using PDFBox 2.0.0-RC3. The result PDF has parameter error in it according to 3-Heights™ PDF Validator Online Tool. Overlaying PDFs of version 1.4 (PDF 1.4, PDF/A-1a and PDF/A-1b) works fine. To reproduce: 1. Download pdfbox-app-2.0.0-RC3.jar 2. Overlay two PDF(/A) documents of version 1.5 (or higher) /- java -jar pdfbox-app-2.0.0-RC3.jar OverlayPDF doc.pdf wm.pdf -position foreground result.pdf/ 3. Validate result.pdf with a PDF validator (I used 3-Heights™ PDF Validator Online Tool) The result of the validation is 'parameter error'. However, overlaying the exact same PDFs using pdfbox-app-1.8.11.jar works fine. Is there some regression in PDFBox 2.0.0-RC3 regarding overlaying PDFs of version > 1.4? I tested OverlayPDF//with many simple PDFs (version > 1.4) and all of them resulted in parameter error when using PDFBox 2.0.0-RC3. I have also a question about making hyperlinks clickable in overlays. I am able to do it by modifying Overlay.java but I was wondering, if this feature will be available in some later release? Best regards, Anna - To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org For additional commands, e-mail: users-h...@pdfbox.apache.org - To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org For additional commands, e-mail: users-h...@pdfbox.apache.org
PDFPagePanel deprecated in 2.0 ?
Hi, I cannot see PDFPagePanel class in pdfbox 2.0 , is this deprecated ? If so, how can I show a pdf page into a jpanel or a jframe ? I tried with 1.8.x but in my case it doesn't work so I need to use 2.0 version and downgrading, I think, is not an option. Thanks in advance Best Regards Marcello Magaldi
JBIG2 Images
Hello, we use PDFBox 2.0.0 for converting PDF to images. We also want to support JBIG2 images. Therefore we would like to use the JBIG2-Image-Decoder, which is proposed on your website. (See: https://pdfbox.apache.org/2.0/dependencies.html ) On your website it says: "These libraries are optional and will be loaded if present on the classpath, otherwise support for these image formats will be disable and a warning will be logged when an unsupported image is encountered." I downloaded the source code, created a jar-file and put it onto the classpath. However it didn't work. I'm getting the following error: [09.03.2016 14:37:59] ERROR org.apache.pdfbox.contentstream.PDFStreamEngine (PDFStreamEngine.java:851) - Cannot read JBIG2 image: jbig2-imageio is not installed I also tried 'JBIG2 ImageIO' by 'levigo'. This worked. However we cannot use it, as it is under the GPL-Licence. Any help will be appreciated Regards Felix - To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org For additional commands, e-mail: users-h...@pdfbox.apache.org
Re: Fields and "]" + Checkboxes
Hi, > Al Granthat am 8. März 2016 um 18:57 geschrieben: > > > Morning All, > > I have been writing some Java with PDFBox for a few weeks now. Its been > very good so far. > > My goal is to loop through all the fields in a form, grab the values and > write the value to a corresponding field in a DB. By and large I have this > working. > > I however have two questions: > > 1. When importing the value of a combobox I am getting the value enclosed > in square braces. Anyone know why - or do I need to handle this > progmatically? getValue provides a list of strings as return value which leads to the described string presentation with square braces. That list contains the selected value or several values if multiselect is allowed and more than one value is selected. > 2. The code so far loops through all the fields and grabs strings - but I > am not sure how to handle exclusive checkboxes (ie only one value selected > allowed). I didn't get your point, but hopefully my answer to your first question answers this one too? ;-) > Cheers > > -Al > > > -- > "Beat it punk!" > - Clint Eastwood BR Andreas - To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org For additional commands, e-mail: users-h...@pdfbox.apache.org