# Proper/best way to merge PDFs from Ruby?

**URL:** <https://www.ruby-forum.com/t/proper-best-way-to-merge-pdfs-from-ruby/178482>\
**Category:** Ruby\
**Created:** [November 5, 2009, 9:42am UTC](https://www.ruby-forum.com/t/proper-best-way-to-merge-pdfs-from-ruby/178482 "2009-11-05T09:42:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hal\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/6bbea6/32.png) [@Hal\_F](https://www.ruby-forum.com/u/Hal_F)\
**Post date:** [November 5, 2009, 9:42am UTC](https://www.ruby-forum.com/t/proper-best-way-to-merge-pdfs-from-ruby/178482/1 "2009-11-05T09:42:58Z")

</div>

Doing simple concatenation of PDF files.

At the moment I’m invoking pdftk from within Ruby…  
works fine, but feels ugly, and I don’t want the dependency.

Any good way to do this? Even a one-off would be welcome…

Cheers,  
Hal

---

<div class="post-metadata">

**Author:** ![Hal\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/6bbea6/32.png) [@Hal\_F](https://www.ruby-forum.com/u/Hal_F)\
**Post date:** [November 5, 2009, 3:20pm UTC](https://www.ruby-forum.com/t/proper-best-way-to-merge-pdfs-from-ruby/178482/2 "2009-11-05T15:20:43Z")

</div>

On Thu, Nov 5, 2009 at 3:04 AM, Hal F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Doing simple concatenation of PDF files.
> 
> At the moment I’m invoking pdftk from within Ruby…  
> works fine, but feels ugly, and I don’t want the dependency.
> 
> Any good way to do this? Even a one-off would be welcome…

This is what I tell Prawn users to do, so unfortunately for now I  
don’t have a better suggestion.  
PDF merge is a non-trivial operation. But we may end up with  
something sooner or later…

-greg
