yasirsiddiqui / php-google-cloud-print

PHP class to print documents using Google Cloud Print with OAuth2 authorization
91 stars 42 forks source link

Automatic print without log in screen #11

Closed comyou closed 9 years ago

comyou commented 9 years ago

Hello,

I am looking to implement this into an automated commerce system which I'm trying to get to automatically print all of the new orders by going to a webpage (www.website.com/print.php?orderid=number) which will then generate a PDF submit that to print automatically.

At the moment with this library I keep getting the screen asking my to choose a Google account to sign in with. Is it possible to provide credentials within the actual library itself to bypass this login screen?

If this is possible, a brief guide would be much appreciated!

Many thanks!

der-lukas commented 9 years ago

You can do it with the cron.php - method! Just generate yourself an offline-key, save it to a file, get the contents with file_get_contents and send your print job to cron.php.

It's explained in the Readme, how to do this!

I actually implemented it this way in a wordpress project and it works perfectly!

comyou commented 9 years ago

Thank you der-lukas,

Apparently my eyesight is diminishing as I looked over that... several times! I have got it to work, now just to set up the .pdf generating and I'm good to go.