Hi,
We upgraded to latest version of EO PDF 2019 for usage in azure web app.
Most of the times the component works but it fails sometimes with following exception when there are multiple requests concurrently.
Here is the code in question that fails.
Code: C#
EO.Pdf.Runtime.AddLicense(pdfParams.Key);
//HtmlToPdf.CacheFolder = pdfParams.CacheFolderPath;
PdfDocument doc = new PdfDocument();
var htmltopdfOptions = new HtmlToPdfOptions();
htmltopdfOptions.MinLoadWaitTime = pdfParams.MinLoadWaitTime;
htmltopdfOptions.AdditionalHeaders = pdfParams.CustomHeader;
htmltopdfOptions.HeaderHtmlFormat = pdfParams.Header ?? "PDF converted from {url}<hr />";
htmltopdfOptions.FooterHtmlFormat = pdfParams.Footer ?? @"<div style=""text-align:right;margin-right:5px;""><span style=""font-family:Arial,Verdana;font-size:9px;"">" + DateTime.Now.ToShortDateString() + @" | Page {page_number} of {total_pages}</span></div>";
htmltopdfOptions.FooterHtmlPosition = pdfParams.FooterHtmlPostion;
htmltopdfOptions.OutputArea = pdfParams.OutputArea.IsEmpty ? new RectangleF(0.075f, 0.25f, 8.35f, 10f) : pdfParams.OutputArea;
htmltopdfOptions.NoCache = true;
htmltopdfOptions.AutoAdjustForDPI = true;
htmltopdfOptions.PageSize = new System.Drawing.SizeF(8.5f, 11f);
htmltopdfOptions.ZoomLevel = 1f;
htmltopdfOptions.InvisibleElementIds = pdfParams.HideItemIds ?? string.Empty;
htmltopdfOptions.AutoFitX = HtmlToPdfAutoFitMode.ScaleToFit;
htmltopdfOptions.MaxLoadWaitTime = 60000;//1 min = 60000 ms
htmltopdfOptions.NoLink = false;
if (pdfParams.IsRta)
htmltopdfOptions.TriggerMode = HtmlToPdfTriggerMode.Manual;
htmltopdfOptions.GeneratePageImages = true;
htmltopdfOptions.Cookies.Add(pdfParams.Cookies);
HtmlToPdf.ConvertUrl(pdfParams.Url, doc, htmltopdfOptions);
Exception>>>
System.Exception: HtmlToPdf.ConvertUrl failed
initializer for 'EO.Internal.ob' threw an exception. ---> System.ComponentModel.Win32Exception:
Insufficient system resources exist to complete the requested service"The type initializer for 'EO.Internal.ob' threw an exception." at EO.Internal.ob..ctor(at A_0, HtmlToPdfOptions A_1)\r\n at EO.Pdf.HtmlToPdfSession.a(HtmlToPdfOptions A_0)\r\n at EO.Pdf.HtmlToPdfSession..ctor(HtmlToPdfOptions A_0, HtmlToPdfSession A_1)\r\n at EO.Pdf.HtmlToPdf.b.a()\r\n at EO.Internal.aj9.a[a](aox A_0)\r\n at EO.Pdf.HtmlToPdf.ConvertUrl(String url, PdfDocument doc, HtmlToPdfOptions options)\r\n
Please let us know what should be changed so that we can get rid of the error.
Regards,
M