NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Neil Porter on September 05, 2014, 06:38:24 AM
-
Has anyone any experience getting PDF's to print directly to a printer.
I'm lead to believe that Acrobat supports "Direct Printing" to certain printers but it requires some Java code to make it work!!???
If we are printing a report from a NTWS application, displaying it on screen is probably desirable.
We quite often end up printing labels for parcels etc. and when users are printing large numbers, they often comment that it would be good if the label "went straight to the printer" rather than them having to preview things on screen first, before printing them.
A search in google suggests that there are ways to get it to work, but I couldn't find anything that really tells me how to do it, and certainly not in a Nettalk server?
Any thoughts?
Regards,
Neil.
-
Neil, maybe this can help. this is something i would like to do, but never found specific examples or if it possible to make it.
http://www.torres.at/pdf-printing-net/
-
Neil i found this in a web site. Try it and see if it works
<html>
<script language="javascript">
timerID = setTimeout("exPDF.print();", 1000);
</script>
<body>
<object id="exPDF" type="application/pdf" data="PdfFileName.pdf" width="100%" height="500"/>
</body>
</html>
http://stackoverflow.com/questions/205180/how-to-print-a-pdf-from-the-browser
-
Another one
http://www.sanjbee.com/content/?p=96
-
a different approach depending in your circumstance
if you have full control over the client and they use Windows clients and do not mind a helper app.
I wrote a clarion app that watched the Downloads folder for a file spec eg (LABELS*.PDF)
if i found something, i moved it to a work folder where i opened it and in my case manipulated it using PDF-Tools from tracker
before printing it. - i think you could do labels "silently" with something similar. (user would still need to initiate the download - let the helper app display it if need be, to save a step, otherwise just print it (you could save the printer configuration somewhere so it can go direct to the Label printer if its not a default etc)
it works quite well for my specific situation (it was not a NT server ) and this was the only place i could hook my logic.
another thought as i am typing this, since you control the recommended download name you could use your own file extension, and associate a helper app to that file type on the client. Eg LABELS.PRINTPDF and you RUN using your PRINTPDF instead of save, like you own little viewer that just prints a PDF silently.
but if you get a script to work straight from the NT server i'd like to hear about it.