We are currently using Aspose.Slides to convert supported presentation files to PDFs. When exporting with speaker notes, we’ve noticed the page orientation in the PDFs is inconsistent. And the API does not have the ability to override this from what I can tell, so we can’t force a specific page orientation.
Digging into the issue with a couple different PPTX files, I’ve discovered that it comes down to the slide layout type. If Aspose reports the slide layout type as “Custom”, those pages slides will be in Landscape orientation when exporting to PDF with speaker notes. If Aspose detects the slide as any other type, it’ll be in Portrait. (Note: I haven’t tested all slide types.)
And we expect that, regardless of slide type, the page orientation will always be in Portrait, since that is what is observed when printing the presentation using PowerPoint.
I’ve observed this with both the Java and .NET versions. To note, I was using the latest version of the .NET library for this testing, but not the latest version of the Java library.
Is there any workaround for this within the API? Again it doesn’t appear we can override the page orientation from what I can tell. Or is this a bug in Aspose.Slides? Again, both the Java and .NET versions are exhibiting this behavior.
Specifically I was testing this with Aspose.Slides for .NET 23.3.1. It’s also reproducible with Aspose.Slides for Java 22.6 I’ve attached two PPTX files. “PowerPoint with Custom slide.pptx” produces the incorrect orientation in the PDF. “e. speaker notes.pptx” produces what we expect. PDF files are attached as well showing what Aspose.Slides produces.
PowerShell code that demonstrates the issue with Aspose.Slides for .NET:
And interestingly I’ve discovered that changing that orientation is considered a change to the presentation and PowerPoint prompts to save changes when closing it. And reopening the presentation after committing that change shows it’s a property embedded on the PowerPoint. Aspose.Slides also honors that property when converting to PDF.
So what is that property, and how can I access it through the Aspose.Slides API so it can be overridden on the fly? I’m digging through the documentation, but nothing obvious is standing out.
@kenneth.ballard,
It looks like you can change the orientation for Notes Pages like this
using (var pres = new Presentation("PowerPoint with Custom slide.pptx"))
{
var notesSize = pres.NotesSize.Size;
pres.NotesSize.Size = new SizeF(notesSize.Height, notesSize.Width); // inverse
pres.Save("output.pptx", SaveFormat.Pptx);
}
but this do not work correctly for the “PowerPoint with Custom slide.pptx” document.
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-43947
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.
As mentioned in my original message, the issue explained herein is also present in the Aspose.Slides for Java API, and likely in the other Aspose.Slides APIs as well. So have you noted that in the issue you’ve opened so it’s handled across the board?
The issues you found earlier (filed as SLIDESNET-43947) have been fixed in Aspose.Slides for .NET 24.8 (ZIP, MSI, NuGet, Cross-platform).
You can check all fixes on the Release Notes page.
You can also find the latest version of our library on the Product Download page.