How do I include a watermark (text or image) in an existing pdf in c#?
By Itextsharp i am receiving the watermark with all the webpages however through utilizing GetUnderContent the watermark is actually concealing on the material as well as on the last page it is actually uncovering. Through Utilizing GetOverContent it is actually displaying in all the webpages nonetheless over the web content the material is actually concealing
Possibly the web pages that do not show the watermark are actually opaque and/or perhaps they have a different correlative unit (the lower-left edge doesn’t continuously have the correlative 0, 0). Performed you inspect out The finest methods to add a watermark to a page along with a cloudy image?
I really want the watermark featured for all webpages of the pdf.
I possess the capability to accomplish this after the report has actually been actually generated using a PdfStamper. This shows up to feature re-opening the document reviewing it and after that generating a brand new file along with the watermark on each page.
The code listed below includes both a text message watermark and a straightforward image watermark to an existing pdf.
I sought with itextsharp however the watermark is actually featuring in only last page of the pdf.
I am actually trying to programmatically establish a variety of PDF data with a watermark on each page using itextsharp (a C# port of Coffee’s itext).
Is there a strategy of performing this throughout documents growth?
After digging in to it I discovered the best way was actually to include the watermark per page as it was developed. To perform this I carried and also cultivated a new training class out the IPdfPageEvent user interface as follows:
If your usage situation is create a brand-new PDF as well as incorporate a watermark, you may favor the one-pass choice offered through Tim because it uses a lot less sources. Your alternative is appropriate if your use instance is take an existing PDF as well as watermark it.
( You don’t demand to carry out it while building the PDF.).
It appears benefiting each garden and portrait and it probably jobs for files with mixed alignments.
This will definitely add a watermark on all web pages of a PDF document that is provided as a byte selection.