安裝概述

This article was translated from English: Does it need improvement?
Translated
View the article in English

IronPDF 全平台安裝配置完整指南。

Nuget Icon立即開始使用 NuGet 建立 PDF 檔案:

  1. 使用 NuGet 套件管理器安裝 IronPDF

    PM > Install-Package IronPdf

  2. 複製並運行這段程式碼。

    IronPdf.ChromePdfRenderer
           .StaticRenderHtmlAsPdf("<p>Hello World</p>")
           .SaveAs("pixelperfect.pdf");
  3. 部署到您的生產環境進行測試

    立即開始在您的專案中使用 IronPDF,免費試用!
    arrow pointer

1. 平台要求

平台 .NET 版本 硬體 附加要求、相容性
Logo Table Windows related to 1. 平台要求
Windows
.NET 10、9、8、7、6、5、.NET Core、.NET Standard 和 .NET Framework。
  • 最低配置:單核心處理器和 1.75 GB 內存
  • 建議配置:雙核心處理器和 8GB 記憶體或以上
  • Windows 10、11 和 Windows Server
  • Visual C++ 可再發行元件包(x86 和 x64)
Logo Table Linux related to 1. 平台要求
Linux
  • 64 位元 Linux 作業系統:Ubuntu 22、Ubuntu 20、Ubuntu 18、Ubuntu 16、Debian 10-11m CentOS 8、Fedora Linux 33、Amazon、AWS、Linux 2
  • IronCefSubprocess
  • Chrome 依賴項
Logo Table Mac related to 1. 平台要求
macOS
2020 年至今的所有 macOS 版本

2. 安裝方法

IronPDF 有兩種安裝方式:本機安裝模式和遠端引擎安裝模式。預設情況下,建議使用本機安裝模式。 若要使用 Docker/Kubernetes 部署到生產伺服器,請使用遠端引擎模式。

遠端引擎模式:透過gRPC協定進行獨立的PDF處理。
  • 最適合:雲端和容器化部署,以及對舊版作業系統的支援。
  • 軟體包: IronPdf.Slim
  • 大小:更輕巧,僅佔用幾兆位元組。
  • 需求:需要配置與主機的連線。

3. 安裝選項

安裝 C# PDF 庫只需不到 5 分鐘。 透過 NuGet 或直接下載即可免費獲取,並立即在 Visual Studio 中開始使用。

NuGet 套件
手動下載
遠程 IronPdfEngine

前往IronPDF NuGet 庫(或 Visual Studio 中的套件管理器控制台)

  1. 在解決方案資源管理器中,以滑鼠右鍵按一下"引用"。
  2. 選擇"管理 NuGet 套件">"瀏覽">搜尋 IronPdf
  3. 選擇軟體包並安裝。
Install-Package IronPdf
  1. 下載適用於您平台的 IronPDF DLL 套件:Windows、Linux、macOS
  2. 將適用於您作業系統的 ZIP 檔案解壓縮到解決方案目錄中的某個位置。
  3. 在 Visual Studio 解決方案資源管理器中,以滑鼠右鍵按一下"依賴項"。
  4. "新增項目參考" > 選擇"瀏覽"以包含從 zip 檔案中提取的所有 DLL 檔案。

請注意請注意:每個 IronPDF 版本都需要符合版本的 IronPdfEngine。不支援跨版本相容。 例如,IronPDF 2024.2.2 必須使用 IronPdfEngine 2024.2.2。

使用 NuGet 安裝 IronPdf。

Install-Package IronPdf.Slim

4. 其他配置

管理許可證
Path & Permission
遠端引擎

購買或註冊 IronPDF 30 天試用版後,請尋找寄送至您信箱的許可證金鑰。

請在申請開始時新增您的許可證密鑰。

IronPdf.License.LicenseKey = "KEY";
IronPdf.License.LicenseKey = "KEY";
Imports IronPdf

IronPdf.License.LicenseKey = "KEY"
$vbLabelText   $csharpLabel

查詢許可證狀態。

bool valid = IronPdf.License.IsLicensed;
bool valid = IronPdf.License.IsLicensed;
Imports IronPdf

Dim valid As Boolean = IronPdf.License.IsLicensed
$vbLabelText   $csharpLabel

設定 IronPdf.Installation 物件的 TempFolderPath 屬性。

IronPdf.Installation.TempFolderPath = @"C:\My\Safe\Path";
IronPdf.Installation.TempFolderPath = @"C:\My\Safe\Path";
IronPdf.Installation.TempFolderPath = "C:\My\Safe\Path"
$vbLabelText   $csharpLabel

[{t:(請確保清除開發環境和伺服器上的所有臨時資料夾和快取資料夾,然後在更新路徑後重新部署應用程式的乾淨版本。