Send a PDF to a cloud printer (Console Example). This sample is used in the ebay order printer project.
Register an app with Google and Get an App Id and Client Secret https://developers.google.com/cloud-print
Step 1:
var clientId = "#client-id#";
var clientSecret = "#client-secret#";
var provider = new GoogleCloudPrintOAuth2Provider(clientId, clientSecret);
var redirectUri = "http://localhost";
//// You should have your redirect uri here if your app is a server application, o.w. leaving blank is ok
var url = provider.BuildAuthorizationUrl(redirectUri);
Console.WriteLine(url);Step 2:
var authorizationCode = "#auth-code-here#";
var token = await provider.GenerateRefreshTokenAsync(authorizationCode, redirectUri);
string json = JsonConvert.SerializeObject(token);
write string to file
System.IO.File.WriteAllText(@"cerd.json", json); Printer -> Details -> Advanced Details Get Printer Id and Proxy
