Click here to Skip to main content
15,907,233 members

Comments by ArvindTomar (Top 16 by date)

ArvindTomar 21-Aug-23 14:56pm View    
it is not provide accuracy if any other method is there or any code link so please tell me.
ArvindTomar 12-Dec-18 6:45am View    
after long R & D Finaly i Got the answer i use ironpdf.dll for control the height and with of grid and page

Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 10f, 0f);
HTMLWorker htmlparser = new HTMLWorker(pdfDoc);
PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
string appPath = HttpContext.Current.Request.ApplicationPath;
pdfDoc.Open();
Panel pnl;
StringWriter sw = new StringWriter();
for (int i = 1; i <= 5; i++)
{
string Id = "pnldata" + i;

pnl = (Panel)FindControl(Id);

using (HtmlTextWriter hw = new HtmlTextWriter(sw))
{
pdfDoc.SetPageSize(new Rectangle(595, 850));

htmlparser = new HTMLWorker(pdfDoc);



pdfDoc.NewPage();

pnl.RenderControl(hw);

StringReader sr = new StringReader(sw.ToString());
htmlparser.Parse(sr);

}
}
var Renderer = new HtmlToPdf();

string html1 = "" + sw.ToString() + "";
StringBuilder html = new StringBuilder(html1);

Renderer.PrintOptions.PaperSize = PdfPrintOptions.PdfPaperSize.A4;
Renderer.PrintOptions.PaperOrientation = PdfPrintOptions.PdfPaperOrientation.Portrait;
// Renderer.PrintOptions.Header = new SimpleHeaderFooter() { CenterText = "Iron PDf C# Html to PDF Example", FontSize = 10 };
// Renderer.PrintOptions.Footer = new HtmlHeaderFooter() { HtmlFragment = "page {page} of {total-pages}" };
var PDF = Renderer.RenderHtmlAsPdf(html1);
string path = Server.MapPath(appPath + "\\files\\" + "DeliveryChalan" + FileName + ".pdf");
PDF.SaveAs(path);
ArvindTomar 11-May-18 7:59am View    
Session.Abandon method logout current session but i want to refresh all my application tab in browser when change session value on dropdown selected index changed
ArvindTomar 4-Jan-18 3:13am View    
I am using switch statement and around 700-800 cases in switch
how can i trace error in witch case have problem system show error on switch. it is working fine with source code but not working when i host site on IIS
ArvindTomar 3-Jan-18 9:53am View    
i have checked but debugger not go to particular case it show the
Error on switch "an unhandled exception of type 'system.stackoverflowexception' occurred in mscorlib.dll"