Thank you so much for suggestions.
Per your instruction :
https://www.essentialobjects.com/doc/pdf/htmltopdf/trigger.aspx, I applied condition below to all my js script files.
if (window.eoapi && eoapi.isEOPdf())
eoapi.convert();
and added set TriggerMode = DUAL. (When TriggerMode is set to Dual, the converter will still wait for page contents to be loaded. The conversion will start only after page contents are loaded and eoapi.convert() is called )
It worked well from localhost. When I deployed to server for scheduler Quartz to run desks atomically , some decks are return and sending emails message with PDF contents. other desks are getting Time Out message
Message: System.Exception: Time out expired before the page can be loaded.
at EO.Internal.srem.scxu(sqzc btk, String btl, String btm, String btn, Int32 bto, Int32 btp, String btq, Boolean btr)
at EO.Internal.srem.eedt(sqzc btc, String btd, String bte, String btf, Int32 btg, Int32 bth, String bti, Boolean btj)
at EO.Pdf.HtmlToPdfSession.eedt(sqzc yr, String ys, String yt, Int32 yu, Int32 yv, String yw, Boolean yx)
at EO.Pdf.HtmlToPdfSession.eedt(sqzc yy, String yz, String za, Boolean zb)
at EO.Pdf.HtmlToPdfSession.LoadUrl(String url)
at EO.Pdf.HtmlToPdf.pvwn.lhie()
at EO.Internal.srej.escb[a](gwpu`1 bsj)
at EO.Pdf.HtmlToPdf.ConvertUrl(String url, PdfDocument doc, HtmlToPdfOptions options)
here is my function call :
public Stream CreatePdf(IEnumerable<string> urls, IEnumerable<string> additionalHeaders)
{
const float verticalTopMargin = 0.2f, verticalBottomMargin = 0.5f;
var options = new HtmlToPdfOptions
{
// MinLoadWaitTime = 40000,
// MaxLoadWaitTime = 60000,
TriggerMode = HtmlToPdfTriggerMode.Dual,
AutoFitX = HtmlToPdfAutoFitMode.ScaleToFit,
PageSize = new SizeF(PdfPageSizes.A4.Height, PdfPageSizes.A4.Width),
OutputArea = new RectangleF(
0, verticalTopMargin,
PdfPageSizes.A4.Height,
PdfPageSizes.A4.Width - verticalTopMargin - verticalBottomMargin),
FooterHtmlFormat = "<span style='float: right;font-size: 12px;padding: 0;margin: 0 30px 0 0;'>Page {page_number}-{total_pages}</span>"
};
if (additionalHeaders.Any())
{
options.AdditionalHeaders = additionalHeaders.ToArray();
}
var pdfDocs = Enumerable.Empty<PdfDocument>();
foreach (var url in urls)
{
var pdfDocument = new PdfDocument { EmbedFont = false };
pdfDocument.Info.Author = "TMC Change Board";
pdfDocument.Info.CreationDate = DateTimeHelper.GetSeattleNow();
pdfDocument.Info.Creator = "TMC Change Board";
try
{
HtmlToPdf.ConvertUrl(url, pdfDocument, options);
pdfDocs = pdfDocs.Concat(pdfDocument.Yield());
}catch(Exception ex)
{
throw ex;
}
}
var pdfMerged = PdfDocument.Merge(pdfDocs.ToArray());
var stream = new MemoryStream(20480);
pdfMerged.Save(stream);
stream.Position = 0;
return stream;
}
Any suggestions are appreciated.
Thanks,
An