# Creating PDF files from your Rails templates

**URL:** <https://www.ruby-forum.com/t/creating-pdf-files-from-your-rails-templates/105443>\
**Category:** Rails\
**Created:** [May 30, 2007, 1:01am UTC](https://www.ruby-forum.com/t/creating-pdf-files-from-your-rails-templates/105443 "2007-05-30T01:01:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![subimage](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@subimage](https://www.ruby-forum.com/u/subimage)\
**Post date:** [May 30, 2007, 1:01am UTC](https://www.ruby-forum.com/t/creating-pdf-files-from-your-rails-templates/105443/1 "2007-05-30T01:01:58Z")

</div>

Just posted a little how-to about creating PDF files directly from Rails  
templates. Thought you all would enjoy it.

[http://sublog.subimage.com/articles/2007/05/29/html-css-to-pdf-using-ruby-on-rails](http://sublog.subimage.com/articles/2007/05/29/html-css-to-pdf-using-ruby-on-rails)

Cheers.

* * *

## seth at subimage interactive

## [http://www.subimage.com](http://www.subimage.com) [http://sublog.subimage.com](http://sublog.subimage.com)

> **[Freelance Time Tracking Software — Online Invoice Software](https://cashboardapp.com/)**
>
> Freelance time tracking software, online invoice software & project management.
> Used by thousands worldwide since 2007. FREE trial.

[http://dev.subimage.com/projects/substruct](http://dev.subimage.com/projects/substruct)

---

<div class="post-metadata">

**Author:** ![subimage](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@subimage](https://www.ruby-forum.com/u/subimage)\
**Post date:** [May 30, 2007, 2:45am UTC](https://www.ruby-forum.com/t/creating-pdf-files-from-your-rails-templates/105443/2 "2007-05-30T02:45:58Z")

</div>

Dude, sweet. I’m not anywhere good enough to implement that yet, but  
it’s definitely on my “to learn” list now. Thanks for your efforts.

---

<div class="post-metadata">

**Author:** ![subimage](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@subimage](https://www.ruby-forum.com/u/subimage)\
**Post date:** [May 30, 2007, 4:06am UTC](https://www.ruby-forum.com/t/creating-pdf-files-from-your-rails-templates/105443/3 "2007-05-30T04:06:11Z")

</div>

It’s actually quite easy. Download the files, include them in you rails  
app,  
and call 1 line of ruby code 😉

On 5/29/07, Sean C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 

## –

## seth at subimage interactive

## [http://www.subimage.com](http://www.subimage.com) [http://sublog.subimage.com](http://sublog.subimage.com)

> **[Freelance Time Tracking Software — Online Invoice Software](https://cashboardapp.com/)**
>
> Freelance time tracking software, online invoice software & project management.
> Used by thousands worldwide since 2007. FREE trial.

[http://dev.subimage.com/projects/substruct](http://dev.subimage.com/projects/substruct)

---

<div class="post-metadata">

**Author:** ![subimage](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@subimage](https://www.ruby-forum.com/u/subimage)\
**Post date:** [May 30, 2007, 3:19pm UTC](https://www.ruby-forum.com/t/creating-pdf-files-from-your-rails-templates/105443/4 "2007-05-30T15:19:36Z")

</div>

hi, this is totally kicka\*\*!

thanks for sharing.

btw, confused about the princexml part. if this gets installed on a  
server, and i allow people to export their recipe in pdf format, i need  
to buy the license correct?

thanks

Subimage Interactive wrote:

> Just posted a little how-to about creating PDF files directly from Rails  
> templates. Thought you all would enjoy it.
> 
> [http://sublog.subimage.com/articles/2007/05/29/html-css-to-pdf-using-ruby-on-rails](http://sublog.subimage.com/articles/2007/05/29/html-css-to-pdf-using-ruby-on-rails)
> 
> Cheers.
> 
> * * *
> 
> ## seth at subimage interactive
> 
> ## [http://www.subimage.com](http://www.subimage.com) [http://sublog.subimage.com](http://sublog.subimage.com)
> 
> [http://www.getcashboard.com](http://www.getcashboard.com)  
> [http://dev.subimage.com/projects/substruct](http://dev.subimage.com/projects/substruct)

---

<div class="post-metadata">

**Author:** ![subimage](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@subimage](https://www.ruby-forum.com/u/subimage)\
**Post date:** [May 30, 2007, 5:19pm UTC](https://www.ruby-forum.com/t/creating-pdf-files-from-your-rails-templates/105443/5 "2007-05-30T17:19:25Z")

</div>

Seth,

Thanks! This is great and will be very useful. PDF is one of those  
things I had been putting off.

In case it is helpful for anyone else, I wrote up the installation  
steps and how I needed to modify it for use.  
[http://www.nullislove.com/2007/05/30/easy-pdfs-from-rails/](http://www.nullislove.com/2007/05/30/easy-pdfs-from-rails/)

(To mixplate: The Prince license is here:

> **[Prince - End User License Agreement](https://www.princexml.com/license/)**
>
> Convert HTML documents to PDF. Beautiful printing with CSS. Support for JavaScript and SVG.

My understanding is that it’s free for non-commercial use. $495 for a  
single computer to use for commercial purposes. $3,800 to put it on a  
server for anyone to use.)

Thanks again,  
Kevin S.

---

<div class="post-metadata">

**Author:** ![subimage](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@subimage](https://www.ruby-forum.com/u/subimage)\
**Post date:** [May 30, 2007, 1:06pm UTC](https://www.ruby-forum.com/t/creating-pdf-files-from-your-rails-templates/105443/6 "2007-05-30T13:06:33Z")

</div>

Seth,

Great stuff, I’ll have to try this out.

I’ve bee looking to do exactly this for over a year!

---

<div class="post-metadata">

**Author:** ![subimage](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@subimage](https://www.ruby-forum.com/u/subimage)\
**Post date:** [May 30, 2007, 8:16pm UTC](https://www.ruby-forum.com/t/creating-pdf-files-from-your-rails-templates/105443/7 "2007-05-30T20:16:09Z")

</div>

Cool take on it. A plugin might be nice to see as you suggested.

Post a comment on the blog with the link so people can check out your  
write-up too! 😉

On 5/30/07, Kevin S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> >

## –

## seth at subimage interactive

## [http://www.subimage.com](http://www.subimage.com) [http://sublog.subimage.com](http://sublog.subimage.com)

> **[Freelance Time Tracking Software — Online Invoice Software](https://cashboardapp.com/)**
>
> Freelance time tracking software, online invoice software & project management.
> Used by thousands worldwide since 2007. FREE trial.

[http://dev.subimage.com/projects/substruct](http://dev.subimage.com/projects/substruct)
