IRONSOFTWAREHOME

IronPrint 入門指南

Curtis Chau
Curtis Chau
Updated: 2026年4月22日

IronPrint:您的 .NET 全方位列印程式庫

IronPrint 是由 Iron Software 開發的列印程式庫。 此函式庫相容於多種環境,包括 Windows、macOS、Android 及 iOS。

相容性

IronPrint 支援以下平台的相容性:

.NET 版本支援

  • C#VB.NETF#
  • .NET 8、7、6、5 及 .NET Core 3.1+
  • .NET Framework (4.6.2+)

支援的作業系統與環境

  • Windows (7 以上版本、Server 2016 以上版本)
  • macOS (10+)
  • iOS (11+)
  • Android API 21+ (v5 "Lollipop")

.NET 專案型別支援

  • 行動裝置 (Xamarin、MAUI 及 Avalonia)
  • 桌面端 (WPF、MAUI 及 Windows Avalonia)
  • 控制台(應用程式與函式庫)

安裝

IronPrint程式庫

透過 NuGet 套件管理員安裝 IronPrint 套件:

dotnet add package IronPrint

您亦可直接從 IronPrint 官方 NuGet 網站下載。

安裝完成後,您只需在 C# 程式碼開頭加入 using IronPrint; 即可開始使用。

套用授權金鑰

接著,請將有效的授權金鑰或試用授權套用至 IronPrint,方法是將授權金鑰指派給 License 類別的 LicenseKey 屬性。 請在 import 語句之後、使用任何 IronPrint 方法之前,加入以下程式碼:

using IronPrint;

// Apply your IronPrint license key here
License.LicenseKey = "your-license-key-here";

程式碼範例

列印文件

只需將檔案路徑傳遞給 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);
    }
}

透過對話方塊列印

使用 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);
    }
}

自訂列印設定

若要透過程式碼設定 PRINT 選項,請建立 PrintSettings 類別的實例。 設定 PrintSettings 物件,並將其傳遞給其中一個 PRINT 方法。

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);
    }
}

提供授權與技術支援

IronPrint 是一款付費程式庫; 不過,您亦可在此取得免費試用授權。

如需更多關於 Iron Software 的資訊,請造訪我們的網站:https://ironsoftware.com/ 如需更多支援或有任何疑問,請聯繫我們的團隊

Iron Software 提供支援

如需一般支援或技術諮詢,請透過電子郵件聯絡我們:support@ironsoftware.com

Curtis Chau
技術作家

Curtis Chau擁有Carleton大學的電腦科學學士學位,專精於前端開發,擁有Node.js、TypeScript、JavaScript和React的專業知識。Curtis熱衷於建立直觀且美觀的使用者介面,喜愛使用現代框架並建立結構良好、視覺吸引力的手冊。

...
閱讀更多

準備好開始了嗎?

Nuget Downloads 46,090版本:2026.9剛剛發布

立即獲取您的免費30天試用金鑰
不需要信用卡或帳戶建立
C# NuGet PDF程式庫
安裝方法NuGet

版本: 2026.9

PM > Install-Package IronPrint
nuget.org/packages/IronPrint/
  1. 在解決方案資源管理器中,右鍵點擊引用,管理NuGet套件
  2. 選擇瀏覽並搜尋"IronPrint"
  3. 選擇套件並安裝
C# PDF DLL
下載DLL

版本: 2026.9

  1. 下載並解壓IronPrint到比如~/Libs這樣的位置在您的Solution目錄下
  2. 在Visual Studio解決方案資源管理器中,右鍵點擊引用。選擇瀏覽,"IronPrint.dll"

授權從$999

有問題嗎?聯繫我們的開發團隊。

Key in blue circle

立即免費取得 30 天試用金鑰

Your trial license will be sent to your email address

無任何限制。100% 解鎖。無需信用卡。

bullet_checked無需信用卡或建立帳號無任何限制。100% 解鎖。無需信用卡。
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
預約您的免費
現場演示
Booking Badge

全球數百萬工程師信賴

Iron Software的客戶標誌
獲得非義務性諮詢
完成下列表單或發郵件到sales@ironsoftware.com
您的資訊將始終保密。
全球數百萬工程師信賴
Iron Software的客戶標誌
立即獲取您的30天試用金鑰
無需信用卡或帳戶建立