Hi SF,
I'm getting this exception when trying to use page breaks and/or print media in URL to PDF conversion using the Blink converter:
Message: Failed to convert webpage
StackTrace: at Syncfusion.HtmlConverter.BlinkConverter.ConvertToPdf(String url, PdfDocument& document)
at Syncfusion.HtmlConverter.BlinkConverter.<>c__DisplayClass161_0.<Convert>b__0()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
This is my converter's setup:
BlinkConverterSettings settings = new BlinkConverterSettings
{
//WebKitPath = @"/bin/QtBinaries/",
EnableJavaScript = true,
Orientation = orientation,
Margin = new PdfMargins { Top = 20, Bottom = 20, Left = 20, Right = 20 },
PdfPageSize = PdfPageSize.A4,
MediaType = MediaType.Print,
};
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink)
{
ConverterSettings = settings,
};
this.pdfDoc = htmlConverter.Convert(content);
I also have a bunch of HTML that converts just fine when I don't use media print or page breaks like this:
<p style="page-break-after: always;"></p>
Thanks in advance,