解決 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;
$vbLabelText   $csharpLabel

IronPDF 產生的日誌檔案位於專案/bin目錄中,也就是 DLL 檔案部署所在的目錄:

  • default.log (部署流程)
  • cef.log (渲染)
  • IronSoftwareCefSubprocess.log (渲染和線程)
  • IronSoftwareEngine.log (用於偵錯以"從...產生 PDF 時出錯"開頭的異常)

雲端伺服器通常會為日誌檔案指定特定的存放位置。 我們有關於在AzureAWS中產生日誌檔案的指南。

柯蒂斯·週
技術撰稿人

Curtis Chau擁有卡爾頓大學電腦科學學士學位,專長於前端開發,精通Node.js、TypeScript、JavaScript和React。他熱衷於打造直覺美觀的使用者介面,喜歡使用現代框架,並擅長撰寫結構清晰、視覺效果出色的使用者手冊。

除了開發工作之外,柯蒂斯對物聯網 (IoT) 也抱有濃厚的興趣,致力於探索硬體和軟體整合的創新方法。閒暇時,他喜歡玩遊戲和製作 Discord 機器人,將他對科技的熱愛與創造力結合。

準備好開始了嗎?
Nuget 下載 17,012,929 | 版本: 2025.12 剛剛發布