I have an export service to convert html to pdf which works correctly. I changed it slightly to switch page sizes so the user can print envelopes and this causes the Failed to Convert error. If I don't change the page size then everything works properly.
public class ExportService
public MemoryStream CreatePdf( string html, bool envelope )
//Initialize HTML to PDF converter.
BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings();
blinkConverterSettings.PdfPageSize = PdfPageSize.A10;
blinkConverterSettings.ViewPortSize = new Size(800, 0);
blinkConverterSettings.PdfPageSize = PdfPageSize.Letter;
var m = new Syncfusion.Pdf.Graphics.PdfMargins
Left = 50,
Right = 50
blinkConverterSettings.Margin = m;
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter
ConverterSettings = blinkConverterSettings
//Convert URL to PDF.
var document = htmlConverter.Convert(html, "");
var stream = new MemoryStream();
We were able to reproduce the reported issue with provided details on our end. Currently, we are validating on this and we will update the further details shortly.
We have checked the reported issue with provided code snippet and the issue is reproduced only with A10 Page Size. The issue is occur due to the used margin values in the code snippet. The resolution of the A10 paper size is 74 x 105 px. In provided code snippet you have set the left and right value of the margin as 50. So the issue is happening due to margin value 100 (Added both left and right margin) is higher than the Page width 74. We can set the margin value upto 36 while setting the both right and left margin values to have some remaining space to render the content with A10 Pdf page size. So kindly use the margin values always less than the Pdf Page size to resolve this error.