Spire.Presentation具有打印PowerPoint文档的强大功能。从Spire.Presentation v 2.8.59,它支持使用PrintDocument对象打印演示文稿幻灯片。 此示例显示如何使用C#通过以下打印方式打印演示文稿幻灯片:
- 将PowerPoint文档打印到默认打印机。
- 将PowerPoint文档打印到虚拟打印机。
- 从PowerPoint文档打印一些页面,并在打印演示文稿幻灯片时设置文档名称,份数。
将演示幻灯片打印到默认打印机,并打印PowerPoint文档上的所有页面。
Presentation ppt = new Presentation();ppt.LoadFromFile("Sample.pptx");PresentationPrintDocument document = new PresentationPrintDocument(ppt);document.PrintController = new StandardPrintController();ppt.Print(document);
将PowerPoint文档打印到虚拟打印机(Microsoft XPS Document Writer)。
Presentation ppt = new Presentation();ppt.LoadFromFile("Sample.pptx");PresentationPrintDocument document = new PresentationPrintDocument(ppt);document.PrinterSettings.PrinterName = "Microsoft XPS Document Writer"; ppt.Print(document);
从PowerPoint文档打印一些页面,并在打印演示文稿幻灯片时设置文档名称,份数。
Presentation ppt = new Presentation();ppt.LoadFromFile("Sample.pptx");PresentationPrintDocument document = new PresentationPrintDocument(ppt); //Set the document name to display while printing the documentdocument.DocumentName = "Print PowerPoint";//Choose to print some pages from the PowerPoint documentdocument.PrinterSettings.PrintRange = PrintRange.SomePages;document.PrinterSettings.FromPage = 1;document.PrinterSettings.ToPage = 2;//Set the number of copies of the document to printdocument.PrinterSettings.Copies = 2;ppt.Print(document);
控件
标签:文档管理PPT文档处理
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!