Resolving PDFium Dependency Errors

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

Google PDFIUM 是 IronPDF 核心代碼的一個重要組成部分,用於 PDF 編輯和將 PDF 文檔轉換為圖像的各種功能。 如果項目文件夾中缺少 PDFIUM 二進制文件,則在運行時將拋出以下錯誤。

Unhandled exception. IronSoftware.Exceptions.IronSoftwareDeploymentException: Error while deploying Pdfium for IronPdf: 'Unable to locate 'IronPdfInterop'

安裝 IronPdf.Native.PdfModel 包至項目通常可以解決這個問題。

在 Windows 上,確保目標操作系統安裝了 Visual C++ 運行時 也不失為一個好主意。

如果這無法解決該怎麼辦?

如果這無法解決問題,我們將提供幫助。兼容性是我們工程團隊的高優先級問題。 請發送電子郵件錯誤報告至 support@ironsoftware.com。 所有兼容性問題將由資深工程師進行嚴格審查。

請務必告知我們正在部署到的操作系統/平台,特別是如果它是 AWS 或 Azure 等雲平台。

如何在 IronPDF 中啟用本地日誌記錄

將日誌文件附加到錯誤報告中,將進一步提高我們隔離問題並迅速解決它的可能性。

將這段代碼放置在代碼的頂端,然後再運行任何 IronPDF 方法之前(所有版本均適用於 2021.3.1 之後)。

// Enable debugging to generate detailed log files for troubleshooting.
IronPdf.Logging.Logger.EnableDebugging = true;

// Set the path for the log file. You can specify a directory name or a full file path.
IronPdf.Logging.Logger.LogFilePath = "Default.log";

// Set the logging mode to log all events.
IronPdf.Logging.Logger.LoggingMode = IronPdf.Logging.Logger.LoggingModes.All;
// Enable debugging to generate detailed log files for troubleshooting.
IronPdf.Logging.Logger.EnableDebugging = true;

// Set the path for the log file. You can specify a directory name or a full file path.
IronPdf.Logging.Logger.LogFilePath = "Default.log";

// Set the logging mode to log all events.
IronPdf.Logging.Logger.LoggingMode = IronPdf.Logging.Logger.LoggingModes.All;
' Enable debugging to generate detailed log files for troubleshooting.
IronPdf.Logging.Logger.EnableDebugging = True

' Set the path for the log file. You can specify a directory name or a full file path.
IronPdf.Logging.Logger.LogFilePath = "Default.log"

' Set the logging mode to log all events.
IronPdf.Logging.Logger.LoggingMode = IronPdf.Logging.Logger.LoggingModes.All
$vbLabelText   $csharpLabel

IronPDF 創建的日誌文件位於項目中 DLL 部署的 /bin 目录:

  • default.log (部署過程)
  • cef.log (渲染)
  • IronSoftwareCefSubprocess.log (渲染和多線程)
  • IronSoftwareEngine.log (調試以“從...生成 PDF 錯誤”開頭的異常時很有用)

雲服務器通常有特定的位置放置日誌文件。 We have guides for generating log files in Azure and AWS.

Curtis Chau
技術作家

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

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

準備好開始了嗎?
Nuget 下載 16,154,058 | 版本: 2025.11 剛剛發布