On 9/9/2013 8:13 PM, tech rek wrote:
> Hi ,
> Can I watermark single pages in a merge operation with iText Java?
Did you read the documentation?
For instance: http://manning.com/lowagie2/samplechapter6.pdf
> . I have a requirement toopen each image in memory and watermark them
What do you mean by Image?
> and save them after they are merged. is it doable?
There's more than one way to do it, but the workflow you suggest is
One could watermark PDFs in memory with PdfStamper and then merge them
That's similar to what is done in listing 6.24 where a stamper writes to
a ByteArrayOutputStream of which the bytes are used to add a page to a
PdfCopy object (listing 6.25 uses a PdfSmartCopy object to reduce the
One could merge the PDFs with PdfCopy, and then add the watermark in a
That's similar to what is done in listing 6.14 where PdfStamper is used
to add a header and a footer. A watermark isn't that different; as a
matter of fact listing 6.15 is about adding a background to an existing
One could merge and stamp in one go as shown in listing 6.22.
Nobody but you can tell you what the best solution is in your case,
because only you know the exact requirement. Please read the
documentation carefully and you'll have all the arguments you need to
make the best decision.
From: iText mailing list <info@1t...> - 2013-09-28 09:04:51
On 9/28/2013 7:24 AM, techrek73 wrote:
> Sorry,What I meant was, if I can watermark each page from PDF files with
> different watermark(page id) before I merge them with iText Java?
Yes, of course.
Did you read http://manning.com/lowagie2/samplechapter6.pdf ?