# PDF::Reader streamed into PDF::Writer

**URL:** <https://www.ruby-forum.com/t/pdf-reader-streamed-into-pdf-writer/133108>\
**Category:** Ruby\
**Created:** [March 27, 2008, 8:48pm UTC](https://www.ruby-forum.com/t/pdf-reader-streamed-into-pdf-writer/133108 "2008-03-27T20:48:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bluetwin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/4bbf92/32.png) [@bluetwin](https://www.ruby-forum.com/u/bluetwin)\
**Post date:** [March 27, 2008, 8:48pm UTC](https://www.ruby-forum.com/t/pdf-reader-streamed-into-pdf-writer/133108/1 "2008-03-27T20:48:10Z")

</div>

Hi Folks,

Does PDF::Reader integrate at all with PDF::Writer?

What I’m attempting to do is read a pdf file while writing it back out  
in pdf with additional data added(i.e. form fields populated).

Essentially this is a premade template I want to dynamically populate.

My guess would be to map all the callbacks received from PDF::Reader  
into an associated PDF::Writer function, but that would take massive  
amounts of man-hours to complete.

I’ve searched a few posts but haven’t seen anything exactly like what  
I’m looking for other than [PDF::Writer, create pdf and insert in other pdf file - Ruby - Ruby-Forum](http://www.ruby-forum.com/topic/147310#new) :

"Posted by Austin Z. (austin)  
on 26.03.2008 21:25  
(Received via mailing list)

On Wed, Mar 26, 2008 at 1:23 PM, Ricardo P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> ########################################  
> now I wanna save this pdf as a last page of a existing pdf.  
> any tips?Can’t be done with PDF::Writer or straight Ruby. You might be able to  
> do it with Cairo’s PDF support.

-austin"

Anyone have other suggestions?

---

<div class="post-metadata">

**Author:** ![bluetwin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/4bbf92/32.png) [@bluetwin](https://www.ruby-forum.com/u/bluetwin)\
**Post date:** [March 28, 2008, 2:19am UTC](https://www.ruby-forum.com/t/pdf-reader-streamed-into-pdf-writer/133108/2 "2008-03-28T02:19:31Z")

</div>

On Thu, Mar 27, 2008 at 3:48 PM, Brandon S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Does PDF::Reader integrate at all with PDF::Writer?
> 
> What I’m attempting to do is read a pdf file while writing it back out  
> in pdf with additional data added(i.e. form fields populated).
> 
> Essentially this is a premade template I want to dynamically populate.
> 
> My guess would be to map all the callbacks received from PDF::Reader  
> into an associated PDF::Writer function, but that would take massive  
> amounts of man-hours to complete.

Yes, it would. You _really_ don’t want to do this. If you need to do  
this, look at stepping outside of Ruby or look at Ruby Cairo.

There has been discussion of _simplistic_ PDFR to PDFW translation,  
but it’s exactly that: simplistic.

BTW ruby-forum is a poor-man’s replication of the mailing list and  
newsgroup interaction.

-austin
