Google Cloud Print will no longer be supported as of December 31, 2020. Please see the support article for help migrating.

Developer Guide for Application Developers

This developer guide describes how you can use GCP's service interfaces to interact directly with the service and add rich printing functionality to your applications. If you are looking for simple integration with GCP to submit print jobs from a web application using GCP's default printing dialog, see here.

Step #1: Authenticating

Before you can actually call any of the service interfaces, you must authenticate the user into Google Cloud Print. This is done using Google login credentials. Sample code for this authentication step using Python and Google's ClientLogin API is available here. See here for more information on Google's various auth mechanisms.

Step #2: Making API calls

Once you have successfully authenticated your user, you are ready to make calls to the various GCP service interfaces for application developers. You can submit print jobs using the GCP /submit API over HTTP POST. Other relevant APIs can be accessed via either POST or GET (/submit requires POST because most transfers involving files are too large to make use of the GET protocol). Following is a sample HTML form that submits a user-uploaded job with no pre-specified tags or ticket options:

<form action="" method="post" enctype="multipart/form-data" id="submitForm">
  <input type="hidden" name="xsrf" value="AIp06DivKc_oNVzkiKO3au9662RkibzIvg:1385024846519"/>
  <input type="hidden" name="printerid" value="123456789"/>
  <input type="hidden" name="ticket" value='{"version": "1.0", "print": {}}'/>
  <input type="text" name="title" value="My Document"/>
  <input type="text" name="contentType" value="application/pdf"/>
  <input type="text" name="tag" value=""/>
  <input type="file" name="content"/>
  <input type="submit" value="Print"/>

Of course, you can communicate with the GCP service interfaces in any language of your choice. These code samples show how to use Python to retrieve a list of print jobs or submit a new print job.