0

I'm trying to ultimately silently print using Google Cloud Print from a POST function that is called from code on a website. I succeeded in testing cloud printing using my account and my printers using a form submit. (you can see the code that worked for that here: https://stackoverflow.com/questions/23975931/programatically-change-file-name-in-google-chrome-print)

The form submit didn't ask me for any authorization that I could tell. It asked me for xsrf. I stumbled across the answer for this by testing here: https://www.google.com/cloudprint/simulate.html

So my question is can some amazing person please take pity on me and post the entire code for POST to submit a print job to GCP INCLUDING the format for authorization and where I get that info?

I have read the manuals for cloud printing and the info on how to get an oauth (although I don't understand that part yet) I am missing something that will be obvious to people who have done this before.

I have tried the php code at github - although I do not usually code in php.

I have programmed a lot of API's and there is something I am just missing here.

Thank you profusely in advance!

Community
  • 1
  • 1
TheRingLord
  • 73
  • 2
  • 8

2 Answers2

1

i developed this simple library in python. https://github.com/escube/GoogleCloudSpooler You cna use as you wish. I developed a server version as well, but the lib used is the one in this project. Try to use it and tell me if you have problem with that, I'll be pleased to help.

escube
  • 81
  • 1
  • 1
-1

You could try using an alternative service such as PrintNode which has an excellent API and is very simple to use.

user1912424
  • 329
  • 3
  • 6