Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active January 13, 2022 09:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-com-gists/00999c84848fd959194e66a1d1dc73e2 to your computer and use it in GitHub Desktop.
Save aspose-com-gists/00999c84848fd959194e66a1d1dc73e2 to your computer and use it in GitHub Desktop.
Convert PUB to PPT PPTX PowerPoint Presentation Programmatically in C# .NET
string fileName = "Test.pub";
// Initialize a MemoryStream to hold output document
MemoryStream stream = new MemoryStream();
// Load input PUB file
IPubParser parser = PubFactory.CreateParser(fileName);
// Parse the input publisher file
Aspose.Pub.Document doc = parser.Parse();
// Convert the PUB file to PDF and save result in a MemoryStream
PubFactory.CreatePdfConverter().ConvertToPdf(doc, stream);
// Load input PDF file from the MemoryStream
Document document = new Document(stream);
// Initialize PptxSaveOptions class object
PptxSaveOptions options = new PptxSaveOptions();
// Save output presentation file (PPT/PPTX)
document.Save("Output.pptx", options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment