Hi,
I was following the tutorial here.
http://mvc.syncfusion.com/demos/web/presentation/pptxtopdf
After fixing some issues with the webformats mvc5 nugget.
I finished with some code like this
public void ConvertPPTToPDFWordPreview(string pptDocument, string pptDocumentName)
{
IPresentation presentation = Presentation.Open(MvcApplication.GetDocumentsDirectory() + "\\" + HttpUtility.UrlDecode(pptDocument));
presentation.ChartToImageConverter = new ChartToImageConverter();
presentation.ChartToImageConverter.ScalingMode = Syncfusion.OfficeChart.ScalingMode.Best;
PresentationToPdfConverterSettings settings = new PresentationToPdfConverterSettings();
settings.ShowHiddenSlides = true;
//Instance to create pdf document from presentation
PdfDocument doc = PresentationToPdfConverter.Convert(presentation, settings);
//Saves the pdf document
doc.Save(MvcApplication.GetCacheDirectory() + "\\" + HttpUtility.UrlDecode(pptDocumentName + ".pdf"));
}
I have the issue when I try to convert a really small ppt to pdf.
The exception detail is this:
System.OutOfMemoryException was unhandled
Message: An unhandled exception of type 'System.OutOfMemoryException' occurred in PresentationCore.dll
Additional information: Insufficient memory to continue the execution of the program.
I have to make a dispose in any point? Are the ppt not supported and only the pptx supported?
If anyone knows why this could be happening, please let me know.
Kind regards,
Juan
Attachment:
crashpresentation_d4fdb9b3.zip