Solved

ItextSharp for creating PDF from asp.net

Posted on 2014-02-10
2
723 Views
Last Modified: 2014-02-27
I have a web application in which I need to make pdf files and I am using Itextsharp dll for creating pdf files.

Now one way is I create the pdf at the runtime using C# code
Second way (if possible) I create a sort of template in pdf and use it every time just to replace values in few place holder inside the pdf.

As my pdf structure would be same and only few values will be changes based on which user is creating it.
Is it possible that I may create a pdf file template with place holders in it and use it at the run time and replace place holder with actual values.
I want to use this approach because by this I will not have to change my code if clients wants any changes in the pdf file layout.
I can simple changes the template and use it.
0
Comment
Question by:yadavdep
2 Comments
 
LVL 25

Expert Comment

by:Luis Pérez
ID: 39850101
If I'm not wrong, I think this is very difficult, because PDF format is non-editable by default, so as long as you are creating PDF from scratch you'll have no problems, but once the PDF is saved, you cannot open that PDF and modify it using ITextSharp.

What I would do is, if the PDFs are very similar, program a global routine to create the PDF passing only the parameters that apply to the replacements.

Hope that helps.
0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 210 total points
ID: 39850254
Have you considered making a PDF form? You would have fillable fields that you can programmatically fill with iTextSharp. I haven't done this myself, but there are tutorials on how to do such:

http://www.codeproject.com/Articles/23112/Fill-in-PDF-Form-Fields-using-the-Open-Source-iTex
http://www.4guysfromrolla.com/articles/030211-1.aspx
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Power PDF (http://www.nuance.com/for-business/document-imaging-and-scanning/power-pdf-converter/index.htm) is the newest product from the Document Imaging division of Nuance Communications (http://www.nuance.com/). It is available in two editions — …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In this second video of the Xpdf series, we discuss and demonstrate the PDFimages utility, which, in a single command, is able to extract all the images from a PDF file and save each one in a separate image file (PBM, PPM, or JPG). Download and inst…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

3 Experts available now in Live!

Get 1:1 Help Now