The problem is NOT the PDF - it's what you are doing IN the script.
You have:
app.launchURL('http://localhost:8080/icts/secure/returnLetters.do?
view=afterPrint&letterID=136233&inmateID=1014&callingView=open&saveIndex=22');That's a HUGE security issue and as such many users will not allow that so it may not even come up. In my case, it throw the necessary warning (see enclosed). Leonard -----Original Message----- From: merle1960 [mailto:[email protected]] Sent: Wednesday, April 13, 2011 11:16 AM To: [email protected] Subject: Re: [iText-questions] Having problem with "done printing" action Attached is a sample PDF. Here is the java code I am using: public static void createPrintPDF(HttpServletRequest request, HttpServletResponse response, List urlListReports, List urlListImages, boolean autoPrint, String afterPrintURL) throws Exception { Document document = new Document(); PdfReader pdfReader = null; InputStream is = null; OutputStream os = response.getOutputStream(); PdfWriter pdfWriter = PdfWriter.getInstance(document, os); pdfWriter.setPdfVersion(PdfWriter.PDF_VERSION_1_5); document.open(); document.setPageSize(PageSize.LETTER); if(autoPrint){ PdfAction autoPrintingAction = PdfAction.javaScript("this.print(true);",pdfWriter); pdfWriter.setOpenAction(autoPrintingAction); } else { pdfWriter.setOpenAction(""); } if(afterPrintURL!=null && !"".equals(afterPrintURL)){ PdfAction donePrintingAction = PdfAction.javaScript("app.launchURL(\'" + afterPrintURL + "\');",pdfWriter); pdfWriter.setAdditionalAction(PdfName.DP, donePrintingAction); } PdfContentByte cb = pdfWriter.getDirectContent(); for (String location : urlListReports) { try { is = getContent(location, request); if (is != null) logger.debug(is.toString()); pdfReader = new PdfReader(is); for (int x = 1; x < pdfReader.getNumberOfPages()+1; x++) { document.setPageSize(pdfReader.getPageSizeWithRotation(x)); document.newPage(); PdfImportedPage pip = pdfWriter.getImportedPage(pdfReader, x); cb.addTemplate(pip,0,0); } } catch (Exception e){ logger.error("EXCEPTION - CreatePrintPDF", e); } finally { if (is != null) is.close(); } } http://itext-general.2136553.n4.nabble.com/file/n3447897/sampleLetter.pdf sampleLetter.pdf -- View this message in context: http://itext-general.2136553.n4.nabble.com/Having-problem-with-done-printing-action-tp3445396p3447897.html Sent from the iText - General mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Forrester Wave Report - Recovery time is now measured in hours and minutes not days. Key insights are discussed in the 2010 Forrester Wave Report as part of an in-depth evaluation of disaster recovery service providers. Forrester found the best-in-class provider in terms of services and vision. Read this report now! http://p.sf.net/sfu/ibm-webcastpromo _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions iText(R) is a registered trademark of 1T3XT BVBA. Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
<<attachment: 4-13-2011 8-14-36 PM.png>>
------------------------------------------------------------------------------ Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions iText(R) is a registered trademark of 1T3XT BVBA. Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
