Code Monkey home page Code Monkey logo

doc_raptor_gem's People

Contributors

jamespaden avatar janxious avatar jqr avatar tonydewan avatar yardboy avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

doc_raptor_gem's Issues

HTTParty SSL certificate error

Recent Ruby started requiring a valid SSL cert by default. Not sure if the problem is on my end or yours, but HTTParty is failing hard when I try to use the DocRaptor API:

/Users/noah/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/net/http.rb:923:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)
    from /Users/noah/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/net/http.rb:923:in `block in connect'
    from /Users/noah/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/timeout.rb:74:in `timeout'
    from /Users/noah/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/net/http.rb:923:in `connect'
    from /Users/noah/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/net/http.rb:863:in `do_start'
    from /Users/noah/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/net/http.rb:852:in `start'
    from /Users/noah/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/net/http.rb:1375:in `request'
    from /Users/noah/.rvm/gems/ruby-2.2.1/gems/httparty-0.13.7/lib/httparty/request.rb:117:in `perform'
    from /Users/noah/.rvm/gems/ruby-2.2.1/gems/httparty-0.13.7/lib/httparty.rb:545:in `perform_request'
    from /Users/noah/.rvm/gems/ruby-2.2.1/gems/httparty-0.13.7/lib/httparty.rb:492:in `post'
    from /Users/noah/.rvm/gems/ruby-2.2.1/gems/doc_raptor-0.5.0/lib/doc_raptor.rb:58:in `create'
    from ./html_to_pdf.rb:12:in `block (2 levels) in <main>'
    from ./html_to_pdf.rb:11:in `open'
    from ./html_to_pdf.rb:11:in `block in <main>'
    from ./html_to_pdf.rb:7:in `each'
    from ./html_to_pdf.rb:7:in `<main>'

I've tried updating RVM and running "rvm osx-ssl-certs update all", so that doesn't help.

Can't render Embedded SVG

My project used Prince to generate a report. We're looking at transitioning to DocRaptor but I'm blocked because I can't seem to get DocRaptor to render inline SVG images. See example below. Is this a bug with the client? Or is it on the server side?

https://gist.github.com/1477822

Interestingly, when you put this content into fu.xhtml, it renders in a browser. When it's fu.html, it doesn't.

Tempfile encoding ascii-8bit

I'm getting the following error from line 67 of doc_raptor.rb:

"\xE2" from ASCII-8BIT to UTF-8

I've discovered that if I change line 65 in doc_raptor.rb from:

Tempfile.open("docraptor") do |f|

to

Tempfile.open("docraptor", :encoding => "ascii-8bit") do |f|

...then the problem is solved.

This appears to be related to my Rails app application.rb having the following:

config.encoding = "utf-8"

This, as I understand it, is the default for Rails 3+. Should I submit a patch with this change?

How to pass prince_options

Hi,

I am evaluating DocRaptor and this gem for our PDF generation needs.

Is it possible to send print_options with this gem ?

e.g. I am trying to use HTTP Basic Auth to let DocRaptor access the document_url. My sample request looks like -

File.open("docraptor_sample.pdf", "w+") do |f| 
  f.write DocRaptor.create(default_options.merge(
  { :document_url => "<url of html document on my server>",
    :prince_options =>  { :http_user => '<username>', :http_password => '<password>' },
    :name             => "docraptor_sample.pdf",
    :document_type    => "pdf"
  }))
end

This fails to authenticate DocRaptors request to document_url with http basic auth.

The Document log on docraptor.com shows this -

Prince Options

http_user: <username> 
http_password: <password> 
baseurl: <url of html document on my server>

This doesn't look right. Should it be serializing prince_options to yaml ?

I have confirmed http basic auth is setup correctly via curl.

Please let me know if I am missing something.

Thanks

Add user agent

expectedbehavior/doc_raptor_gem/<version>

Possibly including ruby/rails version, but it would be nice to at least have the above.

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.