Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
protected void Submitbtn_Click(object sender, EventArgs e)
{
    string attachment = "attachment; filename=" + "abc" + ".pdf";
    Response.ClearContent();
    Response.AddHeader("content-disposition", attachment);
    Response.ContentType = "application/pdf";
    StringWriter s_tw = new StringWriter();
    HtmlTextWriter h_textw = new HtmlTextWriter(s_tw);
    h_textw.AddStyleAttribute("font-size", "7pt");
    h_textw.AddStyleAttribute("color", "Black");
    panelform.RenderControl(h_textw);//Name of the Panel
    Document doc = new Document();
    doc = new Document(PageSize.A4, 5, 5, 15, 5);
    FontFactory.GetFont("Verdana", 80);
    PdfWriter.GetInstance(doc, Response.OutputStream);
    doc.Open();
    StringReader s_tr = new StringReader(s_tw.ToString());
    HTMLWorker html_worker = new HTMLWorker(doc);
    html_worker.Parse(s_tr);
    doc.Close();
    Response.Write(doc);
}
public override void VerifyRenderingInServerForm(Control control)
{
}

error shown is
font too small
at
C#
html_worker.Parse(s_tr);
Posted
Updated 28-Jul-14 2:08am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900