Image watermark added in the PDF file Remove a watermark from a PDF using C# DrawImage(image, new PointF(0, 0)) įileStream stream = new FileStream("output.pdf", FileMode.Create) Įxecute this code example to get an image watermarked PDF document like the following screenshot. PdfImage image = new PdfBitmap(imageStream) PdfLoadedDocument loadedDocument = new PdfLoadedDocument(docStream) įileStream imageStream = new FileStream(“Image.jpg”, FileMode.Open, FileAccess.Read) ![]() The following code example adds an image watermark in a PDF document using C#. Add the watermark annotation to the annotation collection of the page.Draw the image on the graphics of the watermark instance using the DrawImage method.Load the image from a file to the PdfBitmap object.Customize the size, location, and opacity of the watermark instance.Create an instance of the PdfWatermarkAnnotation class.Then, get the page reference (where you want to include the watermark image) in the PdfLoadedPage object.Image watermarks can be useful for protecting your intellectual property, establishing your brand identity, adding security features to your documents, and indicating confidentiality.įollow these steps to add an image watermark to a PDF file using the Syncfusion PDF Library: Text watermark added in a PDF file Add image watermark to a PDF using C# ![]() DrawString("Imported using Essential PDF", new PdfStandardFont(PdfFontFamily.Helvetica, 20), PdfBrushes.Red, new RectangleF(50, 50, 250, 50), new PdfStringFormat(PdfTextAlignment.Center, PdfVerticalAlignment.Middle)) įileStream stream = new FileStream("Output.pdf", FileMode.Create) Įxecute this code example to get a text watermarked PDF like the following screenshot. PdfWatermarkAnnotation watermark = new PdfWatermarkAnnotation(new RectangleF(100, 300, 400, 400)) PdfLoadedPage lpage = loadedDocument.Pages as PdfLoadedPage PdfLoadedDocument loadedDocument = new PdfLoadedDocument(inputStream) The following code example adds a text watermark in a PDF document using C#. Finally, save the PDF file using the Save method.Add the watermark annotation to the annotations collection.Include the watermark text using the DrawString method.Create an instance of the PdfWatermarkAnnotation class and customize the location, size, and opacity. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |