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

 时间:2026-02-14 06:33:21

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

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

1、【C#】

using Spire.Presentation;

using System;

using System.Drawing;

namespace PPTtoImg_PPT

{

    class Program

    {

        static void Main(string[] args)

        {

            //创建Presentation类实例,并加载文件

            Presentation presentation = new Presentation();

            presentation.LoadFromFile("test.pptx");

            //遍历所有幻灯片,保存为指定格式的图片,并打开生成的文档

            for (int i = 0; i < presentation.Slides.Count; i++)

            {                

                Image image = presentation.Slides[i].SaveAsImage();

                String fileName = String.Format("result-img-{0}.png", i);

                //String fileName = String.Format("result1-img-{0}.emf", i);

                image.Save(fileName, System.Drawing.Imaging.ImageFormat.Png);

                System.Diagnostics.Process.Start(fileName);

            }

        }

    }

}

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

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

1、【C#】

using Spire.Presentation;

namespace PPTtoHTML_ppt

{

    class Program

    {

        static void Main(string[] args)

        {

            //实例化Presentation类,加载文件

            Presentation ppt = new Presentation();

            ppt.LoadFromFile("test.pptx");

            //保存文件为HTML

            ppt.SaveToFile("result.html", FileFormat.Html);

            System.Diagnostics.Process.Start("result.html");

        }

    }

}

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

1、【C#】

using Spire.Presentation;

using System.Drawing;

namespace PPTtoImg1_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

1、【C#】

using Spire.Presentation;

namespace PPTtoTIFF_ppt

{

    class Program

    {

        static void Main(string[] args)

        {

            //创建一个Presentation类对象,加载文件

            Presentation ppt = new Presentation();

            ppt.LoadFromFile("test.pptx");

            //调用方法Save.ToFile()将幻灯片转换为tiff格式的图片文件,并打开生成的文档

            ppt.SaveToFile("toTIFF.tiff", FileFormat.Tiff);

            System.Diagnostics.Process.Start("toTIFF.tiff");

        }

    }

}

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

  • 怎样diy一个厨房菜园?
  • 酚醛胶粘剂主要特点
  • 有氧运动中有好处也有坏处
  • it培训机构有哪些
  • 会声会影基本操作——字幕动画
  • 热门搜索
    关于五一的手抄报 防疫有我爱卫同行手抄报 预防新型冠状病毒手抄报内容 我和我的祖国手抄报简单又漂亮 光盘行动手抄报内容 爱祖国的手抄报 小学生英语手抄报 2035年的家乡手抄报 关于长城的手抄报 环保英语手抄报