Add/Remove water mark

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF Rasterizer for .NET (v1)  /  Add/Remove water mark

DynamicPDF Rasterizer for .NET (v1) Forum

 Jun 18 2014 1:55 AM
Using ceTe.DynamicPDF.Rasterizer, made a preview of existing pdf file. I need to Add/Remove water mark when i shown preview.

Here i read my pdf file and convert each page to Bitmap image, then add these image to Richtextbox. In background of my preview indicate "Dynamic pdf" water mark, How can i remove it?
 Jun 18 2014 10:10 AM
Posted by a ceTe Software moderator
Hello,

It is not possible to add any contents to the output image using DynamicPDF Rasterizer for .NET API. It allows you to create supported image files from PDFs.

If you would  like to add watermark to the output image then you will need to have the input PDF with the watermark in it. You can add watermark to the PDF using our another product DynamicPDF Merger for .NET. You can create TextArea object by adding watermark text and then add it to the TransparencyGroup by setting desired opacity to it. Then add this TransparencyGroup to PDF. Also if you would like to apply this watermark to whole PDF then you can use Template page element to do this. Below is the code sample to add watermark to the existing PDF using Merger API.

            PdfDocument pdf=new PdfDocument(@"C:\Temp\DocumentA.pdf");
            MergeDocument document = new MergeDocument();
            document.Append(pdf);
            //Code for adding watermark to the whole PDF.
            Template template = new Template();
            TransparencyGroup group = new TransparencyGroup(0.5F);
            TextArea area = new TextArea("Watermark Text", 200, 400, 200, 50);
            area.TextColor = RgbColor.Red;
            area.FontSize = 40;
            group.Add(area);
            template.Elements.Add(group);
            //Setting template to the document.
            document.Template = template;
            //Drawing the PDF into byte array.
            byte[] byteData = document.Draw();

            //Rasterizing the PDF byte array to image using Rasterizer API.
            InputPdf inputPdf = new InputPdf(byteData);
            PdfRasterizer rastObj = new PdfRasterizer(inputPdf);
            rastObj.Draw(@"C:\Temp\Test.bmp", ImageFormat.Bmp, ImageSize.Dpi150);

You can download fully functional evaluation edition of DynamicPDF Merger for .NET product from our website here.

In order to remove DynamicPDF watermark from the generated images, you will need to purchase a license for DynamicPDF Rasterizer for .NET product and apply the license key to your application.

Thanks,
ceTe Software Support Team.

All times are US Eastern Standard time. The time now is 4:04 AM.