merge pdf's with plugin

Hi there,

I’m trying to accomplish something, regarding generated pdf’s (by the servoy pdf plugin or jasper-ireport plugin)

what I want to do is give customers the ability to set there own letterlogo in every report
So for example, I have two pdf-files: report.pdf and a customer_logo.pdf

I want to merge those two, so that the customer_logo.pdf will be in the background of the report.pdf
I played with some libaries of iText and found this:

PdfReader reader = new PdfReader("existing.pdf");
PdfStamper stamp = new PdfStamper(reader,
  new FileOutputStream("stamped.pdf"));
PdfContentByte under = stamp.getUnderContent(1);
// change the content beneath page 1
PdfContentByte over = stamp.getOverContent(1);
// change the content on top of page 1
stamp.close()

but I could’nt get this working.
Anyone done this before or knows how this is working?

You need to replace : “// change the content beneath page 1” and “// change the content on top of page 1” with code that actually changes the content. Also iterate through all pages if needed. In itext documentation there is an example about how to add a watermark beneath the text. I guess that is what you need …

yeah, I have tried that, but I’m not a Java-guru, so I got stuck! ;-)