PDA

View Full Version : Sending a PDF Link to the printer instead of Displaying in Reader?



Bengal313
Mar 20th, 2007, 05:35 PM
Is there a way you can have a PDF link go directly to the printer dialog box instead of launching the Reader?

carlitos_way
Mar 20th, 2007, 05:51 PM
Is there a way you can have a PDF link go directly to the printer dialog box instead of launching the Reader?

yes,
i saw it while using the iText library for creating PDF.

you open the pdf in an iframe, so the user won't necessarily see it (if you hide it). then the javascript action will print it directly to the default printer.

here you can find the complete documentation and example: silentprint (http://itextdocs.lowagie.com/tutorial/general/webapp/index.html#silentprint)

i'm not sure if this is a feature offered only by the library, or if you can do the same by using js, as i'm a noob on js.

good luck ;)

_Aerospace_Eng_
Mar 20th, 2007, 06:24 PM
<iframe src="yourpdffile.pdf" name="pdf" width="1" height="1" frameborder="0"></iframe>

<a href="yourpdffile.pdf" onclick="window.frames['pdf'].print();return false">Print PDF</a>

Bengal313
Mar 20th, 2007, 07:56 PM
Thanx, Aerospace_Eng_. It worked perfectly.