Solved

ItextSharp for creating PDF from asp.net

Posted on 2014-02-10
2
734 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

This article focuses on how to remove password security from multiple PDF files by Adobe Acrobat program. Sometimes it is essential to access the stored data items and to print, edit as well as copy content from Portable Document Format files in abs…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
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 seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

776 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