Solved

ItextSharp for creating PDF from asp.net

Posted on 2014-02-10
2
715 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
Comment Utility
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 74

Accepted Solution

by:
käµfm³d   👽 earned 210 total points
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

*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 …
In a previous article published here at Experts Exchange, Signature Image with Transparent Background (http://www.experts-exchange.com/Web_Development/Document_Imaging/A_12380-Signature-Image-with-Transparent-Background.html), I explained how to cre…
In this first video of the three-part Xpdf series, we introduce and describe Xpdf, a library containing nine command line utilities that perform various functions on PDF files. We show where the library is located and how to download it, discuss its…
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 …

763 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

10 Experts available now in Live!

Get 1:1 Help Now