Solved

ItextSharp for creating PDF from asp.net

Posted on 2014-02-10
2
747 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

*Adobe Acrobat 9 was used for this article. Particular steps may vary depending on software versions. 1. Create a framework of your form in Word, leaving space where you’d ultimately like the Adobe fields to appear.  (Note: I use the blank lines …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

756 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