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类中调整Timeout时长,并通过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

查看以下文章以获取有关Timeout和RenderDelay的更多信息。

Timeout

RenderDelay

如需向我们的工程师提交服务请求,请参阅:工程请求IronPDF

请注意从版本2021.12.4995开始,IronPDF的默认渲染超时时间为60秒。

Curtis Chau
技术作家

Curtis Chau 拥有卡尔顿大学的计算机科学学士学位,专注于前端开发,精通 Node.js、TypeScript、JavaScript 和 React。他热衷于打造直观且美观的用户界面,喜欢使用现代框架并创建结构良好、视觉吸引力强的手册。

除了开发之外,Curtis 对物联网 (IoT) 有浓厚的兴趣,探索将硬件和软件集成的新方法。在空闲时间,他喜欢玩游戏和构建 Discord 机器人,将他对技术的热爱与创造力相结合。

准备开始了吗?
Nuget 下载 16,154,058 | 版本: 2025.11 刚刚发布