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!>
Thanks for joining our community and helping improve Syncfusion products!
We have a specific Word document that will cause an exception in our application when we try to convert it to PDF. A sample document illustrating the issue is attached. Please notice the hidden image behind the text.
The following code causes an exception when used with the attached document:
using var wordDocument = new WordDocument(stream, Syncfusion.DocIO.FormatType.Automatic);
using var render = new DocIORenderer();
using var pdfDocument = render.ConvertToPDF(wordDocument);
Exception details:
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=Syncfusion.DocIO.Portable
StackTrace:
at Syncfusion.DocIO.DLS.WParagraph.IsPreviousParagraphMarkIsHidden()
at Syncfusion.Layouting.LCLineContainer.IsNeedToUpdateIntersectingBounds(WParagraph currentParagraph)
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.LCContainer.DoLayoutChild(LayoutContext childContext)
at Syncfusion.Layouting.LCContainer.Layout(RectangleF rect)
at Syncfusion.Layouting.Layouter.Layout(IWidgetContainer widget, ILayoutProcessHandler handler, DrawingContext dc)
at Syncfusion.DocIO.DLS.Rendering.DocumentLayouter.LayoutPages()
at Syncfusion.DocIO.DLS.Rendering.DocumentLayouter.Layout(IWordDocument doc)
at Syncfusion.DocIORenderer.DocIORenderer.ConvertToPDF(WordDocument wordDocument)