We're sorry GroupDocs doesn't work properply without JavaScript enabled.

Free Support Forum - groupdocs.com

Error while converting from pptx to mages - bad file

I am trying to convert a presnetation file (pptx) to page-wise images using following snippet, which is picked up from your documentation, but it gives file corrupt error as attached in the image file.

        List<String> imagePaths = new List<String>();
        //?? Gives error. Cannot convert. The file is corrupt or damaged.
        var outputFileTemplate = outPath + "_{0}.png";
        GroupDocs.Conversion.Contracts.SavePageStream getPageStream = page => new FileStream(string.Format("_{0}.png", page), FileMode.Create);
        // Load the source PPTX file
        using (GroupDocs.Conversion.Converter converter = new GroupDocs.Conversion.Converter(filePath))
            // Set the convert options for PNG format
            GroupDocs.Conversion.Options.Convert.ImageConvertOptions options = new GroupDocs.Conversion.Options.Convert.ImageConvertOptions { Format = GroupDocs.Conversion.FileTypes.ImageFileType.Png };
            // Convert to PNG format
            converter.Convert(getPageStream, options);

Screenshot 2022-09-14 130543.png (26.4 KB)

It works fine for same file while converting to pdf. Please suggest.



Please share following details and we’ll look into this issue:

  • API Version that you are using (e.g. 21.8. 22.8)
  • Problematic Presentation file
  • Development environment details (e.g. OS, IDE)

API Version: GroupDocs.Total.22.8.0
The attachment is added here. I changed its file extension from .pptx to .docx, as you are not allowing .pptx files. After downloading you need to change it back to .pptx.
MSFT-00163379 Small.docx (2.7 MB)
Development environment: Windows 11, Visual Studio 2019


We cannot reproduce this issue at our end. Please take a look at this output.zip (187.1 KB). Could you please specify the .NET version as well?

Ohh, that is interesting. We have .net framework version 4.7.2


Please share the sample application and a short video explaining the steps to reproduce this issue.