Printing a PDF from the Web

I have a pdf that lives on the web at at URL: http://www.mypdf.com?id=1234

I have a Kiosk App that has a printer hooked up to it. (But no mouse or keyboard)

I need to grab the PDF and send it to the printer without any user clicking of page setup.

Its a Mac and I have tried using a HTMLViewer, but webkit seems to want to print bank pages.

Anybody have any ideas?

well, on a Mac you could run shell class as far as I know and tell curl to print PDF via command line.

Thanks Christian. Im not literate in “Curl” At the risk of being a cut and paste coder: could you kindly show me when the command would look like?

Could you use an HTTPSocket to download the PDF locally and then use the “lpr” terminal command to send it to the printer?

curl http://www.mypdf.com?id=1234 > print.pdf; lpr print.pdf

look at:
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/lpr.1.html
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/curl.1.html

Hmm. Ok So I must suck as shell classes.

Calling curl http://www.mypdf.com?id=1234 > print.pdf; lpr print.pdf from the Terminal prints the PDF just fine

But

dim myShell as new Shell ="curl http://www.mypdf.com?id=1234 > print.pdf; lpr print.pdf" myShell.Execute myCURL MsgBox myShell.Result

gives me:

bash: print.pdf: Permission denied lpr: Error - unable to access "print.pdf" - No such file or directory

Lets try that again. (WTF can’t I edit my post???)

Hmm. Ok So I must suck as shell classes.

Calling curl http://www.mypdf.com?id=1234 > print.pdf; lpr print.pdf from the Terminal prints the PDF just fine

But

dim myCURL as string ="curl http://www.mypdf.com?id=1234> print.pdf; lpr print.pdf" dim myShell as new Shell myShell.Execute myCURL MsgBox myShell.Result

gives me:

bash: print.pdf: Permission denied lpr: Error - unable to access "print.pdf" - No such file or directory

The shell is not terminal
Make sure you use the FULL PATH to the curl & lpr commands
and depending on where this command / application is you MAY NOT have write permissions - thats what

bash: print.pdf: Permission denied

implies

So you may need to try

dim myCURL as string ="/usr/bin/curl http://www.mypdf.com?id=1234> /tmp/print.pdf; /usr/bin/lpr /tmp/print.pdf"

with all the associated problems of putting things in tmp has (i.e. if the file already exists then you are going to nuke whatever is there etc)