Hi
When I try to convert a ppt to pdf I get the following message:
Value cannot be null. (Parameter 'fontFile')
I am using the following article - Guide
this is the full stack trace:
System.ArgumentNullException: Value cannot be null. (Parameter 'fontFile')
at Syncfusion.Pdf.Graphics.PdfTrueTypeFont.CreateFontInternal(Stream fontStream, PdfFontStyle style)
at Syncfusion.Pdf.Graphics.PdfTrueTypeFont..ctor(Stream fontStream, Single size, Boolean isUnicode, String metricsName, PdfFontStyle fontStyle)
at Syncfusion.PresentationRenderer.PresentationRendererHepler.MeasureString(Font font, String strValue, FontSettings fontSettings)
at Syncfusion.Presentation.RichText.Paragraph.MeasureString(String text, Font font, TextCapsType capsType)
at Syncfusion.Presentation.RichText.Paragraph.UpdateEmptyParagraphHeight(Single maxHeight, Single& maxAscent)
at Syncfusion.Presentation.RichText.Paragraph.Layout(RectangleF shapeBounds, Single& usedHeight, Boolean isWrap, Single& maxWidth)
at Syncfusion.Presentation.Drawing.Shape.Layout()
at Syncfusion.Presentation.SlideImplementation.Slide.Layout(Shape shape)
at Syncfusion.Presentation.SlideImplementation.Slide.LayoutGroupShape(Shape groupShape, List`1 groupShapeBounds, List`1 groupShapeRotations, List`1 groupShapeHorzFlips, List`1 groupShapeVertFlips)
at Syncfusion.Presentation.SlideImplementation.Slide.Layout(Shape shape)
at Syncfusion.Presentation.SlideImplementation.Slide.Layout()
at Syncfusion.PresentationToPdfConverter.PresentationToPdfConverter.DrawSlide(PdfDocument pdfDocument, ISlide slide, IPresentation presentation)
at Syncfusion.PresentationToPdfConverter.PresentationToPdfConverter.Convert(IPresentation presentation, PresentationToPdfConverterSettings settings)
at Syncfusion.PresentationToPdfConverter.PresentationToPdfConverter.Convert(IPresentation presentation)
Hi Niv Elad,
We have tried to reproduce the reported problem using
the simple pptx document, but it works properly on our end. For
your reference, we have attached the sample application which we used to
reproduce the reported issue and it can be downloaded from the below
link.
https://www.syncfusion.com/downloads/support/directtrac/general/ze/PresentationSample1889310905.zip
We suspect that the
reported issue might be due to fonts used in the PPTX document is missed in our
Production environment. Could you please ensure that all the fonts used in the PPTX
document are available in the production environment during PPTX to PDF
conversion. Using the SubstituteFont event, you can identify the missed font in the production environment during PPTX to PDF conversion. Please refer here to know more information about this.
If the fonts used in the PPTX document are not installed on your machine
means, please install the required font or set the alternate font (same
font file *.ttf or alternate font) using the code snippets in the below link:
https://help.syncfusion.com/file-formats/presentation/presentation-to-pdf#upload-font-stream
If you still facing issue means, could you please share with us the simple issue reproducible sample application, the input PPTX
document along with the font files to reproduce the exact issue at our end.
And also share the Syncfusion product version used. Thereby we will analyze further on the
reported problem and update you with the appropriate solution at the earliest.
Regards,
Lokesh B
Thanks.
I need to install a font package to my container