Posted by a ceTe Software moderator
Hello,
The Converter does the have the watermarking feature. Once the PDF is generated by the Converter you can add the watermark using
Merger. Generator can only generate PDFs programmatically where as Merger can open existing PDFs and add content and save it. Here is the sample code for Merger that can be used to add the watermark.
//Open an existing document to add watermark.
MergeDocument document = new MergeDocument("Input.pdf");
//use TransparencyGroup to add lable and text to create a watermark
TransparencyGroup group = new TransparencyGroup(0.5f); // adjust the transparency.
//cerate a label for watermark.
Label lbl = new Label(""Text Watermark"", 250, 250, 300, 300, Font.Courier, 35);
lbl.Angle = 45;
//create a image for watermark
Image image = new Image(""DPDFLogo.png"", 250, 250);
//add label and image to transparencygroup
group.Add(lbl);
group.Add(image);
//create template and add the watermark to the template.
Template pageTemplate = new Template();
pageTemplate.Elements.Add(group);
//apply the template to the document so watermark shows up on all pages.
//use StampTemplate to apply the watermark on top of existing content.
document.StampTemplate = pageTemplate;
//use Template to apply the watermark under the exisiting content.
//document.Template = pageTemplate;
document.Draw("output.pdf");
Thanks,
ceTe Software Support Team.