Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi All,

I want to append some text in existing pdf file which I have created before automatically on run time on button click.
I am using Itextsharper.
Please help me out in this.

Thanks
Anand
Posted
v2

You cant.. What you have to do is create a new pdf and merge it with the old one. But it's not complicated. Have a look at this post at Stackoverflow:

http://stackoverflow.com/questions/566899/is-there-a-straight-forward-way-to-append-one-pdf-doc-to-another-using-itextshar[^]
 
Share this answer
 
Try:
C#
Document doc = new Document( PageSize.A4, 50, 50, 50, 50 );
PdfWriter writer = PdfWriter.GetInstance( doc, new FileStream("test.pfd", FileMode.OpenOrCreate) );
doc.AddDocListener( writer );
doc.Open();

doc.Add( new Chunk("chunk", "This chunk a new text!"));
doc.Close();


Refer:
Using iTextSharp To Watermark/Write Text To Existing PDF's[^]
iTextSharp - Adding Text with Chunks, Phrases and Paragraphs[^]
How to use iTextSharp .NET PDF library to insert text and image in an existing PDF form templa[^]
 
Share this answer
 

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