Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", "attachment;filename=VisitosFoodBill_BillNo-" + Tranid + ".pdf"); Response.Cache.SetCacheability(HttpCacheability.NoCache); StringWriter stringWriter = new StringWriter(); HtmlTextWriter htmlTextWriter = new HtmlTextWriter(stringWriter); print.RenderControl(htmlTextWriter); StringReader stringReader = new StringReader(stringWriter.ToString()); Document Doc = new Document(new RectangleReadOnly(550, (i*20)+480), 10f, 10f, 10f, 10f); HTMLWorker htmlparser = new HTMLWorker(Doc); PdfWriter.GetInstance(Doc, Response.OutputStream); Doc.Open(); htmlparser.Parse(stringReader); Doc.Close(); Response.Write(Doc); Response.End();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)