Place all Speaker Notes at End of Presentation

This seems fairly straight forward but I cannot see how to do it.
I have a PPT presentation that has speaker notes sprinkled throughout.
I want to move all the speaker notes to after the last slide and convert the entire PPT to .pdf

Now, I also have a requirement to do similarly but convert slides to .tif. This I got to work by iterating over all slides and putting them in a collection if IbaseSlide. I put the notes at the end of the collection.
Then I iterate over this collection and generate a .tif for each IBaseSlide.

For the PDF option, i see no way to iterate over the IBaseSlides to create a PDF. Nor do I see a way to “reorder” the notes slides in the presentation. I thought about putting all notes on the last slide but it appears that each slide can have only 1 notes slide.

@jason.thiel,

I have tried understanding your requirements. If I have understood correctly, you have slide notes on different slides in your presentation. You want to a generate a PDF where the slides are rendered independently and in the end the slides notes are rendered separately. If this is your requirement then I am afraid, this is not possible as slides are either rendered with PDF notes and without PDF notes. It is not possible to render a slide with PDF and then rendered notes separately.

Perhaps an example would clarify.

Slide 1
Slide 2: has speaker notes
Slide 3: has speaker notes
Slide 4

I want a single .pdf in the end that has this:
Slide 1
Slide 2
Slide 3
Slide 4
Slide 2 speaker notes.
Slide 3 speaker notes.

I did come up with a solution, but its not pretty.

  1. Preprocess: Create a collection of IBaseSlide. Iterate over all slides in the presentation. put the slides into a
    Collection slides. If there are notes on the slide, put them into a DIFFERENT collection Collectionnotes. After we get through all slides, append any/all items in the notes collection to the slides collection.

  2. Create PDF: Iterate over Collection slides (that contains slides, then notes). Get the thumbnail off of each slide and save it as temp file and us this on an Image in a paragraph on a new page.
    code:
    var tempFile = this.CreateTempFile();

            // First try and handle it as a slide (not a note).
            if (isSlide)
            {
                using (Bitmap imageBitmap = ((ISlide) slide).GetThumbnail(tiffOptions))
                {
                    // and a page for the image.
                    Page page = doc.Pages.Add();
    
                    Image img = new Image();
                    page.Paragraphs.Add(img);
                    imageBitmap.Save(tempFile, ImageFormat.Tiff);
                    img.File = tempFile;
                }  
            }
    

// note code is similar, just retrieve the thumbnail differently…

This seems awfully clunky and I am making a lot of temp files. I would think that often people would want to grab all the notes in a presentation and stick them at the end of the presentation and save. the only additional step I have is to convert to PDF which is fairly straight forward.

@jason.thiel,

I have observed your comments and as shared earlier at present the requested support is unavailable in Aspose.Slides. An issue with ID SLIDESNET-39198 has been added as new feature request to investigate the possibility of implementing requested support. This thread has been linked with the issue so that you may automatically notified once the support will be available.

@jason.thiel,

I suggest you to please try using following workaround approach on your end to serve your requirement. I hope the shared solution will be helpful.

using (Presentation pres = new Presentation("Presentation.ppt"))
{
    int originSlidesCount = pres.Slides.Count;
    SizeF slideSize = pres.SlideSize.Size;
    
    for (int i = 0 ; i < originSlidesCount ; i++)
    {
        // Add new slide if it has notes
        if (pres.Slides[i].NotesSlideManager.NotesSlide != null)
        {
            ISlide newSld = pres.Slides.AddEmptySlide(pres.Slides[i].LayoutSlide);
                        
            // Add title to the slide
            int titleHeight = 50;
            IAutoShape titleShape = newSld.Shapes.AddAutoShape(ShapeType.Rectangle, 0, 0, slideSize.Width, titleHeight);
            titleShape.UseBackgroundFill = true;
            titleShape.AddTextFrame("Notes to Slide No. " + pres.Slides[i].SlideNumber);
            titleShape.TextFrame.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FillFormat.FillType = FillType.Solid;

            // Add notes to the slide
            IAutoShape notesShape = newSld.Shapes.AddAutoShape(ShapeType.Rectangle, 0, titleHeight, slideSize.Width, slideSize.Height - titleHeight);
            notesShape.UseBackgroundFill = true;
                        
            notesShape.TextFrame.TextFrameFormat.AnchoringType = TextAnchorType.Top;
            notesShape.TextFrame.Paragraphs.Clear();

            // Tips. You may avoid using the AutoFit property, but instead you must analyze the text framework that is suitable 
            // for the space in the slide, and if the paragraph flows out of the text frame, create a new slide.                        
            notesShape.TextFrame.TextFrameFormat.AutofitType = TextAutofitType.Normal;
            foreach (IParagraph para in pres.Slides[i].NotesSlideManager.NotesSlide.NotesTextFrame.Paragraphs)
            {
                Paragraph p = new Paragraph((Paragraph)para);
                p.ParagraphFormat.DefaultPortionFormat.FillFormat.FillType = FillType.Solid;
                notesShape.TextFrame.Paragraphs.Add(p);
            }
        }
    }
    // Save presentation in needed format
    pres.Save("Aspose_out.pdf", SaveFormat.Pdf);
}