PPT轉化成Image、PPTX、XPS、EMF


最近工作經常用到演示文稿,接觸到了一款不錯的免費軟件—Free Spire.Presentation。使用之后發現這款軟件非常輕巧,功能還挺齊全。這款軟件的轉化功能也是非常不錯的,平時遇到的各種轉換難題,用短短幾行代碼就能搞定。現在我跟大家分享一下我的使用心得。

有興趣的朋友可以從E-iceblue官網下載Free Spire.Presentation使用。下載完成后,請將bin文件夾的.DLL添加作為Visual Studio的引用。

 

將PPT文件轉化成Image文件

//Create a presentation document.
Presentation presentation = new Presentation();
//Load the PPT file from disk.
presentation.LoadFromFile("sample.pptx");
// Save the slide to Image.
Image image = presentation.Slides[i].SaveAsImage();
//Save image to file.
String fileName = String.Format("result-img-{0}.png", i);
image.Save(“ToImage”, System.Drawing.Imaging.ImageFormat.Png);
//Launch and view the image.
System.Diagnostics.Process.Start(“ToImage”);

 

將PPT文件轉化成PPTX文件

//Create a presentation document.
Presentation presentation = new Presentation();
//Load the PPT file from disk.
presentation.LoadFromFile("sample.ppt");
//Save the PPT document to PPTX file format.
presentation.SaveToFile("ToPPTX.pptx", FileFormat.Pptx2010);
//Launch and view the resulted PPTX file.
System.Diagnostics.Process.Start("ToPPTX.pptx");

 

將PPT文件轉化成XPS文件

//Save to the XPS file.
ppt.SaveToFile("sample.xps", FileFormat.XPS);

 

將PPS文件轉化成PPTX文件

//Save the PPS document to PPTX file format.
presentation.SaveToFile("ToPPTX.pptx", FileFormat.Pptx2010);

 

將PPT文件轉化成EMF文件

//Save the presentation slide to EMF image.
presentation.Slides[2].SaveAsEMF("result.emf");

 

 

PS:我們在之前的文章里面曾經談過將PPT文件轉化成PDF文件,在這里就不多作介紹了。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM