Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

Watermark

$
0
0

I am inserting a Watermark into a PDF.  The watermark is not visible but the area can be hightlighted and adobe knows the text.

 

public void InsertWatermark(string pdfInputFile, string pdfOutputFile, string textToInsert) { //open document var pdfDoc = new Document(pdfInputFile); var fileStamp = new PdfFileStamp(); fileStamp.BindPdf(pdfDoc); //create stamp var stamp = new Aspose.Pdf.Facades.Stamp(); //get current time and make a string from it System.DateTime currentTime = System.DateTime.Now; stamp.BindLogo(new FormattedText(textToInsert, System.Drawing.Color.Black, System.Drawing.Color.Yellow, Aspose.Pdf.Facades.FontStyle.Helvetica, EncodingType.Winansi, true, 44)); //Set Origion stamp.SetOrigin(100, 600); //Set as Background stamp.IsBackground = true; //Set Opacity stamp.Opacity = .3F; //add stamp to PDF file fileStamp.AddStamp(stamp); //save updated PDF file fileStamp.Save(pdfOutputFile); fileStamp.Close(); }

Viewing all articles
Browse latest Browse all 3131

Trending Articles