I've had very good success with pdfkit,
https://github.com/pdfkit/pdfkit
I maintain templates in erubis (*.erb) files and render to html and
then use pdfkit to convert the html output to pdf.
To give you an idea:
def generate
us_states.each do |us_state|
puts "Generating for #{us_state}..."
eruby = ERB.new(File.read("template.erubis"))
html = eruby.result(binding)
PDFKit.new(html).to_file("#{us_state}.pdf"))
end
end
To be clear, this isn't using Prawn. Prawn's definitely a part of my
toolchain, but isn't needed for generating HTML => PDF in this
scenario. BTW, this is a great way to render web pages into PDFs for
"snapshots" of the sites under development.
Michael
On Tue, Mar 19, 2013 at 7:10 AM, Pasi <
pa...@tolonen.com> wrote:
> Hi.
>
> As this is the first post to this thread I feel that before anything else I
> need to thank you the developers and maintainers of this superb rails gem,
> Prawn. Ablsoutely fantastic job, we just love using it!
>
> So, everything else works like a charm, but I haven't found a proper way to
> convert/add HTML-formatted text into Prawn. We use Kendo UI Editor for our
> front end text editing and it can save it's output as HTML. We need just
> basic formatting like bold, italics and lists, nothing fancy on top of that.
> I have found following gems
>
> -
https://github.com/kristianmandrup/Prawn-assist
> -
https://github.com/kristianmandrup/prawn_html
>
> Have anyone tried these with the latest Prawn (1.0.0rc2) or is there any
> other path I should follow with this HTML to Prawn text -issue?
>
> Thanks,
>
> P
>
> --
> You received this message because you are subscribed to the Google Groups
> "Prawn" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
prawn-ruby+...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>
--
http://codeconnoisseur.org