Now I want to add water mark to this file. I found the code for adding watermark to existing pdf file. instead I want to create and add watermark to. First off, yes, I know there are other tutorials on how to watermark PDF’s with iTextSharp. Unfortunately none of them showed me exactly what I. Second Edition · iText 5 examples · iText 5 manipulating an existing PDF; Watermark examples How to add a watermark to a page with an opaque image ?.

Author: Nijas Daikasa
Country: Spain
Language: English (Spanish)
Genre: Technology
Published (Last): 28 February 2004
Pages: 320
PDF File Size: 10.51 Mb
ePub File Size: 19.38 Mb
ISBN: 558-6-37212-653-4
Downloads: 52402
Price: Free* [*Free Regsitration Required]
Uploader: Moktilar

So I spent some spare time writing some code to do it using the free iTextSharp library, iteztsharp here it is, the 2 subroutines for adding an image and text as the watermark on each page of a pdf file. All you have to do is changing this line: If watermarkFont Is Nothing Then. Dim gstate As iTextSharp. Same considerations for the transparent watermark.

Net] Add watermark to existing Pdf file using iTextSharp stanav What about a watermark that shows up only when printing? Articles Quick Answers Messages Use my saved content filters. Better understand the signs that your business has outgrown its current database. This has been tested before posting. BTW, I have question if this is possible, can the watermark appear behind page? What I want to do is use the Agaramond-Pro font for the text and the data that I’m going to insert has italic data in between of the normal text?


You’ll note there are 2 functions, with the first functions calling the second function. GetOverContent i To this Code: How to add watermark image in pdf file. The code below adds both a text watermark and a transparent image watermark to an existing pdf.

If your page contains mostly text, it is recommended to put the water mark on the under content of the page instead. How to add watermark in pdf using asp.

Thanks to noter also for converting the code to C. Stack Overflow works best with JavaScript enabled. Each element in your string array will be rendered as a line in the watermark. Net] Add watermark to existing Pdf file using iTextSharp This has been soooo helpful in a project that I’ve been working on.

Just a solution to a problem – If a solution you present has ittextsharp severe side effects, you should mention them in your answer. Dim img As iTextSharp. Here is some example for applying watermark in pdf.

By Itextsharp i am getting the watermark in all the pages but by using GetUnderContent the watermark is hiding on the content and on the last page it is showing. Even if not replying adr request, at watefmark I thank you for posting your code that got me existng. Dim rect As iTextSharp. Insults are not welcome. Sign up or log in Sign up using Google. By Using GetOverContent it is showing in all the pages but above the content the content is hiding.

Dim stamper As iTextSharp.

Results 1 to 34 of If you don’t know how to do that, post a question in VB. Post as a guest Name. I was looking for this solution since a long time. By using our site, you acknowledge that you have read and understand our Itwxtsharp PolicyPrivacy Policyand our Terms of Service.


Sign up using Email and Password. Results 1 to 34 of 34 Thread: Treat my content as plain text, not as HTML.

Add a Diagonal Watermark to PDF in C# – Tallcomponents

You have to use itextsharp. Done it by myself. When you show a non-watermarked pdf to the user, the user can just print that version using the print button in Adobe Reader or save it to their computer instead of clicking on your print button to print a watermarked pdf.

I tried with itextsharp but the watermark is displaying in only last page of the pdf. The default opacity is 0. Net] Existinh watermark to existing Pdf file using iTextSharp This is excellent code and this is what i needed. This email iteextsharp in use.

Forums – C# Corner

Having said that, you can simply create a new temp file, and wstermark done, you delete the original and rename the temp file to the original’s name. I am in the process of building 10 more nice applications that can be of use to lot of people.

Top Rated Most Recent. This is excellent code and this is what i needed. Do you need your password?