# Concatenate 2 PDF documents

**URL:** <https://www.ruby-forum.com/t/concatenate-2-pdf-documents/92813>\
**Category:** Ruby\
**Created:** [April 24, 2007, 2:40pm UTC](https://www.ruby-forum.com/t/concatenate-2-pdf-documents/92813 "2007-04-24T14:40:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![morten](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/cdc98d/32.png) [@morten](https://www.ruby-forum.com/u/morten)\
**Post date:** [April 24, 2007, 2:40pm UTC](https://www.ruby-forum.com/t/concatenate-2-pdf-documents/92813/1 "2007-04-24T14:40:44Z")

</div>

Hi.

Anyone know if there’s a library out there that supports concatenation  
of 2 PDF documents?  
Basically I need to append b.pdf to a.pdf.

Br,

Morten

---

<div class="post-metadata">

**Author:** ![morten](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/cdc98d/32.png) [@morten](https://www.ruby-forum.com/u/morten)\
**Post date:** [April 24, 2007, 2:51pm UTC](https://www.ruby-forum.com/t/concatenate-2-pdf-documents/92813/2 "2007-04-24T14:51:45Z")

</div>

Morten wrote:

> Hi.
> 
> Anyone know if there’s a library out there that supports concatenation  
> of 2 PDF documents?  
> Basically I need to append b.pdf to a.pdf.

> **[PDFtk - The PDF Toolkit](https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/)**
>
> PDFtk is a simple tool for doing everyday things with PDF documents. It comes in three flavors: PDFtk Free, PDFtk Pro, and our original command-line tool PDFtk Server.

---

<div class="post-metadata">

**Author:** ![morten](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/cdc98d/32.png) [@morten](https://www.ruby-forum.com/u/morten)\
**Post date:** [April 24, 2007, 3:17pm UTC](https://www.ruby-forum.com/t/concatenate-2-pdf-documents/92813/3 "2007-04-24T15:17:47Z")

</div>

> Hi.
> 
> Anyone know if there’s a library out there that supports concatenation  
> of 2 PDF documents?  
> Basically I need to append b.pdf to a.pdf.

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

There’s an example included called Concat.java that does exactly that.

iText is not written in Ruby, but despite this shortcoming it is a very  
good piece of software 😉

Kristian

---

<div class="post-metadata">

**Author:** ![morten](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/cdc98d/32.png) [@morten](https://www.ruby-forum.com/u/morten)\
**Post date:** [April 25, 2007, 12:56am UTC](https://www.ruby-forum.com/t/concatenate-2-pdf-documents/92813/4 "2007-04-25T00:56:15Z")

</div>

removed\_email\_address@domain.invalid wrote:

> iText is not written in Ruby, but despite this shortcoming it is a very  
> good piece of software 😉
> 
> Kristian

Thanks for the tips. I was secretly hoping for a Ruby only solution, or  
one that did not require me to have my hosting provider install Java.

The pdftk port has an awful lot of dependencies. It seems that  
ImageMagick can do it: convert some.pdf other.pdf output.pfd - I’ll be  
looking into that.

Br,

Morten
