logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Post a reply
From:
Message:

Maximum number of characters in each post is: 32767
Bold Italic Underline   Highlight Quote Choose Language for Syntax Highlighting Insert Image Insert an existing Attachment or upload a new File... Create Link   Unordered List Ordered List   Left Justify Center Justify Right Justify   Outdent Indent   More BBCode Tags
Font Color Font Size
Security Image:
Enter The Letters From The Security Image:
  Preview Post Cancel

Last 10 Posts (In reverse order)
Paul Rayman Posted: Tuesday, February 12, 2019 4:59:00 AM(UTC)
 
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#post1578


PdfAnnotation 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
paleise Posted: Monday, February 11, 2019 6:26:36 AM(UTC)
 
Hi,
is it possible to set a watermark in pdf document on runtime?

Thanks for your time!

Regards
Peter