Password protected PPT file to PDF conversion in .NET

Hello,
I’m using GroupDocs.Conversion version 18.5.0.0.
I was trying to convert a .ppt file, and I received the following error: "Couldn’t read ‘PowerPoint Document’ record.
I looked for this error online and I saw that Aspose mentioned it in theirs .NET 20.7 Release Notes (Aspose.Slides for .NET 20.7 Release Notes|Aspose.Slides Documentation)…
Im not sure if it is related, but if it is, should I upgrade my GroupDocs version? are you aware of it?
If Aspose’s notes are not related, can you help me with this issues?

this is the code:

var saveOptions = new GroupDocs.Conversion.Converter.Option.PdfSaveOptions();
saveOptions.PdfOptions.Linearize = true;
saveOptions.PdfOptions.OptimizationOptions.CompressImages = true;
saveOptions.ConvertFileType = PdfSaveOptions.PdfFileType.Pdf;
var convertedDocumentPath = conversionHandler.Convert(inputFile, saveOptions);

(Tell me if you need the conversion handler configuration…)
As a side note, the .pptx conversion in working, the problem is with the old .ppt type.

Thanks.

1 Like

@Danib

We’d recommend you to use latest version of the API that is 21.1. As you are using a very old version of the API, you may find these migration notes quite helpful. Secondly, the the documentation your are referring is for Aspose.Slides.
Please have a look at this conversion to PDF documentation article or the code below:

using (Converter converter = new Converter("sample.pptx"))
{
    PdfConvertOptions options = new PdfConvertOptions();
    converter.Convert("converted.pdf", options);
}

All you have to do is to pass the source PPTX file to the Converter class.

If the issue persists with old PPT, you can share the problematic file with us and we’ll test that.

Thank you for the answer, at this moment I prefer to not upgrade the version.
Attached is the .ppt file (as a zip), with “123” as a password, can you please test at your end?
(As a side note, I shared the Aspose.slides documentation because it mentioned the error I received, and I thought maybe you are using Aspose in you product).

Thank you

example.zip (36.9 KB)

@Danib,

We could successfully convert the provided PPT to PDF. Have a look at the source and output files.zip (42.7 KB). We’ll check if there’s any possibility to implement the issue fix in version 18.5.0. Your investigation ticket ID is CONVERSIONNET-4428.

Just to clarify, you check the conversion on 21.1 version, and don’t know how it behaves on 18.5?

@Danib

We checked this scenario with 18.5 and there was no issue. Please have a look at this screencast.zip (1.2 MB). Could you please share a simple console application using that issue could be reproduced at our end?

After seeing your code, I have tried to supply the “convert” with the password, and it does work.
But my flow does not provide the password, if it is an encrypted file it expects “Presentation is encrypted, password is needed to open the presentation”, like it excepts with .pptx, but gets “Couldn’t read ‘PowerPoint Document’ record”.

1 Like

@Danib

Please have a look at the exception with PPT file.PNG (118.9 KB) and with PPTX file.PNG (120.1 KB). In both cases (both files are password protected and in testing we didn’t provide password to SlidesLoadOptions) we got sample PasswordProtectedException. However, you could handle the exception.PNG (112.5 KB) using try/catch statement.