原創|使用教程|編輯:王香|2017-10-13 14:21:00.000|閱讀 988 次
概述:Spire.Presentation for .NET 是一個專業的.NET PowerPoint控件,用于幫助開發人員高效地創建、讀取、編輯、轉換和打印任何來自.NET ( C#, VB.NET, ASP.NET) 平臺的PowerPoint文檔,本文介紹了通過Spire.Presentation使用PrintDocument對象打印PPT文檔。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
具有打印PowerPoint文檔的強大功能。從Spire.Presentation v 2.8.59,它支持使用PrintDocument對象打印演示文稿幻燈片。 此示例顯示如何使用C#通過以下打印方式打印演示文稿幻燈片:
將演示幻燈片打印到默認打印機,并打印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 document document.DocumentName = "Print PowerPoint"; //Choose to print some pages from the PowerPoint document document.PrinterSettings.PrintRange = PrintRange.SomePages; document.PrinterSettings.FromPage = 1; document.PrinterSettings.ToPage = 2; //Set the number of copies of the document to print document.PrinterSettings.Copies = 2; ppt.Print(document);
慧都控件網
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn