Welcome to the ASP.NET Core feedback portal. We’re happy you’re here! If you have feedback on how to improve the ASP.NET Core, we’d love to hear it!

  • Check out the features or bugs others have reported and vote on your favorites. Feedback will be prioritized based on popularity.
  • If you have feedback that’s not listed yet, submit your own.

Thanks for joining our community and helping improve Syncfusion products!

2
Votes

Problem: Skiasharp versions 1.68.1 or greater cause a null reference exception when Word to PDF conversion font substitution is used.

Verification: I have verified Skiasharp versions 1.59.3 - 1.68.0 do not cause an exception to be thrown.

DLL Version notes: Exception is thrown for any current Syncfusion version and for SkiaSharp 1.68.1 or greater. 

Syncfusion.DocIORenderer.Net.Core dll depends on SkiaSharp version 1.59.3, which is from Dec. 2017. The max working Skiasharp version, 1.68.0, is from Dec. 2018. We want to use the latest version of SkiaSharp to take advantage of its optimizations. Skiasharp 1.59.3 doesn't work in Azure for some reason. We haven't tested Skiasharp 1.68.0 in Azure yet.

Relevant code:

   WordDocument wordDocument = new WordDocument(docStream, Syncfusion.DocIO.FormatType.Docx);
    wordDocument.FontSettings.SubstituteFont += FontSettings_SubstituteFont;
    DocIORenderer render = new DocIORenderer();
    PdfDocument pdfDocument = render.ConvertToPDF(wordDocument);

Stack Trace:

   at Syncfusion.DocIORenderer.Drawing.FontExtension.get_Name()
   at Syncfusion.DocIO.DLS.FontSettings.GetFont(String fontName, Single fontSize, FontStyle fontStyle)
   at Syncfusion.DocToPdfConverter.Rendering.PDFDrawingContext.UpdateAlternateFont(WCharacterFormat charFormat, String fontName, Font& font)
   at Syncfusion.DocToPdfConverter.Rendering.PDFDrawingContext.GetFont(WTextRange txtRange, WCharacterFormat charFormat, String text)
   at Syncfusion.DocIO.DLS.WTextRange.CreateLayoutInfo()
   at Syncfusion.DocIO.DLS.WidgetBase.Syncfusion.Layouting.IWidget.get_LayoutInfo()
   at Syncfusion.Layouting.LCContainer.CreateNextChildContext()
   at Syncfusion.Layouting.LCContainer.Layout(RectangleF rect)
   at Syncfusion.Layouting.LCLineContainer.DoLayoutChild(LayoutContext childContext)
   at Syncfusion.Layouting.LCContainer.Layout(RectangleF rect)
   at Syncfusion.Layouting.LCContainer.DoLayoutChild(LayoutContext childContext)
   at Syncfusion.Layouting.LCContainer.Layout(RectangleF rect)
   at Syncfusion.Layouting.LCContainer.DoLayoutChild(LayoutContext childContext)
   at Syncfusion.Layouting.LCContainer.Layout(RectangleF rect)
   at Syncfusion.Layouting.Layouter.Layout(IWidgetContainer widget, ILayoutProcessHandler handler, IDrawingContext dc)
   at Syncfusion.DocIO.DLS.Rendering.DocumentLayouter.LayoutPages()
   at Syncfusion.DocIO.DLS.Rendering.DocumentLayouter.Layout(IWordDocument doc)
   at Syncfusion.DocIORenderer.DocIORenderer.ConvertToPDF(WordDocument wordDocument)

Notes

  1. I tested with prerelease versions of Syncfusion.DocIORenderer.Net.Core and Skiasharp and still got the exception.

Sample project attached