GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ameenullah/php-google-cloud-print: PHP class to print documents using Google Cloud Print with OAuth2 authorization

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

15 Commits
15 Commits

Folders and files

NameName
Last commit message
Last commit date
Config.php
Config.php
 
 
GoogleCloudPrint.php
GoogleCloudPrint.php
 
 
HttpRequest.Class.php
HttpRequest.Class.php
 
 
README.md
README.md
 
 
cron.php
cron.php
 
 
example.php
example.php
 
 
index.php
index.php
 
 
oAuthRedirect.php
oAuthRedirect.php
 
 
offlineAccess.php
offlineAccess.php
 
 
offlineToken.php
offlineToken.php
 
 

Repository files navigation

Google Cloud Print

PHP class to print documents using Google Cloud Print using OAuth2.

First of all you have to add printers to Google Cloud Print using your Gmail account and Google Chrome browser. Follow the instructions on the following link to add printer to Google Cloud Print

https://support.google.com/cloudprint/answer/1686197

Google OAuth Prerequisites

  1. Create Google API project and get OAuth credentials.

Create Google OAuth Credentials

  1. Create new project and get the corresponding OAuth credentials using Google developer console https://console.developers.google.com/

  2. Select APIS & AUTH –> credentials from the left menu.

  3. Click Create new Client ID button. A popup will appear. In Authorized redirect URIs text area enter url that should point to oAuthRedirect.php on your server.

  4. After submitting this form, we can get the client Id, secret key etc.

Replace client_id, client_secret values in $redirectConfig and $authConfig arrays in Config.php file.

You also need to replace redirect_uri in both $redirectConfig and $authConfig arrays. This URL should point to oAuthRedirect.php on your server.

For Online Access hit index.php

Online access requires authorization every time you need to send print to printer once token in Session gets expired.

For Offline Access (when you want to send prints without user presence) hit offlineAccess.php

Offline access requires authorization only once or unless user has revoked access. You should use

offline access when you want to send prints to printer with out the presence of user or send prints to printer

using a cron job script.

Once you hit offlineAccess.php you will be redirected to offlineToken.php which will show you your refresh token.

You need to save refresh token to database, file or some cache systems as later on when you will send

print to printer in offline mode you need to replace that refrsh token at line # 29 on cron.php

About

PHP class to print documents using Google Cloud Print with OAuth2 authorization

Resources

Readme
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.