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 confusing.

One could watermark PDFs in memory with PdfStamper and then merge them with PdfSmartCopy. 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 file size).

One could merge the PDFs with PdfCopy, and then add the watermark in a second pass. 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 document.

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.
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to