This topic shows how to use the JoinPptx plugin to merge PowerPoint presentations in the PPTX format. JoinPptx takes a source PPTX document and appends other PPTX documents to it, in the order you list them.
Prerequisites
Refer to the Developer Guide to learn how to set up your environment and run the code examples in this section.
The following example appends a 6-slide deck to a 7-slide deck. The presentations are loaded from the current folder, and the merged presentation is saved to the output folder.
usingSystem;usingGroupDocs.Merger.Domain.Options;usingGroupDocs.Merger.LowCode;// Load license keysvarpublicKey=Environment.GetEnvironmentVariable("GD_PUBLIC_KEY");varprivateKey=Environment.GetEnvironmentVariable("GD_PRIVATE_KEY");// Apply the licenseLicense.Set(publicKey,privateKey);// Append the documents to the source documentvarmerger=newJoinPptx("deck-1.pptx",new[]{"deck-2.pptx"},newJoinOptions());// Save the merged documentmerger.Save("output/merged-deck.pptx");
ImportsSystemImportsGroupDocs.Merger.Domain.OptionsImportsGroupDocs.Merger.LowCodeModuleProgramSubMain()' Load license keys
DimpublicKey=Environment.GetEnvironmentVariable("GD_PUBLIC_KEY")DimprivateKey=Environment.GetEnvironmentVariable("GD_PRIVATE_KEY")' Apply the license
License.Set(publicKey,privateKey)' Append the documents to the source document
DimmergerAsNewJoinPptx("deck-1.pptx",{"deck-2.pptx"},NewJoinOptions())' Save the merged document
merger.Save("output/merged-deck.pptx")EndSubEndModule
openSystemopenGroupDocs.Merger.Domain.OptionsopenGroupDocs.Merger.LowCode[<EntryPoint>]letmain_=// Load license keys
letpublicKey=Environment.GetEnvironmentVariable("GD_PUBLIC_KEY")letprivateKey=Environment.GetEnvironmentVariable("GD_PRIVATE_KEY")// Apply the license
License.Set(publicKey,privateKey)// Append the documents to the source document
letmerger=JoinPptx("deck-1.pptx",["deck-2.pptx"],JoinOptions())// Save the merged document
merger.Save("output/merged-deck.pptx")0
The source presentation can also be a Stream; the presentations to append are always file paths. The stream is read from the beginning, and it stays open after Save.
usingSystem;usingSystem.IO;usingGroupDocs.Merger.Domain.Options;usingGroupDocs.Merger.LowCode;// Load license keysvarpublicKey=Environment.GetEnvironmentVariable("GD_PUBLIC_KEY");varprivateKey=Environment.GetEnvironmentVariable("GD_PRIVATE_KEY");// Apply the licenseLicense.Set(publicKey,privateKey);// Open the source document as a streamusingvarstream=File.OpenRead("deck-1.pptx");// Append the documents to the source documentvarmerger=newJoinPptx(stream,new[]{"deck-2.pptx"},newJoinOptions());// Save the merged documentmerger.Save("output/merged-deck.pptx");
ImportsSystemImportsSystem.IOImportsGroupDocs.Merger.Domain.OptionsImportsGroupDocs.Merger.LowCodeModuleProgramSubMain()' Load license keys
DimpublicKey=Environment.GetEnvironmentVariable("GD_PUBLIC_KEY")DimprivateKey=Environment.GetEnvironmentVariable("GD_PRIVATE_KEY")' Apply the license
License.Set(publicKey,privateKey)' Open the source document as a stream
Usingstream=File.OpenRead("deck-1.pptx")' Append the documents to the source document
DimmergerAsNewJoinPptx(stream,{"deck-2.pptx"},NewJoinOptions())' Save the merged document
merger.Save("output/merged-deck.pptx")EndUsingEndSubEndModule
openSystemopenSystem.IOopenGroupDocs.Merger.Domain.OptionsopenGroupDocs.Merger.LowCode[<EntryPoint>]letmain_=// Load license keys
letpublicKey=Environment.GetEnvironmentVariable("GD_PUBLIC_KEY")letprivateKey=Environment.GetEnvironmentVariable("GD_PRIVATE_KEY")// Apply the license
License.Set(publicKey,privateKey)// Open the source document as a stream
usestream=File.OpenRead("deck-1.pptx")// Append the documents to the source document
letmerger=JoinPptx(stream,["deck-2.pptx"],JoinOptions())// Save the merged document
merger.Save("output/merged-deck.pptx")0