Click here to Skip to main content
15,884,986 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Kindly assist me with code to set the absolute position of a phrase in itextsharp pdfdoc.
Posted
Comments
DamithSL 4-Dec-14 9:00am    
what is the programming language you are using?

1 solution

I am using C#. Thanks for caring. I have figured it out and it's resolved. I wanted to add a header to every PDF page created using itextsharp.

The solution is to insert your header before opening the document soon after creating the instance as shown below:
C#
using (PdfWriter writer = PdfWriter.GetInstance(doc, fs))
                {
                    //now inserting header
                    writer.PageEvent = new Header();

                    // end of header  
                  // Step 4: Openning the Document
                    doc.Open();
.
.
.
.
.
}
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900