I should clarify a little bit... Because it is a security risk (as Bruno points out), the file needs to be "trusted" in order for it to execute w/o the UI. A trusted file can either be certified by a trusted certificate (which you can do with iText) _OR_ it can be in a trusted location (folder, web site, etc.) as specified in the Trust Manager of Adobe Acrobat/Reader.
Leonard -----Original Message----- From: 1T3XT info [mailto:i...@1t3xt.info] Sent: Tuesday, February 17, 2009 5:39 AM To: Post all your questions about iText here Subject: Re: [iText-questions] Printing both sides with iText Uma Gudi wrote: > > When I tried to Print Pdf, using below code > > writer.addJavaScript("this.print(false);", > *false*); > > response.setHeader("Expires", "0"); > response.setHeader("Cache-Control", > "must-revalidate, post-check=0, pre-check=0"); > response.setHeader("Pragma", "public"); > > response.setContentType("application/pdf"); > response.setContentLength(baos.size()); > ServletOutputStream out = > response.getOutputStream(); > baos.writeTo(out); > out.flush(); > > It is prompting me to save local and showing the print setting prompt. > My requirement is directly send to Printer without prompting. > > Need Help That will only work with old versions of Adobe Reader. Newer versions of Adobe Reader consider printing without prompting as a security hazard. In other words: what you want to achieve has been made impossible with Adobe Reader. -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php