# Rendering html on pdf

**URL:** <https://www.ruby-forum.com/t/rendering-html-on-pdf/170070>\
**Category:** Ruby\
**Created:** [June 11, 2009, 10:41pm UTC](https://www.ruby-forum.com/t/rendering-html-on-pdf/170070 "2009-06-11T22:41:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![twittwit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/8c91f0/32.png) [@twittwit](https://www.ruby-forum.com/u/twittwit)\
**Post date:** [June 11, 2009, 10:41pm UTC](https://www.ruby-forum.com/t/rendering-html-on-pdf/170070/1 "2009-06-11T22:41:12Z")

</div>

Hi all,

i want to render some html text into pdf using ruby’s pdf writer.

however, the pdf.text cannot deliver that.

does anybody has a solution for that?

thanks in advance!

---

<div class="post-metadata">

**Author:** ![twittwit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/8c91f0/32.png) [@twittwit](https://www.ruby-forum.com/u/twittwit)\
**Post date:** [June 11, 2009, 10:46pm UTC](https://www.ruby-forum.com/t/rendering-html-on-pdf/170070/2 "2009-06-11T22:46:28Z")

</div>

On Thu, Jun 11, 2009 at 4:40 PM, twittwit[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi all,
> 
> i want to render some html text into pdf using ruby’s pdf writer.
> 
> however, the pdf.text cannot deliver that.
> 
> does anybody has a solution for that?

If your needs are very basic, try Prawn::Format.  
If you can use JRuby, try FlyingSaucer  
If you have lots of $$$, Try PrinceXML  
If you are persuasive, convince Aaron P. to write his html2pdf  
formatter for Prawn.

-greg

---

<div class="post-metadata">

**Author:** ![twittwit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/8c91f0/32.png) [@twittwit](https://www.ruby-forum.com/u/twittwit)\
**Post date:** [June 12, 2009, 12:30am UTC](https://www.ruby-forum.com/t/rendering-html-on-pdf/170070/3 "2009-06-12T00:30:45Z")

</div>

thanks greg.

---

<div class="post-metadata">

**Author:** ![twittwit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/8c91f0/32.png) [@twittwit](https://www.ruby-forum.com/u/twittwit)\
**Post date:** [June 12, 2009, 1:34am UTC](https://www.ruby-forum.com/t/rendering-html-on-pdf/170070/4 "2009-06-12T01:34:37Z")

</div>

On Thu, Jun 11, 2009 at 3:44 PM, Gregory  
Brown[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> If your needs are very basic, try Prawn::Format.  
> If you can use JRuby, try FlyingSaucer  
> If you have lots of $$$, Try PrinceXML

In talking with Yehuda K., it sounds like iText/FlyingSaucer does  
just about everything you would pay $$$ for in PrinceXML, so I’d  
strongly suggest going that route. You could even set up a JRuby  
Sinatra/DRB server just for this…it would be worth it.

- Charlie
