Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Using itextsharp to generate pdf from asp.net

Reply
Thread Tools

Using itextsharp to generate pdf from asp.net

 
 
=?Utf-8?B?U2Vhbg==?=
Guest
Posts: n/a
 
      02-10-2004
Hi,

I just started reading on http://itextsharp.sourceforge.net/tutorial/index.html and it seems like brillant.

I would just like to know, has anyone worked in exporting a datagrid in pdf format.

My objective is to pick a datagrid up and convert that into pdf format

I really appreciate the time and efforts put to help programmers by these newsgroups, they are really great

Thank Yo

Sean
 
Reply With Quote
 
 
 
 
=?Utf-8?B?U3VyZXNo?=
Guest
Posts: n/a
 
      02-10-2004
Yes, we have a guy at our company experimenting with this product now. So far from what I've been hearing from him is that it's really good. Best of all it's in process dll that can be easily used with .NET

I don't think it can convert datagrid as it is though. But it does convert html files into pdf. So you probably have to convert an html page with the datagrid in it

Suresh.
 
Reply With Quote
 
 
 
 
putty511 putty511 is offline
Junior Member
Join Date: Oct 2007
Posts: 2
 
      10-22-2007
Hello Mr.Suresh,

I need to convert a html table into pdf. But I am unable to do this. I get an error -- a blank pdf file is getting created.There is no content in it,

Can u please help me out in this regard, It is very urgent and hence I would be very thankful for an early reply
 
Reply With Quote
 
roselin123 roselin123 is offline
Junior Member
Join Date: Jun 2008
Posts: 2
 
      06-19-2008
Quote:
Originally Posted by putty511
Hello Mr.Suresh,

I need to convert a html table into pdf. But I am unable to do this. I get an error -- a blank pdf file is getting created.There is no content in it,

Can u please help me out in this regard, It is very urgent and hence I would be very thankful for an early reply

Hi all


I am using the code below to generate a pdf file from an html file.I dont get any error in this code but the pdf file generated from this is blank/empty.
I hv tried so many times but no help.
Document test =new Document();
try
{
PdfWriter.GetInstance(test, new FileStream(Server.MapPath("test.pdf"), System.IO.FileMode.Create));

HtmlParser.Parse(test, Server.MapPath("test.html"));
}

}
catch (Exception err)
{
Response.Write(err.StackTrace);
Response.Write(err.Message);
}
Response.Redirect("http://localhost/WebRA/test.pdf");

pls help asap.its urgent.
thanx
 
Reply With Quote
 
roselin123 roselin123 is offline
Junior Member
Join Date: Jun 2008
Posts: 2
 
      06-19-2008
Quote:
Originally Posted by roselin123
Hi all


I am using the code below to generate a pdf file from an html file.I dont get any error in this code but the pdf file generated from this is blank/empty.
I hv tried so many times but no help.
Document test =new Document();
try
{
PdfWriter.GetInstance(test, new FileStream(Server.MapPath("test.pdf"), System.IO.FileMode.Create));

HtmlParser.Parse(test, Server.MapPath("test.html"));
}

}
catch (Exception err)
{
Response.Write(err.StackTrace);
Response.Write(err.Message);
}
Response.Redirect("http://localhost/WebRA/test.pdf");

pls help asap.its urgent.
thanx

just for info i am using iTextSharp.
 
Reply With Quote
 
mfreidge mfreidge is offline
Junior Member
Join Date: Oct 2006
Posts: 3
 
      07-16-2008
HtmlParser.Parse does NOT throw any error , but the pdf file generated from this could be blank/empty.

Debug output shows the messages from parser, if Html file has invalid structure.


The post of Creating pdf in .NET from html (http://geekswithblogs.net/casualjim/...43.aspx#393262) has a lot of interesting comments,

including suggestion to use HTML Agility Pack.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
itextsharp pdf generation, insert image header. guoqi zheng ASP .Net 4 10-13-2011 05:47 PM
Pdf generation by iTextSharp library Viswagreypad Software 2 10-24-2007 06:55 AM
Problem sending PDF as stream using iTextSharp antonyliu2002@yahoo.com ASP .Net 5 07-11-2007 08:12 PM
Creating PDF in ASP.NET - iTextSharp Neven Klofutar ASP .Net 1 05-10-2007 09:42 PM
Using iTextSharp for PDF Creation... Nique ASP .Net 0 08-17-2004 10:23 AM



Advertisments