如何使用IronPdfEngine

查克尼特·宾
查克尼特·宾
2024年二月22日
更新 2024年十二月10日
分享:
This article was translated from English: Does it need improvement?
Translated
View the article in English

IronPdfEngine 是一个 gRPC 服务器,旨在管理各种 IronPDF 操作,包括创建、写入、编辑和读取 PDF 文件。 作为一个独立的C# .NET应用程序,IronPdfEngine可以独立操作,执行时无需.NET运行时环境。

开始使用IronPDF

立即在您的项目中开始使用IronPDF,并享受免费试用。

第一步:
green arrow pointer


IronPdf .NET 和 IronPdfEngine

IronPdf .NET 不需要 IronPdfEngine 即可运行。 IronPdfEngine 只是使用 IronPdf 的一种可选方式。 默认情况下,IronPDF for .NET 不会使用 IronPdfEngine。

请注意
每个版本的IronPdf for .NET都需要特定版本的IronPdfEngine。不支持跨版本兼容。 对于 IronPdf for .NET,所需的 IronPdfEngine 版本将始终匹配。 例如,IronPdf 2024.2.2将使用IronPdfEngine 2024.2.2

IronPdf .NET 与 Remote IronPdfEngine

[{i:(如果您正在使用IronPdfIronPdf.Linux,可以考虑使用IronPdf.slim来减小应用程序的大小。

假设IronPdfEngine在远程运行,地址为123.456.7.8:33350

请注意
要远程运行IronPdfEngine,请参阅"Pull and Run IronPdfEngine"。

使用 NuGet 安装 IronPdf:

PM> Install-Package IronPdf

安装IronPdf.slim后,您只需告诉IronPdf IronPdfEngine的位置(请确保该地址可访问,不被防火墙阻挡)。 使用 IronPdfConnectionConfiguration 类来配置连接设置。 在您的应用程序的初始阶段(或调用任何IronPdf方法之前)添加以下代码。

Installation.ConnectToIronPdfHost(IronPdf.GrpcLayer.IronPdfConnectionConfiguration.RemoteServer("123.456.7.8:33350"));
Installation.ConnectToIronPdfHost(IronPdf.GrpcLayer.IronPdfConnectionConfiguration.RemoteServer("123.456.7.8:33350"));
Installation.ConnectToIronPdfHost(IronPdf.GrpcLayer.IronPdfConnectionConfiguration.RemoteServer("123.456.7.8:33350"))
$vbLabelText   $csharpLabel

就这么简单! 之后,您的应用将连接到远程IronPdfEngine!

查克尼特·宾
软件工程师
Chaknith 负责 IronXL 和 IronBarcode 的工作。他在 C# 和 .NET 方面拥有深厚的专业知识,帮助改进软件并支持客户。他从用户互动中获得的洞察力,有助于提升产品、文档和整体体验。