# PDF::Writer, create pdf and insert in other pdf file

**URL:** <https://www.ruby-forum.com/t/pdf-writer-create-pdf-and-insert-in-other-pdf-file/133012>\
**Category:** Ruby\
**Created:** [March 26, 2008, 6:23pm UTC](https://www.ruby-forum.com/t/pdf-writer-create-pdf-and-insert-in-other-pdf-file/133012 "2008-03-26T18:23:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rpacheco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e36b37/32.png) [@rpacheco](https://www.ruby-forum.com/u/rpacheco)\
**Post date:** [March 26, 2008, 6:23pm UTC](https://www.ruby-forum.com/t/pdf-writer-create-pdf-and-insert-in-other-pdf-file/133012/1 "2008-03-26T18:23:30Z")

</div>

Hi folks(wharever it mean my english is so bad…)

the following code create a PDF:

#!/usr/bin/ruby

require ‘pdf/writer’

pdf = PDF::Writer.new

pdf.text “Hello Matz”, :font\_size =\> 22

pdf.save\_as “novo.pdf”

########################################

now I wanna save this pdf as a last page of a existing pdf.

any tips?

---

<div class="post-metadata">

**Author:** ![rpacheco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e36b37/32.png) [@rpacheco](https://www.ruby-forum.com/u/rpacheco)\
**Post date:** [March 26, 2008, 9:25pm UTC](https://www.ruby-forum.com/t/pdf-writer-create-pdf-and-insert-in-other-pdf-file/133012/2 "2008-03-26T21:25:14Z")

</div>

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
