Giter Club home page Giter Club logo

cloudprint's People

Contributors

broosk1993 avatar dilkhush avatar jimryan avatar josephecombs avatar nasa42 avatar owyongsk avatar sebastianszturo avatar troelskn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cloudprint's Issues

Net::ReadTimeout: Net::ReadTimeout

Hello,

This gem has been working properly in the past. Now the exception "Net::ReadTimeout:Net::ReadTimeout" is raised when a job is submitted.

What could be the reason for this? I saw a pull request that suggests to update the Net::HTTP to Faraday. Could it be that Net::HTTP is getting old?

Rewrite the HTTP code to use Faraday.

OAuth2 depends on Faraday which is a lot nicer to work with than Net::HTTP. Since that dependency is already a given, this gem might as well take advantage of Faraday too.

Failure to open TCP connection

Hello,

Very recently, and out of nowhere, the following error keeps coming up when trying to use client.printers.find(<printer_id>):

SocketError: Failed to open TCP connection to www.google.com:443 (getaddrinfo: No address associated with hostname)

I wonder what could be causing this problem?

Update Documentation/Readme

Google's documentation for cloudprint is really old now. Their API playground does not feature it any longer, rather they have a ...minimal... simulation tool here

Also, using this gem before the point of having a refresh_token is impossible, and understanding the flow of obtaining a refresh_token is complicated. Martin Fowler wrote an article about this, and he was using a well-documented API!

search_all delegates to invalid query

Calling client.printers.all delegates to client.printers.search_all, which in turn delegates to client.printers.search('all'). This doesn't return any printers, except for the default "Save to Google Docs" (__google__docs). I suggest changing method_missing to exclude "all" from the regexp, and then change def all to be an alias on search

Unable to Connect to google

could you create a example application, on how this should properly be implemented with oauth connecting to google.

Automate the process of authenticating.

I think we want a singleton class like CloudPrint::Auth that supports the following methods:

  • generate_url should generate a correct URL.
  • process_code should generate a refresh token (default) or single access token (optional)

Trying to print returns nil

p = CloudPrint::Client.new(refresh_token: "refresh", client_id: "id", client_secret: "secret", callback_url: "Valid callback url")
my_printer = p.printers.find("id")
my_printer.print(content: "html", content_type: "text/html")

return nil :(

client.auth method does not exist

I am using gem version 0.3.2 which is also the latest version in the repo. The README says that I should call client.auth.generate_url method. However, I get the following error:

NoMethodError: undefined method `auth' for #CloudPrint::Client:0x007f9559098918

It seems like, either a new gem version needs to be pushed to rubygems.org or the documentation is out of date.

CloudPrint return nil after used .print method

I'm using this:

cp = CloudPrint::Client.new(refresh_token: "sent refresh token valid", client_id: "sent valid id", client_secret: "sent valid secret", callback_url: "Valid callback url")
my_printer = cp.printers.find("valid id printer") #get correctly the printer

my_printer.print(content: "<h1>Hello World</h1>", content_type: "text/html")
#this return nil and not print

what is my mistake ?

Can't print PDF google drive

Can't get pdf to correctly print when printing to google drive. pdf shows up fine on local but comes across blank in google drive.
File.open(Rails.root.join('public', "#{invoice_number}.pdf"), 'wb') do |file|
file.write(decoded_invoice_pdf)
end
printer.print(title: "#{invoice_number}_1.pdf", content: decoded_invoice_pdf, content_type: "application/pdf")
printer.print(title: "#{invoice_number}_2.pdf", content: File.read(Rails.root.join('public', "#{invoice_number}.pdf")), content_type: "application/pdf")

PDF not align properly.

Hi.

I'm using your gem and it works perfect, almost...

I want to print a label for a product, I construct the PDF in my app, no problem, Initialize a CloudPrint instance and call print on it. The problem comes when the printer prints the label. The position of the label is totally wrong. It's not at the top of the page where I've expected it to be.

Can you have any control over the page settings, e.g. "Fit to page" or other options you have when printing directly to a printer in Google Chrome?

Here is my code:

          client_id = file[Rails.env.downcase]["client_id"]
          client_secret = file[Rails.env.downcase]["client_secret"]
          client = CloudPrint::Client.new(
            client_id: client_id,
            client_secret: client_secret,
            refresh_token: refresh_token
          )
          client.printers.find(default_printer_id).print(content: base64, content_type: "application/pdf", ticket: {"version": "1.0", "print": {}}, content_transfer_encoding: "base64")

Thank you.

Change Paper Size

Is there anyway to change the paper size with this gem? I'm trying to print a 5x7 card and I can't find anywhere that the paper size is specified, so it's forcing a letter size on my print job.

Update dependency versions

The current latest published gem has a dependency on oauth2 0.8.0. This is incompatible with the latest Rails.

It seems to work fine if I change the dependency to 1.1.0. Could you update and publish a new gem version?

UI State not available on print job

Google Cloud Print provides a UI State that includes a summary, progress of a job, and a cause for display use. Parsing that information into the print_job would help us display errors correctly with the same terminology as Google's UI.

Ruby on Rails

How do I run an application in Ruby on Rails? is possible?

Example of actually printing a PDF file?

So arguably this is likely a documentation issue more than a problem (I hope), but the docs mention that you just pass a File as the content (and presumably application/pdf as the content type), but I canntot get that to work (I get errors about "no implicit conversion of nil into String" from within net/http/generic_request).

I also see other issues where it looks like folks are encoding the PDF content into base64 ahead of time - not sure if that is a choice of a necessity.

So any chance of an example of what you need to minimally print a PDF file via the gem would be much appreciated!

A refresh_token is not available

Hello all,

me again ๐Ÿ˜ž

I'm getting A refresh_token is not available.

So, this happens once the OAuth has been authenticated, and we try to hit the endpoint on Google again.

I've debugged the code and tried to run client.refresh_token, no luck here.

Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.