解決 PDFium 依賴性錯誤

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(適用於除錯以"Error generating PDF from..."開頭的例外狀況)

雲端伺服器通常會將日誌檔案儲存於特定位置。 我們提供在 AzureAWS 中建立日誌檔案的指南。

Curtis Chau
技術作家

Curtis Chau擁有Carleton大學的電腦科學學士學位,專精於前端開發,擁有Node.js、TypeScript、JavaScript和React的專業知識。Curtis熱衷於建立直觀且美觀的使用者介面,喜愛使用現代框架並建立結構良好、視覺吸引力的手冊。

除了開發,Curtis對物聯網(IoT)有濃厚的興趣,探索創新的方法來整合硬體和軟體。在空閒時間,他喜歡玩遊戲和建立Discord機器人,結合他對技術的熱愛與創造力。

準備開始了嗎?
Nuget 下載 20,296,129 | 版本: 2026.7 剛剛發布
Still Scrolling Icon

還在捲動嗎?

想快速獲得證明嗎? PM > Install-Package IronPdf
執行範例 看您的HTML變成PDF。