Florence Blogspot about asp.net tutorials and web design and web development

Sunday, November 23, 2008

Generating pdf report using asp.net

PDF analysis by Florence.D



I have found some free components for generating pdf report using asp.net

iTextSharp.dll

ghtml2Pdf.exe

PDFSharp.dll

ApacheFop.net.dll

But I found some difficulty in the above components :

iTextSharp.dll:

In iTextSharp,

we can use 2 methods here

By passing the whole html script as string

by create a table in the code behind.

Our requirement is to generate the 1000 lines of html script into pdf.

So it is high risk to pass the 1000 lines of html script into string and also in the code behind it is not possible to create a each table in the code behind because every time the script generated may vary..
Only we can create a simple pdf not complex html scripts.

We cannot write the 1000 lines of html script into iTextSharp.dll.

ghtml2Pdf.exe:
Here we are using the exe component to generate the pdf file by passing the html file.
We have to generate the html file first and then pass that file into ghtml2Pdf.exe.
It is high riskable in the dotnet framework. Morever the we cannot use this in our whole servers.
It has the rights to work in only limited number of computers.

PDFSharp.dll

Here again we cannot use the html scripts to generate the pdf.
We have to create our own design in the codebehind. Again the same problem that every time the design or the html script may vary according to the report generated.
ApacheFop.net.dll
This is the good method to generate the pdf in dotnet using java classes.
Also we need vjslib.dll to work with the Java classess.
The process is some wat critical.
First we have to create a xml file to store the datas needed.
Then we have to create a design pattern like stylesheet using xsl.
After creating the xml and xsl, we have to transform these two and need to generate the fo file ie Formatted object file.
After the fo file created , we can generate the pdf from the fo file.
This is the structure.
But this requires some amount of time.
Using Java:
http://www.javaworld.com/javaworld/jw-04-2006/jw-0410-html.html
Here is the link where I read article for generating pdf using java.
It is a difficult process same as the above one.
Conclusion.

I have found lot of premium shareware components to generate the pdf from html.

It average costs from 600 to 1000 $.
The best is
www.winnovative-software.com
http://www.winnovative-software.com/Buy.aspx#redistributable
cost for redistributable pacakage is

INR 33938.41

Some other premium components
http://www.html-to-pdf.net/Pricing.aspx

Hope all got some knowledge anyone who started creating pdf.

Exporting WebPage to Excel using Javascript.

Refered from : Javascript

Export2Excelinjavascript

Search