# Filling PDF Forms

**URL:** <https://www.ruby-forum.com/t/filling-pdf-forms/49477>\
**Category:** Ruby\
**Created:** [December 5, 2005, 5:52am UTC](https://www.ruby-forum.com/t/filling-pdf-forms/49477 "2005-12-05T05:52:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kevin\_OSSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/3ec8ea/32.png) [@Kevin\_OSSS](https://www.ruby-forum.com/u/Kevin_OSSS)\
**Post date:** [December 5, 2005, 5:52am UTC](https://www.ruby-forum.com/t/filling-pdf-forms/49477/1 "2005-12-05T05:52:28Z")

</div>

Are there any Ruby utilities out there for filling out PDF forms?  
I have PDF form that I would like to populate from a database.

---

<div class="post-metadata">

**Author:** ![Kevin\_OSSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/3ec8ea/32.png) [@Kevin\_OSSS](https://www.ruby-forum.com/u/Kevin_OSSS)\
**Post date:** [December 5, 2005, 5:04pm UTC](https://www.ruby-forum.com/t/filling-pdf-forms/49477/2 "2005-12-05T17:04:19Z")

</div>

Kevin O. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Are there any Ruby utilities out there for filling out PDF forms?  
> I have PDF form that I would like to populate from a database.

[http://rubyforge.org/projects/ruby-pdf/](http://rubyforge.org/projects/ruby-pdf/)

---

<div class="post-metadata">

**Author:** ![Kevin\_OSSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/3ec8ea/32.png) [@Kevin\_OSSS](https://www.ruby-forum.com/u/Kevin_OSSS)\
**Post date:** [December 5, 2005, 6:05pm UTC](https://www.ruby-forum.com/t/filling-pdf-forms/49477/3 "2005-12-05T18:05:41Z")

</div>

pfharlock wrote:

> Kevin O. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Are there any Ruby utilities out there for filling out PDF forms?  
> > I have PDF form that I would like to populate from a database.
> 
> [http://rubyforge.org/projects/ruby-pdf/](http://rubyforge.org/projects/ruby-pdf/)

While this is helpful, it does not solve my problem.

To clarify… I have a pre-existing PDF file which has various form  
fields defined within it. I would like to automatically fill the  
defined form fields with data from a database and provide the completed  
file for download to the end user.

As near as I can tell from reading the manual, PDF::Writer does not  
support forms in this fashion.

I really don’t want to regenerate the entire form from scratch.

\_Kevin

---

<div class="post-metadata">

**Author:** ![Kevin\_OSSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/3ec8ea/32.png) [@Kevin\_OSSS](https://www.ruby-forum.com/u/Kevin_OSSS)\
**Post date:** [December 16, 2005, 8:07pm UTC](https://www.ruby-forum.com/t/filling-pdf-forms/49477/4 "2005-12-16T20:07:29Z")

</div>

I’m looking for this same functionality myself. Please post if/when you  
find a way to do it in Ruby.

Thanks-  
Michael

---

<div class="post-metadata">

**Author:** ![Kevin\_OSSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/3ec8ea/32.png) [@Kevin\_OSSS](https://www.ruby-forum.com/u/Kevin_OSSS)\
**Post date:** [December 5, 2005, 6:14pm UTC](https://www.ruby-forum.com/t/filling-pdf-forms/49477/5 "2005-12-05T18:14:47Z")

</div>

On 12/5/05, Kevin O. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> pfharlock wrote:
> 
> > Kevin O. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> > 
> > > Are there any Ruby utilities out there for filling out PDF forms?  
> > > I have PDF form that I would like to populate from a database.
> > 
> > [http://rubyforge.org/projects/ruby-pdf/](http://rubyforge.org/projects/ruby-pdf/)
> 
> While this is helpful, it does not solve my problem.

You are correct. I am not sure when or if this will be possible with  
PDF::Writer. You may want to look around the Adobe developer website,  
because there are indications that it may be possible with other  
means. I just haven’t investigated it so far.

-austin

---

<div class="post-metadata">

**Author:** ![Kevin\_OSSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/3ec8ea/32.png) [@Kevin\_OSSS](https://www.ruby-forum.com/u/Kevin_OSSS)\
**Post date:** [December 31, 2005, 12:06pm UTC](https://www.ruby-forum.com/t/filling-pdf-forms/49477/6 "2005-12-31T12:06:00Z")

</div>

Just to follow up on this…

I ended up using iText which is a Java library. Filling in the form  
fields was a piece of cake!

> **[Entreprenerd — Page not found](https://entreprenerd.lowagie.com/itext.html)**
>
> This is the 404 page of the Entreprenerd web site.

After writing my own wrapper to iText I then connected it to Ruby using  
RJB  
[http://arton.no-ip.info/collabo/backyard/?RubyJavaBridge](http://arton.no-ip.info/collabo/backyard/?RubyJavaBridge)  
This bridge was also very easy to configure and use.
