prior / prawnto Goto Github PK
View Code? Open in Web Editor NEWa featureful rails plugin leveraging the new kickass prawn library to produce compiled pdf views
Home Page: http://cracklabs.com/prawnto
License: MIT License
a featureful rails plugin leveraging the new kickass prawn library to produce compiled pdf views
Home Page: http://cracklabs.com/prawnto
License: MIT License
Hello!
Thanks for building an extension to Prawn. I'm filing this issue to let you know that we're currently working towards a stable 1.0 release of Prawn, and I want to invite you to be part of the discussion around that.
We will only have one more major release before 1.0 is shipped: it will be labeled 0.15 and it will be cut on 2014-02-16.
The functionality of the 0.15 release will be largely the same as what we ship in 1.0, so if you want to test your project against the newest Prawn code, that would be a good time to
do it. You can also get a head start by trying out what is on master now, and reporting any problems you encounter.
If your project is sufficiently up to date and is able to run on the latest Prawn code, the next step would be to take a look at our API compatibility plans, which are described in detail here:
https://groups.google.com/forum/#!topic/prawn-ruby/dbTSnlDhED0
Here's the very quick summary:
I know this is a little bit confusing, and my hope is that in the not too distant future we'll be able to cut a Prawn 2.0 release that has much better support for downstream dependencies.
Until that time, what we lack in stability we'll try to make up in support for your project. Use the Prawn mailing list to contact us about any concerns or breakage, help us work on API stabilization, and let us know when you need extension points to support your project.
Thanks!
-greg
Mime::PDF is no longer defined under Rails 5. Use
def set_content_type
@controller.response.content_type ||= Mime::EXTENSION_LOOKUP['pdf']
end
PR will be submitted shortly.
it's great
If i write below code it displays as it is which is not what I wanted. Doesn't prawnto supports html tags like headers, paragraph, bold, italics, and many more?
pdf.text "a5his"
I've created a PDF , with prawn in which i used the follwing code:
template = "/path_to_pdf_template"
Prawn::Document.generate("foo.pdf", :template => template,:page_size => "LETTER") do
canvas do
#All of my drawing stuff here...
end
end
to draw on top of the pdf template i've just loaded with the :template option, it works fine!, i've developed my foo.pdf nicely, running in a
regular non-rails enviorment.
My problem arises, when I try to to this the same thing inside the rails app, in which i use prawnto to access prawn facilities.
I think i'm doing the right thing which is:
Create my foo.pdf.prawn template, and put all of my drawing stuff there.
Put my "respond_to do |format| format.pdf end" in my action
and at the top of my controller to set up the Prawn::Document option (as is described in prawnto docs) in a call to
"prawnto" method like this:
template = "/path_to_pdf_template"
prawnto :prawn => { :template => template }
but it doesn't work, ive tried all! but always is the same result, the only thing i have is my drawing stuff but without the template content, i've tried with a jpeg file and the :background option and it works!, but something happens
with the :template option.
I'm using rails 2.3.5
Prawn 0.8.4
and prawnto from github
I think the problem is prawnto, anyone can help?
I am using prawnto to render a view of a "letter' that is generated from text in a textarea form.
How can I render formatting like bold and underline (for simplicity right now, using say html markup, and in the future maybe a simpler markdown language.
When I run my tests, I get this:
DEPRECATION WARNING: Inheriting from ActionView::Template::Handler is deprecated.
Since Rails 3, all the API your template handler needs to implement is to respond to #call.
(called from module:TemplateHandlers at
/Users/leigh/Programming/wapp_dev/cdjobs/vendor/plugins/prawnto/lib/prawnto/template_handlers/base.rb:3)
Prawnto works perfectly in the app.
**Leigh
The homepage says "written and tested only for Rails 2.2 & 2.1", however this plugin is not compatible with Rails 2.1 since it uses memoize which appeared only in Rails 2.2
It was not displayed in IE.
It was displayed when changing from
33 def ssl_request? 34 @controller.request.env['SERVER_PROTOCOL'].downcase == "https" 35 end 41 @controller.headers['Pragma'] = 'public' 50 @controller.headers['Cache-Control'] = 'maxage=1'
to
33 def ssl_request? 34 @controller.request.ssl? 35 end 41 @controller.headers["Pragma"]="private" 50 @controller.headers["Cache-Control"]="private"
ActionView::TemplateError: You have a nil object when you didn't expect it! The error occurred while evaluating nil.downcase
class Prawnto::TemplateHandler::CompileSupport def ssl_request? @controller.request.env['SERVER_PROTOCOL'].downcase == "https" end end
to
class Prawnto::TemplateHandler::CompileSupport def ssl_request? @controller.request.env['SERVER_PROTOCOL'].to_s.downcase == "https" end end
Let's say I want to store the generated PDF for further use given certain conditions. How do I get access to the pdf generated with prawnto?
The README states:
full documentation/demos at: http://cracklabs.com/prawnto
However, cracklabs.com is currently parked by GoDaddy.
I can see the pdf files in Linux without problems, but I can't see it in Windows.
I have the error "... mime type error ..." when I try open it with Acrobat Reader.
Any suggestion ?
Thanks.
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.