How to watermark the fillable PDFs without losing form filling ability in Acrobat Reader?
You can apply watermark in the existing .NET PDF document without losing the Form fill ability in Acrobat reader. You can achieve this by importing loaded PDF document (PdfLoadedDocument) to a new PDF document (PdfDocument) and apply the Watermark. Refer to the following code example.
C#
//Load the Existing PDF document PdfLoadedDocument document = new PdfLoadedDocument("../../Form.pdf"); //Initialize new PDF document PdfDocument doc = new PdfDocument(); //Import Loaded document to new PDF document doc.ImportPage(document, 0); //Initialize Font Font f = new System.Drawing.Font("Times new roman", 36, FontStyle.Regular); PdfFont font = new PdfTrueTypeFont(f, true); //Getting graphics from 1st page PdfGraphics g = doc.Pages[0].Graphics; //Saving current graphics state PdfGraphicsState gs = g.Save(); //Set transparency for graphics g.SetTransparency(0.25F); //Watermarking in the Graphics g.DrawString("Syncfusion Watermark", font, PdfPens.Red, PdfBrushes.Red, new PointF(50, 100)); //Restoring saved graphics state g.Restore(gs); // Save and close the document. doc.Save("Sample.pdf");
Refer to the following sample link.
Note:
Starting with v16.2.0.x, if you reference Syncfusion® assemblies from the trial setup or the NuGet feed, include a license key in your projects. Refer to the link to learn about generating and registering the Syncfusion® license key in your application to use the components without a trial message.
Conclusion:
I hope you enjoyed learning about how to watermark the fillable PDFs without losing form filling ability in Acrobat Reader.
You can refer to our Flutter PDF feature tour page to learn about its other groundbreaking features and documentation, and how to quickly get started with configuration specifications. You can also explore our Flutter PDF Flutter PDF examples to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to explore our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums or feedback portal. We are always happy to assist you!