IronPrint 開始使用 IronPrint 入門指南 Curtis Chau 更新:2025年6月10日 下載 IronPrint NuGet 下載 開始免費試用 法學碩士副本 法學碩士副本 將頁面複製為 Markdown 格式,用於 LLMs 在 ChatGPT 中打開 請向 ChatGPT 諮詢此頁面 在雙子座打開 請向 Gemini 詢問此頁面 在 Grok 中打開 向 Grok 詢問此頁面 打開困惑 向 Perplexity 詢問有關此頁面的信息 分享 在 Facebook 上分享 分享到 X(Twitter) 在 LinkedIn 上分享 複製連結 電子郵件文章 This article was translated from English: Does it need improvement? Translated View the article in English IronPrint:您的 .NET 一體化列印庫 IronPrint是由 Iron Software 開發的列印庫。 該庫與多種環境相容,包括 Windows、macOS、Android 和 iOS。 ## C# 打印庫 下載用於列印文件的 C# 庫 支援處理 PDF、PNG、HTML、TIFF、GIF、JPEG、IMAGE、點陣圖格式 自訂列印設定 列印前顯示對話框 在 C# 中免費探索該庫的功能 相容性 IronPrint具有跨平台相容性,支援以下平台: .NET 版本支援 C# 、 VB.NET 、 F# .NET 8、7、6、5和 Core 3.1+ .NET Framework (4.6.2+) 作業系統和環境支持 Windows (7+,Server 2016+) macOS (10+) iOS (11+) Android API 21+(v5"棒棒糖") .NET 專案類型支援 -行動端(Xamarin、MAUI 和 Avalonia) -桌面(WPF、MAUI 和 Windows Avalonia) -控制台(應用程式和庫) 安裝 IronPrint 圖書館 透過 NuGet 套件管理器安裝 IronPrint 套件: dotnet add package IronPrint 或者,直接從IronPrint NuGet 官方網站下載。 安裝完成後,您可以透過在 C# 程式碼頂部新增using IronPrint;來開始使用。 應用許可證密鑰 接下來,透過將授權金鑰指派給License類別的LicenseKey屬性,將有效的授權金鑰或試用金鑰套用至 IronPrint。 在導入語句之後、使用任何 IronPrint 方法之前,先加入以下程式碼: using IronPrint; // Apply your IronPrint license key here License.LicenseKey = "your-license-key-here"; using IronPrint; // Apply your IronPrint license key here License.LicenseKey = "your-license-key-here"; Imports IronPrint ' Apply your IronPrint license key here License.LicenseKey = "your-license-key-here" $vbLabelText $csharpLabel 程式碼範例 列印文件 只需將文件路徑傳遞給Print方法即可列印文件。 using IronPrint; class Program { static void Main() { // Specify the file path to be printed string filePath = "document.pdf"; // Invoke the Print method to print the document IronPrint.Print(filePath); } } using IronPrint; class Program { static void Main() { // Specify the file path to be printed string filePath = "document.pdf"; // Invoke the Print method to print the document IronPrint.Print(filePath); } } Imports IronPrint Friend Class Program Shared Sub Main() ' Specify the file path to be printed Dim filePath As String = "document.pdf" ' Invoke the Print method to print the document IronPrint.Print(filePath) End Sub End Class $vbLabelText $csharpLabel 帶對話框的列印 使用ShowPrintDialog方法列印文檔,該方法在列印前也會顯示列印對話框。 using IronPrint; class Program { static void Main() { // Specify the file path to be printed string filePath = "document.pdf"; // Invoke the ShowPrintDialog method to prompt the dialog before printing IronPrint.ShowPrintDialog(filePath); } } using IronPrint; class Program { static void Main() { // Specify the file path to be printed string filePath = "document.pdf"; // Invoke the ShowPrintDialog method to prompt the dialog before printing IronPrint.ShowPrintDialog(filePath); } } Imports IronPrint Friend Class Program Shared Sub Main() ' Specify the file path to be printed Dim filePath As String = "document.pdf" ' Invoke the ShowPrintDialog method to prompt the dialog before printing IronPrint.ShowPrintDialog(filePath) End Sub End Class $vbLabelText $csharpLabel 自訂列印設定 若要透過程式碼配置列印設置,請實例化PrintSettings類別。 配置PrintSettings物件並將其傳遞給其中一個列印方法。 using IronPrint; class Program { static void Main() { // Create a PrintSettings object to configure printer settings PrintSettings settings = new PrintSettings { Copies = 2, Duplex = DuplexMode.Vertical, PageOrientation = PageOrientation.Landscape }; // Specify the file path to be printed string filePath = "document.pdf"; // Invoke the Print method with custom print settings IronPrint.Print(filePath, settings); } } using IronPrint; class Program { static void Main() { // Create a PrintSettings object to configure printer settings PrintSettings settings = new PrintSettings { Copies = 2, Duplex = DuplexMode.Vertical, PageOrientation = PageOrientation.Landscape }; // Specify the file path to be printed string filePath = "document.pdf"; // Invoke the Print method with custom print settings IronPrint.Print(filePath, settings); } } Imports IronPrint Friend Class Program Shared Sub Main() ' Create a PrintSettings object to configure printer settings Dim settings As New PrintSettings With { .Copies = 2, .Duplex = DuplexMode.Vertical, .PageOrientation = PageOrientation.Landscape } ' Specify the file path to be printed Dim filePath As String = "document.pdf" ' Invoke the Print method with custom print settings IronPrint.Print(filePath, settings) End Sub End Class $vbLabelText $csharpLabel 提供許可和支持 IronPrint是一個付費庫,但這裡也提供免費試用許可證。 有關 Iron Software 的更多信息,請訪問我們的網站:https://ironsoftware.com/如需更多協助或有任何疑問,請聯絡我們的團隊。 Iron Software 提供的支持 如需一般支援和技術諮詢,請發送電子郵件至:support@ironsoftware.com 。 Curtis Chau 立即與工程團隊聊天 技術撰稿人 Curtis Chau 擁有電腦科學學士學位(卡爾頓大學),專長於前端開發,精通 Node.js、TypeScript、JavaScript 和 React。Curtis 對製作直覺且美觀的使用者介面充滿熱情,他喜歡使用現代化的架構,並製作結構良好且視覺上吸引人的手冊。除了開發之外,Curtis 對物聯網 (IoT) 也有濃厚的興趣,他喜歡探索整合硬體與軟體的創新方式。在空閒時間,他喜歡玩遊戲和建立 Discord bots,將他對技術的熱愛與創意結合。 準備好開始了嗎? Nuget 下載 37,046 | 版本: 2026.2 剛剛發布 免費 NuGet 下載 總下載量:37,046 查看許可證