Adding watermark to PDF using C#

As you can easily view, you may simply add the celebration trainer to the PdfDocument specifying for which celebration the trainer must be actually triggered.

Necessary: the regulation I discussed is actually Java code, however the same training class, interfaces and techniques exist in C#, so it should not be a concern for you to adapt my instances.

Does anybody understand if there is a means to look for a watermark on a PDF document utilizing CSharp?

I can not find a method to accessibility this label so the code below looks for the real watermark content within the level. If you may not be making use of added PDF coatings I will suggest merely looking for/ OC within the content stream as well as not wasting time looking for your real watermark message.

Right now I would like to eliminate this watermark from my pdf. I considered iTextSharp yet was not capable to obtain any support. I also attempted to include watermark as coating and then erase the level but was certainly not able to erase the content of layer from the pdf..

I added a watermark on pdf using Pdfstamper.

PDFs use Optional Information Groups (OCG) to store objects as coatings. , if you include your watermark text to a coating you can rather effortlessly remove it later.

This probably depends on the PDF type as well as just how it was actually created. A lot of PDFs are simply concluded image files, and in these instances there is actually not a technique to perform this along with C#. The only means for this to work will be actually if you can easily detect a number of levels in the PDF as well as locate an image within some of those levels. Generally when a PDF is ‘posted’ these levels are smoothed.

I intend to perform this prior to including a brand-new one. In my case, I must add a brand new watermark if it wasn’t currently incorporated through someone, yet I don’t recognize how to check this using PdfReader training class.

There doesn’t appear to become a total working instance to make a content watermark on an existing PDF. The instances I have actually found online seem to be to create a brand new file or even the instances I’ve attempted perform certainly not operate.

I am actually going to provide you the advantage of the hesitation based upon the statement “I also made an effort to incorporate watermark as layer” as well as think that you are actually servicing information that you are making as well as certainly not making an effort to unwatermark a person else’s content.

It opens up an existing PDF as well as adds a watermark for every of the webpages, either content or image based.

Off, there is actually correct annotation watermarks and there’s only text message and/or images that you directly take into consideration to be actually a watermark. If you include a real watermark than you ought to simply be capable to walk each page’s/ ANNOTS thesaurus.

Area 1 produces a sample PDF for our company to function with. Area 2 generates a brand new PDF coming from the initial as well as administers a watermark to each page on a different layer. Part 3 makes an ultimate PDF from the 2nd but clears away the coating along with our watermark message.

Leave a Reply

Your email address will not be published. Required fields are marked *