Previous | Next | (P-PDF) Engineering
Topic: Watermark/merge one PDF with another without loosing hyperlinks
Conf: (P-PDF) Engineering, Msg: 159842
From: blowagie
Date: 4/30/2007 09:43 PM
Let me first tell you something about the way a page is defined in PDF.
There's PDF content: basically the stuff without the hyperlinks.
There's PDF annotations: basically all interactive features; hyperlinks, form fields,...
Most simple tools don't care about the annotations; you've experienced that they get lost as soon as you process the existing PDF.
PdfTk is a wrapper around iText; therefore it's a more specialized tool. However: what you are trying to do fails, because the PdfTk stamping process uses PdfStamper and PdfImported page.
PdfStamper preserves all the interactive stuff in PDF 1, but the PdfImportedPage from PDF 2 that is used as an overlay (the stamp) is 'flat'. It's just the content, without the annotations.
What you need is a tool that not only merges the page content, but also the annotations. I don't know of such a tool that allows you to do this without programming, but I'm sure you can use PdfStamper and PdfImportedPage in iText to do what you did before; and then use iText to fetch the annotation info from PDF 2 and add newly created annotations based on this info to PDF 1 (with PdfStamper.addAnnotation).
br,
Bruno