# Possible to populate Adobe PDF using RoR?

**URL:** <https://www.ruby-forum.com/t/possible-to-populate-adobe-pdf-using-ror/174319>\
**Category:** Ruby\
**Created:** [August 25, 2009, 12:55am UTC](https://www.ruby-forum.com/t/possible-to-populate-adobe-pdf-using-ror/174319 "2009-08-25T00:55:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![joviyach](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7bcc69/32.png) [@joviyach](https://www.ruby-forum.com/u/joviyach)\
**Post date:** [August 25, 2009, 12:55am UTC](https://www.ruby-forum.com/t/possible-to-populate-adobe-pdf-using-ror/174319/1 "2009-08-25T00:55:46Z")

</div>

I am kicking an idea around in my head right and I would really like  
to do this in RoR due to the speed and ease of deployment especially  
on the data collection end. Anyway, the application has to be able to  
pull data from a SQL database and populate Adobe PDF forms with the  
data. Anyone know if such a thing is possible right now with ROR?

Thanks,

Jim

---

<div class="post-metadata">

**Author:** ![joviyach](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7bcc69/32.png) [@joviyach](https://www.ruby-forum.com/u/joviyach)\
**Post date:** [August 25, 2009, 1:59am UTC](https://www.ruby-forum.com/t/possible-to-populate-adobe-pdf-using-ror/174319/2 "2009-08-25T01:59:00Z")

</div>

On Mon, Aug 24, 2009 at 6:55 PM, joviyach[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I am kicking an idea around in my head right and I would really like  
> to do this in RoR due to the speed and ease of deployment especially  
> on the data collection end. Anyway, the application has to be able to  
> pull data from a SQL database and populate Adobe PDF forms with the  
> data. Anyone know if such a thing is possible right now with ROR?

What is ROR?

---

<div class="post-metadata">

**Author:** ![joviyach](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7bcc69/32.png) [@joviyach](https://www.ruby-forum.com/u/joviyach)\
**Post date:** [August 25, 2009, 3:27am UTC](https://www.ruby-forum.com/t/possible-to-populate-adobe-pdf-using-ror/174319/3 "2009-08-25T03:27:23Z")

</div>

On Monday 24 August 2009 05:55:05 pm joviyach wrote:

> I am kicking an idea around in my head right and I would really like  
> to do this in RoR

…stop.

Go to the Ruby on Rails group:

[http://groups.google.com/group/rubyonrails-talk](http://groups.google.com/group/rubyonrails-talk)

Do not pass Go, do not collect $200.

> Anyway, the application has to be able to  
> pull data from a SQL database and populate Adobe PDF

Why Adobe? PDF is now an open standard:

> **[PDF](https://en.wikipedia.org/wiki/Portable_Document_Format)**
>
> Portable Document Format (PDF), standardized as ISO 32000, is a file format developed by Adobe in 1992 to present documents, including text formatting and images, in a manner independent of application software, hardware, and operating systems. Based on the PostScript language, each PDF file encapsulates a complete description of a fixed-layout flat document, including the text, fonts, vector graphics, raster images and other information needed to display it. PDF has its roots in "The Camel PD...

Now, if you wanted to know how to do it in Ruby, here you go:

[http://tinyurl.com/kngh34](http://tinyurl.com/kngh34)

---

<div class="post-metadata">

**Author:** ![joviyach](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7bcc69/32.png) [@joviyach](https://www.ruby-forum.com/u/joviyach)\
**Post date:** [August 25, 2009, 4:06am UTC](https://www.ruby-forum.com/t/possible-to-populate-adobe-pdf-using-ror/174319/4 "2009-08-25T04:06:01Z")

</div>

On Aug 24, 8:33 pm, Josh C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> then, you can either run the rake task, if that method works best for you,
> 
> > pull data from a SQL database and populate Adobe PDF forms with the  
> > data. Anyone know if such a thing is possible right now with ROR?
> 
> > Thanks,
> 
> > Jim

Thanks Josh. I am already running RoR on my test station and I have  
been using Heroku as well.

To the others, sorry to have disturbed you with my question.

---

<div class="post-metadata">

**Author:** ![joviyach](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7bcc69/32.png) [@joviyach](https://www.ruby-forum.com/u/joviyach)\
**Post date:** [August 25, 2009, 3:36am UTC](https://www.ruby-forum.com/t/possible-to-populate-adobe-pdf-using-ror/174319/5 "2009-08-25T03:36:09Z")

</div>

From your terminal, try  
gem query -rn pdf

That should give you a good place to start looking.

If you are using RoR, you can already pull objects from your database  
(you  
should be writing this code in the model). You can also set up a rake  
task  
that loads the RoR environment (check out Ryan B.’ Railscast on it  
[#66 Custom Rake Tasks - RailsCasts](http://railscasts.com/episodes/66-custom-rake-tasks)). To execute your  
code,  
then, you can either run the rake task, if that method works best for  
you,  
or you can interract with your code through the console, or through some  
MVC  
structure you have defined, in a web browser. That might make for a nice  
easy gui, if that is your plan, then you might check out the member and  
collection routing options, depending on whether you’re trying to write  
a  
record or a class of records to the PDF, here is a good resource for  
that  
[Rails Routing from the Outside In — Ruby on Rails Guides](http://guides.rubyonrails.org/routing.html).
