I am trying to create a PDF file by using EVOHTMLTOPDF. But the pdf generated is wrong and the contents has a font size so small that i cant even read it.
This is the current code I use inside a webservice
HtmlToPdfConverter htmlToPdfConverter = new HtmlToPdfConverter();
htmlToPdfConverter.LicenseKey = "4W9+bn19bn5ue2B+bn1/YH98YHd3d3c=";
htmlToPdfConverter.HtmlViewerWidth = int.Parse("1024");
htmlToPdfConverter.PdfDocumentOptions.PdfPageSize = EvoPdf.PdfPageSize.Letter;
htmlToPdfConverter.PdfDocumentOptions.PdfPageOrientation = EvoPdf.PdfPageOrientation.Portrait;
htmlToPdfConverter.PdfDocumentOptions.TopMargin = 15f;
htmlToPdfConverter.PdfDocumentOptions.RightMargin = 15f;
htmlToPdfConverter.PdfDocumentOptions.BottomMargin = 15f;
htmlToPdfConverter.PdfDocumentOptions.LeftMargin = 15f;
byte[] outPdfBuffer = null;
outPdfBuffer = htmlToPdfConverter.ConvertHtml(DocContent, baseUrl);
HttpContext.Current.Response.ContentType = "application/pdf";
HttpContext.Current.Response.AddHeader("content-disposition", "attachment; filename=" + filename);
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
File.WriteAllBytes(sourcepath, outPdfBuffer);
I have also attached a screenshot
Some time i get this error which reads "PDF is too big"
Please anybody provide a solution as i want to create a pdf and download the pdf to the users computer.