PPT slides to images

后端 未结 2 616
予麋鹿
予麋鹿 2020-12-05 08:38

I am using Office 07 PIA to convert the ppt into images in C#.

The slides are properly converted into images.

Now, while individual slides are converted into

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-05 09:42

    It's pretty simple:

    Office 2002

    using Microsoft.Office.Core;
    using PowerPoint;
    
    ApplicationClass pptApplication = new ApplicationClass();
    
    Presentation pptPresentation = pptApplication.Presentations.Open("myfile.ppt", MsoTriState.msoFalse,
    MsoTriState.msoFalse, MsoTriState.msoFalse);
    
    pptPresentation.Slides.Item(1).Export("slide.jpg", "jpg", 320, 240);
    

    Office 2003

    using Microsoft.Office.Core;
    using Microsoft.Office.Interop.PowerPoint;
    
    ApplicationClass pptApplication = new ApplicationClass();
    Presentation pptPresentation = pptApplication.Presentations.Open("myfile.ppt", MsoTriState.msoFalse,
    MsoTriState.msoFalse, MsoTriState.msoFalse);
    
    pptPresentation.Slides.Item[1].Export("slide.jpg", "jpg", 320, 240);
    

    Image Output Quality

    pptPresentation.Slides.Item[1].Export("slide.png", "PNG", 1024, 768);
    

提交回复
热议问题