• Post Reply Bookmark Topic Watch Topic
  • New Topic

Print Pdf problem

 
Souvik Das
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.


Please help.
Souvik Das
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In which line of code are you getting a NullPointerException?
 
Souvik Das
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"

Thanks & Regards,
Souvik Das
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!