Converting PPTX to PDF in C# Adds Many Blank Pages When Including Notes

When calling Presentation.Save() with SaveFormat.Pdf, and the option to show Notes below the slides, on a PPTX file containing multimedia, the output PDF has over a thousand blank pages inserted between the slide contents and the notes contents.
Here’s a code snippet to reproduce the issue. (The example assumes that the appropriate Aspose license has already been initialized.)

public void SaveAsPdfWithNotes(string inputPowerPointPath, string outputFilePath)
{
    using (var ppt = new Presentation(inputPowerPointPath))
    {
        var pdfOptions = new PdfOptions
        {
            ShowHiddenSlides = true,
            SlidesLayoutOptions = new NotesCommentsLayoutingOptions { NotesPosition = NotesPositions.BottomFull }
        };
        ppt.Save(outputFilePath, SaveFormat.Pdf, pdfOptions);
    }
}

Where inputPowerPointPath and outputFilePath are both fully-qualified paths to the input PPTX, and output PDF.
Attached is a zip file containing the PPTX we used to discover this issue, and the PDF output we got.
AmIADup.zip (3.8 MB)

@tnowikowski

It seems that you are encountering an issue where converting a PPTX file with multimedia to PDF results in numerous blank pages when including notes. This can happen due to how the notes and slides are laid out during the conversion process.

To address this issue, you can try the following approach, which is similar to the code snippet you provided but ensures that the layout options are correctly set:

public void SaveAsPdfWithNotes(string inputPowerPointPath, string outputFilePath)
{
    using (var ppt = new Presentation(inputPowerPointPath))
    {
        var pdfOptions = new PdfOptions
        {
            ShowHiddenSlides = true,
            SlidesLayoutOptions = new NotesCommentsLayoutingOptions { NotesPosition = NotesPositions.BottomFull }
        };
        
        // Save the presentation to PDF with notes
        ppt.Save(outputFilePath, SaveFormat.Pdf, pdfOptions);
    }
}

Make sure that the NotesPosition is set to BottomFull, as this will help in properly aligning the notes with the slides. If the issue persists, consider checking the multimedia content in your PPTX file, as certain types of content may affect the layout during conversion.

If you continue to experience problems, it may be beneficial to review similar examples or posts that discuss converting presentations with notes to PDF. These resources can provide additional insights or workarounds that may help resolve the issue.

For further assistance, you might want to check the following examples from the Aspose documentation:

  1. Convert Notes Slide View to PDF
  2. Convert Slides to PDF with Notes

These examples demonstrate how to handle notes during the conversion process and may provide additional context or solutions to your issue.

The approach your AI has suggested is EXACTLY the same as the sample code I originally submitted - all it added was a comment.
I need this looked at as the bug I believe it is, specific to a PowerPoint file similar to the one I uploaded. (We have run the same code against other PPT and PPTX files without getting this kind of result.)

@tnowikowski,
Thank you for reporting on the issue. I have reproduced the issue where extra pages appear when converting the PowerPoint presentation with speaker notes to PDF.

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-44946

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.

The issues you found earlier (filed as SLIDESNET-44946) have been resolved in Aspose.Slides for .NET 25.6 (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.