How can I embed a PowerPoint presentation into a WPF application without opening another window?

后端 未结 4 689
攒了一身酷
攒了一身酷 2020-12-16 02:30

Currently I have a WPF application in C#, but I\'m finding it to be incredibly difficult to find any useful ways to embed a PowerPoint presentation into my window.

O

4条回答
  •  抹茶落季
    2020-12-16 03:29

    There is a WPF control called DocumentViewer.

    1. First the pptx should be converted to .xps file format.
    2. Then Bind it to the Document property of the DocumentViewer.

    Here is the link to convert office documents (including pptx) to XPS in C sharp.

    XAML

    
    
    
    

    Bind to the Document property of the control (Note that ConvertPptxDocToXPSDoc is the method to convert pptx to xps)

     myDocumentViewer.Document = this.ConvertPptxDocToXPSDoc(this.FileName, this.newXPSDocumentName).GetFixedDocumentSequence();
    

提交回复
热议问题