|
|
Well.. yes. It is possible. In the current version you may get access to annotations through page.Dictionary["Annots"] property and form Watermark annotation. But you need to know PDF specification to do that. I can suggest you to try Pdfium.Net SDK ver. 4.0 release candidate. You can download it here https://forum.patagames.com/posts/m1578-Version-4-0-2704-was-released-on-March-06--2019#post1578PdfAnnotation were addded in this version of SDK. So that the Watermark can be added as following Code:
var doc = PdfDocument.Load(...);
var page = doc.Pages[0];
if(page.Annots == null)
page.CreateAnnotations();
var txt = PdfTextObject.Create("This is my watermark", 0, 0, PdfFont.CreateStock(doc, FontStockNames.Arial), 35);
page.Annots.Add(new PdfWatermarkAnnotation(page, txt));
page.Dispose(); //To force the page to reload and apply changes in the PDF viewer
|
|
|
Hi, is it possible to set a watermark in pdf document on runtime?
Thanks for your time!
Regards Peter
|
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close