Hence the issue that I must had written. It is note applicable to the old asp.net. Also pdfsharp is "free" with exceptions if I am not mistaken. Hence I used HtmlRenderer.PdfSharp.
Funny thing the project is not in codeplex anymore and I could only find 2-3 examples anywhere.Code:string html = File.ReadAllText("C:\\zzzzzasppdf\\1.html"); PdfSharp.Pdf.PdfDocument pdf1 = TheArtOfDev.HtmlRenderer.PdfSharp.PdfGenerator.GeneratePdf(html, PdfSharp.PageSize.Letter); pdf1.Save("C:\\zzzzzasppdf\\1.pdf"); PdfSharp.Pdf.PdfDocument x = new PdfSharp.Pdf.PdfDocument(); Byte[] res = null; using (MemoryStream ms = new MemoryStream()) { var pdf = TheArtOfDev.HtmlRenderer.PdfSharp.PdfGenerator.GeneratePdf("C:\\zzzzzasppdf\\1.html", PdfSharp.PageSize.A4); pdf.Save(ms); res = ms.ToArray(); }
Nevertheless we decided to just show an HTML page on browser that the user will do a print-as , and create the pdf there.
If anything changes I will come back.
Thanks




Reply With Quote