如何使用 IronPdfEngine

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

IronPdfEngine 是一個 gRPC 伺服器,旨在管理一系列 IronPDF 任務,包括建立、編輯和讀取 PDF 文件。

開始使用 IronPdf

立即開始在您的項目中使用 IronPDF 並免費試用。

第一步:
green arrow pointer


IronPDF for Python 和 IronPdfEngine

IronPDF for Python不需要IronPdfEngine 即可運作。 IronPdfEngine 只是使用 IronPdf 的一種可選方式。 預設情況下,Python 版 IronPdf 不會使用 IronPdfEngine。

請注意注意:每個版本的 IronPDF for Python 都需要特定版本的 IronPdfEngine。不支援跨版本使用。 對於 Python 版 IronPdf,所需的 IronPdfEngine 版本始終相符。 例如,IronPdf 2024.2.2 將使用 IronPdfEngine 2024.2.2。

適用於 Python 的 IronPDF 和遠端 IronPdfEngine

假設 IronPdfEngine 在遠端123.456.7.8:33350上運行。

{i:(註:若要遠端執行 IronPdfEngine,請參閱"如何拉取與執行 IronPdfEngine "。@@--括號結束--@@

使用 pip 安裝 IronPdf

使用以下命令安裝 IronPdf:

pip install ironpdf

安裝 IronPdf 後,您需要告知 IronPdf IronPdfEngine 的位置。 請確保該位址可存取且未被防火牆封鎖。 使用IronPdfConnectionConfiguration類別配置連線設定。 將此組態程式碼新增至應用程式的開頭,或在呼叫任何 IronPdf 方法之前新增。

# Import necessary modules
from ironpdf import Installation, IronPdf

# Configure the connection settings to connect to the remote IronPdfEngine
Installation.ConnectToIronPdfHost(
    IronPdf.GrpcLayer.IronPdfConnectionConfiguration.RemoteServer("123.456.7.8:33350")
)
# Import necessary modules
from ironpdf import Installation, IronPdf

# Configure the connection settings to connect to the remote IronPdfEngine
Installation.ConnectToIronPdfHost(
    IronPdf.GrpcLayer.IronPdfConnectionConfiguration.RemoteServer("123.456.7.8:33350")
)
PYTHON

就這麼簡單! 之後,您的應用程式將連接到遠端 IronPdfEngine!

常見問題解答

如何使用 IronPdfEngine 作為遠端伺服器?

要使用 IronPdfEngine 作為遠端伺服器,首先要安裝 Python 函式庫和 PyPi 的 IronPDF 套件。然後,使用 IronPdfConnectionConfiguration 類配置連線,並使用 IronPdfEngine 提供的類似 Chrome 的渲染器將 HTML 渲染成 PDF。

IronPdfEngine 是在 Python 中執行 PDF 任務的必要工具嗎?

不,在 Python 中執行 PDF 任務並不需要 IronPdfEngine。IronPDF for Python 可以在沒有 IronPdfEngine 的情況下獨立運作,IronPdfEngine 是可選的,用於遠端操作。

如何在 Python 中安裝 IronPDF?

您可以使用 pip 在 Python 中安裝 IronPDF,命令如下:pip install ironpdf

連接遠端 IronPdfEngine 需要哪些設定?

要連接到遠端的 IronPdfEngine,請使用 IronPdfConnectionConfiguration.RemoteServer 方法指定伺服器位址,確保該位址可被存取且不會被防火牆阻擋。

不同版本的 IronPDF 和 IronPdfEngine 可以一起使用嗎?

不支持使用不同版本的 IronPDF 和 IronPdfEngine。每個版本的 IronPDF for Python 都需要特定匹配版本的 IronPdfEngine。

如何確保 IronPDF for Python 與 IronPdfEngine 的相容性?

使用相同版本的 IronPDF for Python 和 IronPdfEngine,確保相容性。例如,IronPdf 2024.2.2 應與 IronPdfEngine 2024.2.2 搭配使用。

IronPDF for Python 關於遠端連線的預設行為是什麼?

預設情況下,IronPDF for Python 不會連線至 IronPdfEngine。除非配置為使用 IronPdfEngine 連接到遠端伺服器,否則它會獨立運作。

如何使用 IronPdfEngine 將 HTML 遠端渲染為 PDF?

您可以在使用 IronPdfConnectionConfiguration 類別設定連線後,使用 IronPdfEngine 類似 Chrome 的渲染器遠端渲染 HTML 成 PDF。

我在哪裡可以找到更多關於設定遠端 IronPdfEngine 的資訊?

有關遠端執行 IronPdfEngine 的詳細說明,請參閱「如何拉取並執行 IronPdfEngine」指南。

IronPdfEngine (或 IronPDF) 是否支援 .NET 10?

是的。IronPDF 的 .NET 库与 .NET 10 完全兼容,支持 .NET10、9、8 和早期版本。這可確保使用 .NET 10 的開發人員可以像在之前的 .NET 版本中一樣無縫地使用 IronPDF,包括所有 HTML-to-PDF 渲染、遠端伺服器連接、版本匹配和引擎使用。

Curtis Chau
技術作家

Curtis Chau 擁有卡爾頓大學計算機科學學士學位,專注於前端開發,擅長於 Node.js、TypeScript、JavaScript 和 React。Curtis 熱衷於創建直觀且美觀的用戶界面,喜歡使用現代框架並打造結構良好、視覺吸引人的手冊。

除了開發之外,Curtis 對物聯網 (IoT) 有著濃厚的興趣,探索將硬體和軟體結合的創新方式。在閒暇時間,他喜愛遊戲並構建 Discord 機器人,結合科技與創意的樂趣。

準備好開始了嗎?
Version: 2025.9 剛發表