Posted by: Kaushal on: May 4, 2009
Here is another requirement (perhaps a common requirement!) I needed to implement in one of on-going project website application. I needed to generate a PDF file as output from the inputs entered by end-user in a form. On Completing the form, end-user should be able to download a PDF file of what they have given the inputs in the form.
I need to generate PDF file in a given format and force the download dialog to let the user save generated PDF save on their/client machine.
I tried searching any free
third party dlls which would help me to generate PDF files on-the-fly. Things I tried:
[1] Tried searching almost third party tools/dlls including Siberix PDF Library , PDF Vision .Net etc etc, which are having similar functionality. But not FREE
[2] Tried with iTextSharp – Tutorial and PDFsharp – Download PDFsharp Version 1.20 These dlls/libraries are totally free and really interesting to work with. All we need to do is define elements like HTML and add those elements to PDF document object which then finally generated as PDF document. But, this is the problem for me as I am having a huge PDF file needed to generate as output and it would required a loot of time to code for a document by placing line by line cells, TR and TD, Tables and background, Border colors, images etc. and most of all is annoying Texts to be placed in those elements with proper fonts, colors and padding/alignment.
At last after wasting time in googling and on free tools/libraries, I got an idea to create PDF on-the-fly. I was thinking of creating PDF files dynamically and I created it smoothly with out too much work and code.
This is how it goes: