Using IronPDF for .NET on Windows

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

IronPDF 支持 Windows 10, 11 和适用于 .NET 8, 7, 6, Core, .NET Standard 和 .NET Framework 的 Windows Server。

关于 Windows Server 的重要说明

我们支持Windows Server 2022 和 2016的桌面体验和核心版本,而仅在桌面体验版本支持 2019 和 2012

Windows Server 2022 和 2016

  • 带有用户界面(“桌面体验”)的 Windows Server 2022 和 2016
  • 仅限命令行的 Windows Server 2022 和 2016(“Core”)。

Windows Server 2019 和 2012

  • 带有用户界面(“桌面体验”)的 Windows Server 2019 和 2012
  • 仅限命令行的 Windows Server 2019 和 2012(“Core”)。

IronPDF 版本 2023.3.2 - 2024.2.2 不兼容 Windows Server 2012。

我们正在努力支持 Windows Server 的核心和 Nano 版本。 没有任何操作系统架构问题阻碍我们的支持。 这可能是由于 Chromium (Chrome Renderer) 需要的媒体/图形 DLL 以将 HTML 渲染为 PDF,这些 DLL 存在于 Windows Server 的“桌面”版本中,但缺失于精简版中。

此外,由于 Windows Nano Server 是 Windows Server Core 的精简版本,一旦我们完全支持 Windows Server Core,我们将研究支持 Windows Nano Server。

.NET 6 中的 Windows Nano Server / Server Core 不支持 System.Drawing 更多详情

如果您的 Windows 版本不受支持,请考虑以引擎模式使用 IronPDF

Native 和引擎有什么区别?

IronPDF 有一些性能密集的功能,您可以选择远程运行。 虽然 IronPDF 不需要 IronPdfEngine 运行,但将 IronPdfEngine 设置为远程服务是避免在旧操作系统和移动环境中出现平台特定 Chrome 兼容性问题的可选方法。

使用引擎如何改变我与 IronPDF 编码的方式?

这将使您可以使用较旧版本的 Windows,例如 Windows Server 2012。

在使用引擎配置时,我们建议从 NuGet 安装 IronPdf.Slim 而不是完整的 IronPdf 包,因为引擎管理本地包中包含的全部额外负载。

# Install the IronPdf.Slim package using Package Manager Console
:InstallCmd Install-Package IronPdf.Slim
# Install the IronPdf.Slim package using Package Manager Console
:InstallCmd Install-Package IronPdf.Slim
SHELL

安装 IronPdf.Slim 后,通过指向您的 IronPdfEngine 实例来配置连接设置。 在应用程序的启动时 (或在调用任何 IronPDF 方法之前) 添加以下代码:

// Configure IronPDF to connect to the remote IronPdfEngine instance
// Replace "123.456.7.8:33350" with the actual remote host and port
Installation.ConnectToIronPdfHost(IronPdf.GrpcLayer.IronPdfConnectionConfiguration.RemoteServer("123.456.7.8:33350"));
// Configure IronPDF to connect to the remote IronPdfEngine instance
// Replace "123.456.7.8:33350" with the actual remote host and port
Installation.ConnectToIronPdfHost(IronPdf.GrpcLayer.IronPdfConnectionConfiguration.RemoteServer("123.456.7.8:33350"));
' Configure IronPDF to connect to the remote IronPdfEngine instance
' Replace "123.456.7.8:33350" with the actual remote host and port
Installation.ConnectToIronPdfHost(IronPdf.GrpcLayer.IronPdfConnectionConfiguration.RemoteServer("123.456.7.8:33350"))
$vbLabelText   $csharpLabel

Windows Server Standard 和 DataCenter

根据微软文档中显示的差异 "<a href="https://learn.microsoft.com/en-us/windows-server/get-started/editions-comparison-windows-server-2016?tabs=full-comparison'>Windows Server 2016 标准版和数据中心版的比较", Windows Server 数据中心版包含 Windows Server 标准版的所有组件,以及额外的存储增强组件。 IronPdf 也可以在 Windows Server DataCenter 桌面体验中运行。

Windows 特定安装

NuGet

主要的 IronPdf NuGet 包依赖于 IronPdf.Native.Chrome.Windows,其中包含了适用于 x86 和 x64 架构的 Chrome 二进制文件。

  • IronPdf 包支持 x86 和 x64 Windows 架构。

如果针对特定运行时,您可以删除未使用的 /runtimes 文件夹(x86 或 x64)。

DLL 下载

对于离线使用,可以下载 DLL 并将其添加为项目的引用。

安装程序

我们还提供 Windows 的安装程序。 在 Visual Studio 解决方案资源管理器中,右键点击依赖项并选择添加项目引用。 然后,点击浏览并包含从安装程序中提取的所有 DLL 文件。

硬件规格

IronPDF 使用 Chromium 来将 HTML 渲染为 PDF。 Chromium 引擎以像素级精确度渲染 PDF,类似于 Chrome 的打印功能。 硬件规格主要用于运行 Chromium 引擎,这占据了大部分计算能力。

  • 最低要求: 1 核心和 1.75 GB 内存
  • 推荐: 2 核心和 8 GB 内存或更高

常见问题解答

哪些 Windows 版本与 PDF 工具兼容?

IronPDF 支持 Windows 10、11 和 Windows Server 版本 2022、2016、2019 和 2012 的桌面体验模式。不过,在核心模式下不支持 Windows Server 2019 和 2012。

如何处理不受支持的 Windows 版本上的 PDF 任务?

对于不支持的 Windows 版本,可以使用 IronPDF 的引擎模式。这允许您远程处理性能密集型功能,避免平台特定的兼容性问题。

运行 IronPDF 是否有特定的硬件要求?

是的,最低要求是 1 核心和 1.75 GB 内存,建议规格为 2 核心和 8 GB 或更高内存,这是因为 IronPDF 在渲染时依赖 Chromium 引擎。

IronPDF 可以离线使用吗?

是的,可以通过下载 DLL 并将其添加为项目中的引用来离线使用 IronPDF。Windows 还提供安装程序以便于离线使用。

设置 IronPDF 的引擎模式的过程是什么?

要设置 IronPDF 的引擎模式,请从 NuGet 安装 `IronPdf.Slim` 包,配置连接设置使用提供的代码将 IronPDF 指向 IronPdfEngine 实例,并连接到远程主机。

为什么 Windows Nano Server 可能会存在兼容性问题?

由于缺少 Chromium 引擎所需的媒体/图形 DLL,Windows Nano Server 不支持 IronPDF。然而,Windows Server Core 的支持正在开发之中,这可能会扩展到 Nano Server。

PDF 工具需要哪些 NuGet 包?

主要的 IronPDF NuGet 包依赖于 IronPdf.Native.Chrome.Windows,其中包含适用于 x86 和 x64 架构的必要 Chrome 二进制文件。

IronPDF 如何利用 Chromium 进行渲染?

IronPDF 使用 Chromium 引擎将 HTML 渲染为 PDF,确保像素级精确度,类似于 Chrome 的打印功能。此过程需要相当大的计算能力,因此需要考虑硬件规格。

Curtis Chau
技术作家

Curtis Chau 拥有卡尔顿大学的计算机科学学士学位,专注于前端开发,精通 Node.js、TypeScript、JavaScript 和 React。他热衷于打造直观且美观的用户界面,喜欢使用现代框架并创建结构良好、视觉吸引力强的手册。

除了开发之外,Curtis 对物联网 (IoT) 有浓厚的兴趣,探索将硬件和软件集成的新方法。在空闲时间,他喜欢玩游戏和构建 Discord 机器人,将他对技术的热爱与创造力相结合。

准备开始了吗?
Nuget 下载 16,154,058 | 版本: 2025.11 刚刚发布