Hello, I'm trying to open the print pop-up automaticaly when the pdf opening. I tried to do like in the SilentPrint iText Tutorial (http://itextdocs.lowagie.com/tutorial/#part1), but the addJavaScript method aways throw a NullPointerExcpetion !
I found a similar problem on the list (http://osdir.com/ml/java.lib.itext.general/2003-06/msg00235.html) but as I'm not using the PdfStamper and as the iText Exemple working, I must did something wrong ... Here is my code : Document pdf = new Document(PageSize.A4, 42.5f, 42.5f, 22.7f, 46f); ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { PdfWriter writer = PdfWriter.getInstance(pdf, baos); writer.addJavaScript("this.print(false);", false); } catch (DocumentException e) { LOGGER.error("Erreur à la création du Courrier"); LOGGER.error(e); } I verified, the "writer" objet is not null. I tryied arguments ("this.print(false);", false), ("this.print(false);", true), ("this.print(false);") or ("this.print(true);") I always had the same NullPointerException ... T_T Thanks, Charles ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/