解決IronPDF中的渲染超時問題

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

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

對於圖像資產較多或需要額外時間渲染的輸入,建議調整RenderDelay時間。 這允許資產在產生PDF之前完整地虛擬渲染。 若未這樣做,可能會導致PDF文件中缺少資產甚至空白PDF。

要覆蓋預設設定,請在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

查看以下文章以獲取有關Timeout和RenderDelay的更多資訊。

超時

RenderDelay

欲向我們的工程師提出服務請求,請參閱:工程請求IronPDF

請注意從版本2021.12.4995開始,IronPDF的預設渲染超時是60秒。

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。