Fixing Render Timeout Issues in IronPDF

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

IronPDF 的默認渲染超時時間是 60 秒。 如果渲染過程在此時間內未完成,將拋出超時運行時異常。

對於具有大量圖像資產或需要額外時間渲染的輸入,建議調整 RenderDelay 時長。 這樣可以在生成 PDF 之前讓資產在虛擬上完全渲染。 如果不這樣做,可能會導致 PDF 文件中的資產丟失,甚至是空白 PDF。

要覆蓋默認設置,請調整 ChromePdfRenderOptions 類中的超時時間,並通過 WaitFor 包裝對象在 RenderDelay 方法中指定延遲時間。

示例

// Create a new instance of ChromePdfRenderOptions
ChromePdfRenderOptions renderOptions = new ChromePdfRenderOptions();

// Increase the timeout for the rendering process to 120 seconds
renderOptions.Timeout = 120; // seconds

// Increase the delay before rendering to ensure all assets are fully loaded
renderOptions.WaitFor.RenderDelay(3000); // milliseconds (3 seconds)
// Create a new instance of ChromePdfRenderOptions
ChromePdfRenderOptions renderOptions = new ChromePdfRenderOptions();

// Increase the timeout for the rendering process to 120 seconds
renderOptions.Timeout = 120; // seconds

// Increase the delay before rendering to ensure all assets are fully loaded
renderOptions.WaitFor.RenderDelay(3000); // milliseconds (3 seconds)
' Create a new instance of ChromePdfRenderOptions
Dim renderOptions As New ChromePdfRenderOptions()

' Increase the timeout for the rendering process to 120 seconds
renderOptions.Timeout = 120 ' seconds

' Increase the delay before rendering to ensure all assets are fully loaded
renderOptions.WaitFor.RenderDelay(3000) ' milliseconds (3 seconds)
$vbLabelText   $csharpLabel

查看以下文章以獲取有關超時和 RenderDelay 的更多信息。

超時

RenderDelay

要向我們的工程師提出服務請求請參見:工程請求 IronPDF

請注意從 2021.12.4995 版開始,IronPDF 的默認渲染超時時間為 60 秒。

Curtis Chau
技術作家

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

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

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