Aspose.Slides for .NET 24.2 Sometimes Crashes when Converting PPTX to PDF

I try to convert PPTX files to PDF File
During Save action

var ms = new MemoryStream(80 * 1024);
var so = new PdfOptions();
FPres.Save(ms, SaveFormat.Pdf, so);

I get sometimes. Not all presentations. This error:

presentation-writer crashed
The type initializer for 'Aspose.Slides. ’ threw an exception.

at Aspose.Slides. . (Aspose.Slides. , Aspose.Slides. , System.Drawing.Color , System.Drawing.Color , System.Drawing.PointF , System.String , Aspose.Slides.​​ ) [0x0004c] in :0
at Aspose.Slides. . (System.String , System.Drawing.PointF , Aspose.Slides. , Aspose.Slides. , Aspose.Slides.​​ ) [0x00066] in :0
at Aspose.Slides. . (System.String , System.Drawing.PointF , Aspose.Slides. , Aspose.Slides. , Aspose.Slides.​​ , Aspose.Slides. ) [0x0012f] in :0
at Aspose.Slides. .upqzcdlpzatszxu574jeeev2vfhxjqd9 (System.String , System.Drawing.RectangleF , Aspose.Slides.​​ , Aspose.Slides. ) [0x0005a] in :0
at Aspose.Slides. .upqzcdlpzatszxu574jeeev2vfhxjqd9 (System.String , System.Drawing.RectangleF , Aspose.Slides.​​ ) [0x00138] in :0
at Aspose.Slides. . (Aspose.Slides. , Aspose.Slides.Presentation , System.String[] , Aspose.Slides.​​ + ) [0x000e5] in :0
at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in :0
at Aspose.Slides. . (System.Object ) [0x00010] in :0
at Aspose.Slides. . (System.Reflection.MethodBase , System.Boolean ) [0x001d5] in :0
at Aspose.Slides. . (Aspose.Slides. , Aspose.Slides. ) [0x00014] in :0
at Aspose.Slides. . () [0x0004d] in :0
at Aspose.Slides. . (System.Boolean ) [0x0004c] in :0
at Aspose.Slides. . (System.Object ) [0x00010] in :0
at Aspose.Slides. . () [0x00015] in :0
at Aspose.Slides. . (System.Object , System.UInt32 ) [0x00151] in :0
at Aspose.Slides. . (System.Boolean ) [0x0005d] in :0
at Aspose.Slides. . () [0x00000] in :0
at Aspose.Slides. . (System.Object[] , System.Type[] , System.Type[] , System.Object[] ) [0x00093] in :0
at Aspose.Slides. . (System.IO.Stream , System.String , System.Object[] , System.Type[] , System.Type[] , System.Object[] ) [0x0000f] in :0
at Aspose.Slides. . (System.IO.Stream , System.String , System.Object[] ) [0x00000] in :0
at Aspose.Slides. . (System.IO.Stream , System.String , System.Object[] ) [0x00000] in :0
at Aspose.Slides. . (Aspose.Slides. ) [0x00019] in :0
at Aspose.Slides. . (Aspose.Slides. , System.Boolean , Aspose.Slides.ShapeFrame ) [0x00021] in :0
at Aspose.Slides. . (Aspose.Slides. , Aspose.Slides.IShapeFrame , Aspose.Slides. , System.Boolean , System.Boolean , Aspose.Slides.InterruptionToken ) [0x001e3] in :0
at Aspose.Slides. . (Aspose.Slides. , Aspose.Slides.IShapeFrame , Aspose.Slides. , Aspose.Slides. , Aspose.Slides.InterruptionToken ) [0x00000] in :0
at Aspose.Slides. . (Aspose.Slides. , Aspose.Slides.​ [,] , Aspose.Slides. , Aspose.Slides.InterruptionToken ) [0x0000e] in :0
at Aspose.Slides.Slide. (System.Boolean , Aspose.Slides.​ [,] , Aspose.Slides. , System.Collections.Generic.List`1[T] , Aspose.Slides.InterruptionToken ) [0x0005c] in :0
at Aspose.Slides.​​ . (Aspose.Slides.Presentation , System.IO.Stream , System.Int32[] , Aspose.Slides.Export.PdfOptions , Aspose.Slides.InterruptionToken ) [0x00291] in :0
at Aspose.Slides.​​ . (Aspose.Slides.Presentation , System.IO.Stream , Aspose.Slides.Export.PdfOptions , Aspose.Slides.InterruptionToken ) [0x00029] in :0
at Aspose.Slides.Presentation.Save (System.IO.Stream stream, Aspose.Slides.Export.SaveFormat format, Aspose.Slides.Export.ISaveOptions options) [0x00276] in :0

@Tivian_XI,
Thank you for contacting support.

To investigate the case and help you, we need more details. Please share the following files and information:

  • sample presentation file
  • code example that reproduces the exception
  • OS version on which the conversion was performed
  • .NET target platform in your app

This is my Dockerfile:

FROM mono:latest
RUN apt update && apt install --no-install-recommends --no-install-suggests -y \
  libfontconfig1 \
  libfreetype6 \
  mono-fastcgi-server4 \
  vim \
  mono-xsp4
RUN msbuild Application.sln -p:Configuration=Release /p:OutputPath=/app/www
CMD ["bash", "-c", "xsp4 --port=16523 -v --loglevels=All --nonstop"]

and this my code example

Presentation presentation = new Presentation(inputPath, loadOptions);
presentation.Save(outputPath, Aspose.Slides.Export.SaveFormat.Pdf, pdfOptions);

.NET Target is FRamework 4.7.2

@Tivian_XI,
Thank you for the additional information. I am working on the issue and will get back to you soon.

@Tivian_XI,
Unfortunately, I can’t reproduce the error you encountered without the presentation file. Could you please share a standalone minimal project with a sample presentation for this?