# Building a pdf with an existing pdf as watermark/background

**URL:** <https://www.ruby-forum.com/t/building-a-pdf-with-an-existing-pdf-as-watermark-background/70480>\
**Category:** Rails\
**Created:** [September 29, 2006, 4:06pm UTC](https://www.ruby-forum.com/t/building-a-pdf-with-an-existing-pdf-as-watermark-background/70480 "2006-09-29T16:06:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stewbawka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@stewbawka](https://www.ruby-forum.com/u/stewbawka)\
**Post date:** [September 29, 2006, 4:06pm UTC](https://www.ruby-forum.com/t/building-a-pdf-with-an-existing-pdf-as-watermark-background/70480/1 "2006-09-29T16:06:25Z")

</div>

I’m starting on a small rails app and i need to generate a report in  
pdf format.

i’ve generated pdfs before using pdf::writer without much problems, but  
for this project the company sent me a pdf ‘watermark’ (or background  
template) that they want the report to be printed on… instead of  
having them stock a bunch of the template stationary and have that  
paper used in the printer that the reports will be printed from i want  
to merge it with the pdf my app is generating.

anyway to do this? i know that pdf-writer is somewhat limited… is  
there another pdf gem that might be a better fit? if neither of these  
works what about an external program that could merge these properly  
that could be run with a system call?

Any help would be greatly appreciated… thanks in advance

stuart

---

<div class="post-metadata">

**Author:** ![stewbawka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@stewbawka](https://www.ruby-forum.com/u/stewbawka)\
**Post date:** [September 29, 2006, 5:39pm UTC](https://www.ruby-forum.com/t/building-a-pdf-with-an-existing-pdf-as-watermark-background/70480/2 "2006-09-29T17:39:03Z")

</div>

If you don’t mind calling an external program, pdftk should do it. It  
splits, merges, watermarks, generates and fills FDF and all sorts of  
other things. I’m currently using it for FDF form-filling from Rails  
and it’s working fine.

It runs on all sorts of Unixes and Win32.

> **[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.
