原創(chuàng)|使用教程|編輯:王香|2017-10-13 14:21:00.000|閱讀 988 次
概述:Spire.Presentation for .NET 是一個(gè)專業(yè)的.NET PowerPoint控件,用于幫助開發(fā)人員高效地創(chuàng)建、讀取、編輯、轉(zhuǎn)換和打印任何來自.NET ( C#, VB.NET, ASP.NET) 平臺(tái)的PowerPoint文檔,本文介紹了通過Spire.Presentation使用PrintDocument對(duì)象打印PPT文檔。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
具有打印PowerPoint文檔的強(qiáng)大功能。從Spire.Presentation v 2.8.59,它支持使用PrintDocument對(duì)象打印演示文稿幻燈片。 此示例顯示如何使用C#通過以下打印方式打印演示文稿幻燈片:
將演示幻燈片打印到默認(rèn)打印機(jī),并打印PowerPoint文檔上的所有頁面。
Presentation ppt = new Presentation(); ppt.LoadFromFile("Sample.pptx"); PresentationPrintDocument document = new PresentationPrintDocument(ppt); document.PrintController = new StandardPrintController(); ppt.Print(document);
將PowerPoint文檔打印到虛擬打印機(jī)(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文檔打印一些頁面,并在打印演示文稿幻燈片時(shí)設(shè)置文檔名稱,份數(shù)。
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);
慧都控件網(wǎng)
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn