Hi Team,
Attached a simple pptm file, for which GetPresentationInfo() returns with an instance of IPresentationInfo with LoadFormat.Unknown value of LoadFormat attribute
The pptm file can be opened without any problems
- on linux with Libreoffice Impress
- on windows with Libreoffice Impress
- on windows with MS Office PowerPoint 2016
pptm.zip (24.6 KB)
Can you please investigate why?
Thank you.
@zpopswat
Summary
PresentationFactory.GetPresentationInfo() is returning LoadFormat.Unknown for a .pptm file even though the file opens correctly in LibreOffice and PowerPoint.
Why it happens
GetPresentationInfo determines the format by examining the internal ZIP package of the presentation (e.g., [Content_Types].xml, ppt/presentation.xml). A macro‑enabled PowerPoint file (.pptm) must contain a macro part (ppt/vbaProject.bin) and an appropriate entry in [Content_Types].xml. If any required entry is missing, corrupted, or uses a content type that the detector does not recognise, the routine cannot identify the format and falls back to LoadFormat.Unknown. Common causes are:
- Missing or malformed
[Content_Types].xml entry for the macro part – Office applications are tolerant, but Aspose.Slides’ detection is stricter.
- Extra or unknown content‑type entries introduced by a newer PowerPoint version – the library may not yet recognise those additions.
- Using an older Aspose.Slides build – earlier releases had limited support for
.pptm detection; newer releases improve this.
What to do next
- Check the Aspose.Slides version
Console.WriteLine($"Aspose.Slides version: {Aspose.Slides.SlidesVersionInfo.Version}");
If the version is not the most recent one available on NuGet, upgrade the package and retry.
- Inspect the ZIP structure of the file (rename the file to
.zip and extract it). Verify that the following entries exist:
[Content_Types].xml – should contain an <Override PartName="/ppt/vbaProject.bin" ContentType="application/vnd.ms-office.vbaProject"/> line.
ppt/presentation.xml – the main presentation part.
ppt/vbaProject.bin – the macro storage (it may be empty for a macro‑free .pptm).
If any of these are missing or appear corrupted, open the file in PowerPoint and re‑save it as PowerPoint Macro‑Enabled Presentation (.pptm), then test again.
- Force a known load format when calling the API (useful when automatic detection fails):
using Aspose.Slides;
// Option 1 – supply LoadOptions
var loadOptions = new LoadOptions { LoadFormat = LoadFormat.Pptx };
var info = PresentationFactory.GetPresentationInfo("sample.pptm", loadOptions);
Console.WriteLine(info.LoadFormat); // expected: Pptx
// Option 2 – load the presentation directly (bypasses GetPresentationInfo)
using var pres = new Presentation("sample.pptm");
Console.WriteLine(pres.SlideSize.Size); // any operation confirms the file is readable
- If the file still reports
Unknown
- Create a minimal test file: open the original in PowerPoint, delete all slides, add a single blank slide, save as
.pptm, and run the same check.
- Compare the ZIP contents of the minimal file with the problematic one to spot differences.
- If the issue persists, open a support request through the Aspose portal and attach a sanitized copy of the file; the support team can run internal diagnostics.
- Optional fallback – If macro content is not required, you can convert the file to a plain
.pptx (open in PowerPoint and Save As .pptx). The converted file will be recognised by GetPresentationInfo without additional steps.
I could not fully verify this explanation against the retrieved sources. Please double-check the behaviour in your environment and confirm the exact SDK/version.
@zpopswat,
Thank you for reporting the issue. I have reproduced the problem where the GetPresentationInfo method is unable to determine the load format of the PowerPoint presentation. We apologize for any inconvenience caused.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): SLIDESNET-45200
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.