Merge Presentations

This demo uses the DevExpress Presentation API to merge multiple presentations into a single file. You can merge predefined sample files or supply your own documents. To do the latter, select Upload a File in the file selection drop-down menu and upload files one at a time.

The Merge Settings section allows you to specify how to fit slides from different presentations. Use the Merge and Save as... dropdown button to select the output format, merge presentations, and download the result.

Select a Document
NorthwindPresentation.pptx
ProjectStatusOverview.pptx



using DevExpress.Docs.Presentation;

Stream MergePresentations(List<Stream> inputStreams, DocumentFormat targetFormat, bool pdfOutput, ResizeMode resizeMode) {
    var outputStream = new MemoryStream();

    if(inputStreams.Count > 0) {
        using var presentation = new Presentation(inputStreams[0]);
        for(int i = 1; i < inputStreams.Count; i++) {
            var inputStream = inputStreams[i];
            using var tempPresentation = new Presentation(inputStream);
            tempPresentation.ResizeSlides(presentation.SlideSize, resizeMode);
            foreach(var slide in tempPresentation.Slides)
                presentation.Slides.Add(slide);
        }
        if(pdfOutput)
            presentation.ExportToPdf(outputStream);
        else
            presentation.SaveDocument(outputStream, targetFormat);
    }

    outputStream.Position = 0;
    return outputStream;
}