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
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to