Arcath
Arcath

Reputation: 4391

HTML with Prawn

Im trying to use prawn to generate a PDF of a log entry, then entries are stored in bbcode ([b]bold[/b] etc...) and is converted to html on display.

Is there any way to display the html in prawn?

Upvotes: 2

Views: 3107

Answers (3)

evaneykelen
evaneykelen

Reputation: 472

You'll probably get the best results if you use a lexical analyser such as 'Syntax' by Jamis Buck (http://syntax.rubyforge.org/) and parse the interesting parts of the HTML chunk and render those parts to PDF.

Upvotes: 1

jmcnevin
jmcnevin

Reputation: 1285

It sounds like prawn-format might be what you're looking for, but you'll need to use an older version of prawn if you want to try it out.

Upvotes: 1

bobbywilson0
bobbywilson0

Reputation: 1072

You can use http://www.princexml.com/ to convert html docs to css, or use the princely plugin to render a pdf as one of the accepted formats of your view. See http://jimneath.org/2009/02/16/creating-pdf-documents-in-ruby-on-rails/

If you are wanting to use prawn directly I don't think there is a way to just use html directly to convert to pdf.

Upvotes: 0

Related Questions