expectedbehavior / doc_raptor_gem Goto Github PK
View Code? Open in Web Editor NEWProvides a simple ruby wrapper around the DocRaptor API
Home Page: docraptor.com
License: MIT License
Provides a simple ruby wrapper around the DocRaptor API
Home Page: docraptor.com
License: MIT License
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
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.
probably a version bump with an install message?
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?
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.
expectedbehavior/doc_raptor_gem/<version>
Possibly including ruby/rails version, but it would be nice to at least have the above.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.