C# 转PPT为图片(png/tiff/emf)、PDF、html

 时间:2024-10-14 12:40:22

此经验将介绍C#编程如何将PPT幻灯片转换为图片,如png/tiff/emf等图片文件,PPT转为PDF、html等格式。

工具/原料

Spire.Presentation for .NET

Visual Studio

1.dll引用

1、下载安装该类库后,在项目程序中添加引用Spire.Presentation.dll即可,dll文件可在安装路径下的Bin文件夹中获取。

C# 转PPT为图片(png/tiff/emf)、PDF、html

3.PPT转PDF

1、【C#】using Spire.Presentation;namespace PPTtoPDF_PPT{ class Program { static void Main(string[] args) { Presentation presentation = new Presentation(); presentation.LoadFromFile("test.pptx"); //将幻灯片保存为PDF格式的文件 presentation.SaveToFile("ToPdf.pdf", FileFormat.PDF); System.Diagnostics.Process.Start("ToPdf.pdf"); } }}

C# 转PPT为图片(png/tiff/emf)、PDF、html

5.PPT转为指定大小的图片

1、【C#】using Spire.Presentation;using System.Drawing;namespace PPTtoIm爿讥旌护g1_ppt{ class Program { static void Main(string[] args) { //实例化Presentation类,加载文件 Presentation presentation = new Presentation(); presentation.LoadFromFile("test.pptx"); //指定幻灯片保存为指定大小的图片 Image img = presentation.Slides[1].SaveAsImage(600, 400); //保存并打开文件 img.Save("result.png", System.Drawing.Imaging.ImageFormat.Png); System.Diagnostics.Process.Start("result.png"); } }}

C# 转PPT为图片(png/tiff/emf)、PDF、html
  • 怎样diy一个厨房菜园?
  • 酚醛胶粘剂主要特点
  • 有氧运动中有好处也有坏处
  • it培训机构有哪些
  • 会声会影基本操作——字幕动画
  • 热门搜索
    眼睛出血是怎么回事 日语新年快乐怎么说 酸萝卜怎么泡 雪花怎么剪 上海环球雅思怎么样 电子版手抄报怎么做 手机掉水里怎么处理 怎么连接wifi word怎么设置页数 煤气泄漏怎么办