You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Cloudconvert capture-website不响应zoom/page_width,如何捕获更大屏幕?

解决CloudConvert捕获网站API无法生成更大尺寸图片的问题

针对你调整page_width/page_height或zoom参数后生成的JPG无变化的问题,可通过以下正确的参数组合实现更大屏幕/完整页面的捕获:

方案1:捕获更大的固定视口

设置浏览器视口尺寸及对应输出图片尺寸,确保参数匹配:

curl -X POST https://api.cloudconvert.com/v2/capture-website \
-H "Authorization: Bearer xyz" \
-H "Content-type: application/json" \
-d '{
  "url": "https://zyx/",
  "viewport_width": 1920,
  "viewport_height": 1080,
  "page_width": 1920,
  "page_height": 1080,
  "zoom": 1.0,
  "output_format": "jpg"
}'
  • viewport_width/viewport_height:定义Chrome浏览器的初始窗口大小,决定捕获的可视区域范围
  • page_width/page_height:设置输出图片的最终像素尺寸,需与视口参数匹配避免拉伸或裁剪

方案2:捕获完整滚动页面

如果需要捕获整个页面(包括超出初始视口的滚动内容),启用full_page参数:

curl -X POST https://api.cloudconvert.com/v2/capture-website \
-H "Authorization: Bearer xyz" \
-H "Content-type: application/json" \
-d '{
  "url": "https://zyx/",
  "full_page": true,
  "viewport_width": 1920,
  "wait_until": "networkidle0",
  "output_format": "jpg"
}'
  • full_page: true:强制捕获整个可滚动页面内容
  • wait_until: "networkidle0":确保JavaScript渲染完成(无网络请求持续500ms后)再捕获,避免动态内容缺失

注意事项

  • 避免仅调整zoom参数:调小zoom只会缩放页面内容,不会增大输出尺寸,反而可能导致图片模糊
  • 确认参数名正确性:需使用API文档定义的viewport_width/viewport_height,而非自定义参数名

内容的提问来源于stack exchange,提问作者Aleksandr Levchuk

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.13 08:30:02