Is it Possible to Add a Watermark to a PDF File?

1 Answer 21 Views
Forum suggestions
david
Top achievements
Rank 1
david asked on 03 Jun 2024, 07:59 AM | edited on 03 Jun 2024, 08:32 AM

Yes, you can add watermarks to your PDF Files. Use the PDF Watermark application to recognize your PDFs as a logo, image, or text. The tool can watermark your PDF File at one time on every Page of the PDF file. The tool's Best feature is customized watermarks of your choice and some multiple-time increases of the opacity level from lighter to darker and darker to lighter. The tool permits enough flexibility in setting position to the top, left, right, center, and middle. The software is a user-friendly application that a non-technician can understand and operate without technical help. Download the tool today.


Matt
Top achievements
Rank 1
Iron
Iron
commented on 05 Jun 2024, 09:51 AM

There are several ways to watermark PDFs, both with free online tools and paid software.  For a quick solution, you might check out some of the free options available online.  Just be sure they're reputable sources.
Dess | Tech Support Engineer, Principal
Telerik team
commented on 06 Jun 2024, 08:25 AM

I would encourage you to download a free trial version of Telerik Document Processing Libraries and see whether it would meet the requirements you need to cover.

I have also prepared a sample code snippet demonstrating how to achieve watermarks over the pages in a PDF document:

        static void Main(string[] args)
        {
            string fileName = "sample.pdf";
            PdfFormatProvider provider = new PdfFormatProvider();
            RadFixedDocument document = provider.Import(File.ReadAllBytes(fileName));

            foreach (RadFixedPage page in document.Pages)
            {
                AddWatermarkText(page, "Watermark text!", 100);
            }

            string exportFileName = "testWatermarks.pdf";
            File.Delete(exportFileName);

            File.WriteAllBytes(exportFileName, new PdfFormatProvider().Export(document));
            ProcessStartInfo psi = new ProcessStartInfo()
            {
                FileName = exportFileName,
                UseShellExecute = true
            };
            Process.Start(psi);
        }

        private static void AddWatermarkText(RadFixedPage page, string text, byte transparency)
        {
            FixedContentEditor editor = new FixedContentEditor(page);

            Block block = new Block();
            block.TextProperties.FontSize = 80;
            block.TextProperties.TrySetFont(new FontFamily("Arial"), FontStyles.Normal, FontWeights.Bold);
            block.HorizontalAlignment = Telerik.Windows.Documents.Fixed.Model.Editing.Flow.HorizontalAlignment.Center;
            block.GraphicProperties.FillColor = new RgbColor(transparency, 255, 0, 0);
            block.InsertText(text);

            double angle = -45;
            editor.Position.Rotate(angle);
            editor.Position.Translate(0, page.Size.Width);
            editor.DrawBlock(block, new Size(page.Size.Width / Math.Abs(Math.Sin(angle)), double.MaxValue));
        }

I hope this information helps.

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 03 Jun 2024, 08:52 AM

Hi, David,

RadPdfProcessing allows you to create PDF documents from scratch without replying on any third-party dependencies. The following SDK example demonstrates a sample approach how to add a watermark to the PDF pages: Add Watermark. Please give it a try and see how it works for your scenario.

In case it is not applicable for the precise case, it would be greatly appreciated if you can provide more details about the exact goal that you are trying to achieve. Thus, we would get better understanding of the precise case and provide further assistance. Thank you in advance.

I hope you find this information helpful. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Forum suggestions
Asked by
david
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or