google-cloud-print

access token for google cloud print service

﹥>﹥吖頭↗ 提交于 2020-08-02 04:58:09
问题 I want to use google cloud print service for my application, Concept is : Buyer can purchase products from my site and he should send order list to supplier's printer. For this, Supplier should registor printer in their google account, buyer will send print request to selected supplier's printer, and order document should be printed on supplier's printer. Problem is : Cloud print application is using OAuth2 autherization and it requries google account login and client_id to obtain access

Print to Google Cloud Print with dynamic URL

强颜欢笑 提交于 2020-01-13 06:43:09
问题 I'd like a "print" button on my web-site to print a document with Google Cloud Print, but I want the "url" of the target – a PDF file – to change dynamically, after the button has been clicked (notably, based on what's returned from an AJAX call). The GCP Web Element (GCPWE) seems to have similar functionality, but not quite what I desire. In particular, it seems as though one can only change the "target" (by calling setPrintDocument ) before the button is clicked. Is there a way to specify

Google cloud print API integration in my application

最后都变了- 提交于 2020-01-06 05:52:07
问题 I am trying to integrate Google cloud print in Android Application. I do not want to do it through Print framework as my requirement is to directly print from application without any selection process. For this, I have integrate Google authentication and generate access token for that. I am trying to load printer list using access_token but getting error all the time. Following are my API call details: URL : https://www.google.com/cloudprint/search Type : POST Header : Authorization : OAuth

How to print a WebView?

我只是一个虾纸丫 提交于 2020-01-01 14:39:12
问题 My Android app renders a WebView containing a canvas. Cloud Print wants a PDF. How can I generate a PDF with my WebView to send to Cloud Print? 回答1: You could first capture the canvas as a png: (taken from stackoverflow answer) var canvas = document.getElementById("mycanvas"); var img = canvas.toDataURL("image/png"); Then next step get this into a pdf. I haven't seen a javascript based converter, but one could send the png to a custom web service (perhaps running on Google Apps, Amazon AWS or

How to print a WebView?

江枫思渺然 提交于 2020-01-01 14:38:00
问题 My Android app renders a WebView containing a canvas. Cloud Print wants a PDF. How can I generate a PDF with my WebView to send to Cloud Print? 回答1: You could first capture the canvas as a png: (taken from stackoverflow answer) var canvas = document.getElementById("mycanvas"); var img = canvas.toDataURL("image/png"); Then next step get this into a pdf. I haven't seen a javascript based converter, but one could send the png to a custom web service (perhaps running on Google Apps, Amazon AWS or

Google Cloud Print using C#

你。 提交于 2019-12-20 10:25:49
问题 I try to use Google Cloud Print using C#. Internet has just one example, who wrote Josh Goebel. I will not publish the complete example, here is the only method that sends a file to print: public CloudPrintJob PrintDocument(string printerId, string title, byte[] document) { try { string authCode; if (!Authorize(out authCode)) return new CloudPrintJob() { success = false }; HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www.google.com/cloudprint/submit?output=json");

google cloud print from android without dialog

夙愿已清 提交于 2019-12-19 03:20:18
问题 Can someone tell me if it is possible to silently print using google cloud print from an android device? The goal is that my app grabs a file from a URL or from the SD card and then sends it to a specific printer - all without interaction from anyone looking at the screen or touching anything. It will actually be triggered by a barcode scan on a blue tooth connected device. Thanks 回答1: Well, it is possible but I don't know why there's not too much information about it in the documentation...

Google Cloud Print User credentials required

…衆ロ難τιáo~ 提交于 2019-12-13 03:35:56
问题 I am implement google cloud print service for my (java) web application,I have followed all the instruction but still getting "Credentials required" in response.Here is my code : public static void main(String[] args) { HttpPost printPost = new HttpPost( "https://www.google.com/cloudprint/search?output=json"); printPost.setHeader("Authorization", "GoogleLogin auth=" +getAccessToken()); printPost.setHeader("scope", "https://www.googleapis.com/auth/cloudprint"); printPost.setHeader("X

OAuth 2.0 And Google Cloud Print

一笑奈何 提交于 2019-12-12 03:44:38
问题 I created a project called: "projectprint-123" https://console.developers.google.com/apis/credentials/oauthclient?project=projectprint-123 Credentials Web application Name : projectprint-123 What to ask can the 1. Authorized JavaScript origins 2. Authorized redirect URIs Put EMPTY? Because I testing localhost. OK. I proceed to empty. What is Oauth consent screen? I only fill in Email address at this part. OK. I proceed next. Then I try https://www.google.com/cloudprint/getauthcode? printerid

Rails Google cloud print

青春壹個敷衍的年華 提交于 2019-12-11 15:33:37
问题 I am setting google cloud printing on my rails app with cloudprint following this example. This is the setup controller: class SetupController < ApplicationController protect_from_forgery with: :exception def show @google_client = CloudPrint::Client.new( client_id: 'xxxxxxxxxx', client_secret: 'xxxxxxxxxxx' ) if Rails.application.secrets.google_refresh_token # Actually nothing.. elsif params[:code] @token = @google_client.oauth_client.auth_code.get_token(params[:code], redirect_uri: root_url)