Convert from html to pdf

  •  01-09-2009, 12:18 PM

    Convert from html to pdf

    Uri uri = new Uri("http://localhost:1611/arc_admin/Demo.aspx?pageID=1");

    MemoryStream x = new MemoryStream();

    CuteEditor.Convertor.PDF.HTML2PDF html2pdf = new CuteEditor.Convertor.PDF.HTML2PDF(uri);


    //CuteEditor.Convertor.PDF.HTML2PDF dd = new HTML2PDF();

    This code is working fine to convert from html to pdf but i have a probelm . my problem is my pdf page be without CSS Style
    i trying to but styel in link <link or <style>
    but they didn't work how i can convert html to pdf and my pdf page look exactly like my html page

    string
    FileName = ConfigurationManager.AppSettings["PdfFiles"].ToString() + "\\" + "WebPage" + Request.QueryString["WebPageid"].ToString() + ".pdf";

    html2pdf.Render();

    html2pdf.Save(x);

    html2pdf.Save(FileName);

    HttpResponse resp = HttpContext.Current.Response;

    resp.ContentType = "application / pdf";

    resp.AddHeader("Content-Disposition", "attachment; filename = " + Server.MapPath("Uploads\\CssFiles\\Conversion.pdf"));

    resp.BinaryWrite(x.GetBuffer());

    resp.End();

View Complete Thread