解決 PDFium 依賴性錯誤
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./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
由 IronPDF 建立的日誌檔案位於您專案中部署 DLL 的 /bin 目錄內:
default.log(部署流程)cef.log(渲染)IronSoftwareCefSubprocess.log(渲染與執行緒)IronSoftwareEngine.log(適用於除錯以"Error generating PDF from..."開頭的例外狀況)

