Using itextsharp to generate pdf from asp.net

Discussion in 'ASP .Net' started by =?Utf-8?B?U2Vhbg==?=, Feb 10, 2004.

  1. 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
    =?Utf-8?B?U2Vhbg==?=, Feb 10, 2004
    #1
    1. Advertising

  2. 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.
    =?Utf-8?B?U3VyZXNo?=, Feb 10, 2004
    #2
    1. Advertising

  3. =?Utf-8?B?U2Vhbg==?=

    putty511

    Joined:
    Oct 22, 2007
    Messages:
    1
    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
    putty511, Oct 22, 2007
    #3
  4. =?Utf-8?B?U2Vhbg==?=

    roselin123

    Joined:
    Jun 19, 2008
    Messages:
    2

    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
    roselin123, Jun 19, 2008
    #4
  5. =?Utf-8?B?U2Vhbg==?=

    roselin123

    Joined:
    Jun 19, 2008
    Messages:
    2

    just for info i am using iTextSharp.
    roselin123, Jun 19, 2008
    #5
  6. =?Utf-8?B?U2Vhbg==?=

    mfreidge

    Joined:
    Oct 3, 2006
    Messages:
    3
    Check the html file

    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/archive/2005/11/13/59943.aspx#393262) has a lot of interesting comments,

    including suggestion to use HTML Agility Pack.
    mfreidge, Jul 16, 2008
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nique
    Replies:
    0
    Views:
    798
    Nique
    Aug 17, 2004
  2. Patrick Olurotimi Ige

    using itextsharp assembly with asp.net?

    Patrick Olurotimi Ige, Mar 23, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    1,551
    Brian Munroe
    Mar 23, 2005
  3. guoqi zheng
    Replies:
    4
    Views:
    12,148
    Levitikon
    Oct 13, 2011
  4. Neven Klofutar

    Creating PDF in ASP.NET - iTextSharp

    Neven Klofutar, May 10, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    912
    Neven Klofutar
    May 10, 2007
  5. Replies:
    5
    Views:
    1,012
Loading...

Share This Page