Building a pdf with an existing pdf as watermark/background

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


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.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs