Yes siree that works! :) Many thanks Andreas!
Happy happy happy Leo On Mon, May 27, 2013 at 2:10 PM, Andreas Lehmkuehler <[email protected]>wrote: > Hi, > > Am 27.05.2013 04:49, schrieb Leonard Teo: > >> Hey guys thanks so much for letting me know about the encryption! >> >> @Thomas, I ran the .decrypt() method and it seems to be working but I'm >> getting an exception on saving the document out. >> >> The method I'm calling is just a doc.save(String "path to output file"); >> >> java.lang.NullPointerException >> at >> org.apache.pdfbox.pdmodel.**encryption.**StandardSecurityHandler.** >> prepareDocumentForEncryption(**StandardSecurityHandler.java:**303) >> at org.apache.pdfbox.pdfwriter.**COSWriter.write(COSWriter.**java:1446) >> at org.apache.pdfbox.pdmodel.**PDDocument.save(PDDocument.**java:1273) >> at org.apache.pdfbox.pdmodel.**PDDocument.save(PDDocument.**java:1254) >> at PDFStamper.stamp(PDFStamper.**java:129) >> at PDFStamper.main(PDFStamper.**java:174) >> >> >> Any ideas here? >> > Try doc.setAllSecurityToBeRemoved(**true) before saving the pdf. > > Thanks so much! >> >> Leonard >> SNIP >> > > > BR > Andreas Lehmkühler > >

