原創(chuàng)|產(chǎn)品更新|編輯:李顯亮|2021-03-04 10:56:42.670|閱讀 453 次
概述:DotNetBrowser更新至v2.4版本,打印API進(jìn)行了改進(jìn)和重新設(shè)計(jì),支持.NET 5,以及更多改進(jìn)和修復(fù),歡迎下載體驗(yàn)。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
DotNetBrowser是一個(gè).NET庫,允許將基于Chromium的WPF和WinForms組件嵌入到.NET應(yīng)用程序中,以顯示使用HTML5,CSS3,JavaScript,Silverlight等構(gòu)建的現(xiàn)代網(wǎng)頁。
DotNetBrowser更新至v2.4版本,打印API進(jìn)行了改進(jìn)和重新設(shè)計(jì),支持.NET 5,以及更多改進(jìn)和修復(fù),還沒有使用過可以點(diǎn)擊下方鏈接下載哦~
DotNetBrowser迎來v2.4版本更新,為了方便大家盡可能順利過度新版本,我們特意準(zhǔn)備了本指南將幫助您了解新版本都要哪些新增與改動(dòng)。
新功能
// Tell the Chromium engine to perform the printing programmatically. browser.RequestPrintHandler = new Handler<RequestPrintParameters, RequestPrintResponse>(p => { return RequestPrintResponse.Print(); }); // This handler is used for printing regular web pages programmatically. browser.PrintHtmlContentHandler = new Handler<PrintHtmlContentParameters, PrintHtmlContentResponse>(p => { string pdfFilePath = Path.GetFullPath("result.pdf"); // Get the print job for the built-in PDF printer. IPrintJob<PdfPrinter.IHtmlSettings> printJob = p.Printers.Pdf.PrintJob; // Subscribe to its PrintCompleted event and show a message box when it's done. printJob.PrintCompleted += (sender, args) => { BeginInvoke((Action) (() => { MessageBox.Show("Printing completed: \n"+pdfFilePath); })); }; // Apply the necessary print settings printJob.Settings.Apply(s => { // Enable printing header and footer. s.PrintingHeaderFooterEnabled = true; // Specify the path to save the result. s.PdfFilePath = pdfFilePath; }); // Tell Chromium to use the built-in PDF printer for printing. return PrintHtmlContentResponse.Print(p.Printers.Pdf); }); // Load the web page and wait until it is loaded completely. browser.Navigation.LoadUrl("teamdev.com").Wait(); // Initiate printing. browser.MainFrame.Print();
改進(jìn)
問題修復(fù)
如果你對(duì)我們的產(chǎn)品感興趣,想咨詢正版授權(quán)折扣價(jià)格,請(qǐng)聯(lián)系咨詢~
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn