Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ItextSharp for creating PDF from asp.net

Posted on 2014-02-10
2
Medium Priority
?
804 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 840 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The Adobe PDF proprietary file format is recognized as secure and formulated. But these PDF files are also prone to corruption and any external threat like virus attacks, improper storage can hit PDF file integrity.This type of damages can make cruc…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
We often encounter PDF files that are pure images, that is, they do not have text characters, but instead contain only raster graphics. The most common causes of this are document scanning software and faxing software/services that create image-only…
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…

876 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