-none- 2007-09-14 - By JJ JJ
Back
Hello,
Have been reading a lot about adding javascript to existing pdfs but with no success at all.
I use PdfStamper, but when trying to call method addJavaScript, it says is undefined...
I can workaround that by using Stamper.getWriter() and calling addJavaScript on it, but then NullPointerException shows always up...
PdfReader reader = new PdfReader("c:\\test_in.pdf"); PdfStamper stamper = new PdfStamper(reader,new FileOutputStream("c:\\test_out.pdf")); PdfWriter pdfw = stamper.getWriter(); PdfAction acc = PdfAction.javaScript("this.print(false);", pdfw); pdfw.addJavaScript(acc); // This throws NullPointerException stamper.close();
I have read a lot, went through api javadocs, but I'm lost, no idea...
Any help would be appreciated...
Regards!
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ __ Descubre la descarga digital con MSN Music. M?s de un mill?n de canciones. http://music.msn.es/
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ __ ____ ____ ____ ____ ____ ____ ____ ____ ____ iText-questions mailing list iText-questions@(protected) https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
|
|