AutoScale sets the watermark size depending on the word length and the page size. If this property is true, GroupDocs.Annotation ignores the FontSize property
To add a watermark annotation, follow these steps:
Instantiate the Annotator class. Specify the input document path or stream.
Instantiate the WatermarkAnnotation class. Specify the appropriate properties (position, page number, etc).
Call the Save method. Specify the output document path or stream.
The following code snippet shows demonstrates how to add WatermarkAnnotation to the document:
//Add watermark annotation to the document from local diskusing(Annotatorannotator=newAnnotator("input.pdf")){WatermarkAnnotationwatermark=newWatermarkAnnotation{Angle=75,Box=newRectangle(200,200,100,50),CreatedOn=DateTime.Now,Text="Watermark",FontColor=65535,FontSize=12,Message="This is watermark annotation",Opacity=0.7,AutoScale=true,HorizontalAlignment=HorizontalAlignment.Center,VerticalAlignment=VerticalAlignment.Center,Replies=newList<Reply>{newReply{Comment="First comment",RepliedOn=DateTime.Now},newReply{Comment="Second comment",RepliedOn=DateTime.Now}}};annotator.Add(watermark);annotator.Save("result.pdf");}
.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.