3

Is there a way I can programmatically send an HTTP or similar request to Google to have it print a given URL, or for me to send custom HTML? I want this to be a cron job on a server.

I'm wanting to automate some printouts of certain weekly online publications, as a present for a co-worker, but I would like it to be as simple as them sharing their printer with my account, so they don't need my program to be installed locally as I can maintain it on my sever.

700 Software
  • 85,281
  • 83
  • 234
  • 341

1 Answers1

1

Rather than sending an HTTP request to Google Cloud Print, perhaps a simpler method might be to convert the web page to a PDF and then send that PDF via e-mail to Google Cloud Print (or directly to the printer's e-mail address if it supports that...most recent HP printers do.) I have used wkHTMLtoPDF to do the conversion on the command line, and from there you end up with a PDF that can easily be mailed to print. You'll have to do some scripting to generate the PDF from the desired URL, but it shouldn't be very hard. Your cron job then just calls the script and off you go!

I found one article that pretty describes exactly this approach (minus the cron job part). Here is that link: Batch Printing HTML Files as PDF

Good luck!