Hi, I am facing problem to print pdfs through java code. I needs the functionality of silent printing so i am using pdfbox. But the problem is the pdfs are not getting printed and my code throws an error java.awt.print.PrinterIOException which is caused by Caused by: java.util.zip.ZipException: unknown compression method But i just want to print only one pdf at a time. Later, i have found out that my pdfs are restricted with 40bit Rc4 type security where only printing is allowed. Now i have also got the password with which the pdfs are encrypted. But now i am getting null pointer exception when i want to print the pdf after decryption. My code is attached below.
Hi Mr. Ulf Dittmer, I am getting the following error log.
java.lang.NullPointerException at org.pdfbox.pdmodel.PDDocument.print(PDDocument.java:825) at com.ITGI.Java.PDFBOXCode.createPDF(PDFBOXCode.java:66)// Method at com.ITGI.Java.PDFBOXCode.main(PDFBOXCode.java:17) Exception in thread "main"