← 返回
未分类 Key 中文

Generate Image

Generate a PNG image from HTML content or a public URL using headless Chromium. Supports custom dimensions, retina quality, full-page screenshots, cookie con...
使用无头 Chromium 将 HTML 内容或公开 URL 生成PNG 图片,支持自定义尺寸、Retina 高清、全页面截图以及 Cookie 配置。
rishabhdugar rishabhdugar 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 488
下载
💾 0
安装
1
版本
#latest

概述

Generate Image

What It Does

Renders a webpage or HTML content to a PNG image using headless Chromium. Supports URL screenshots and HTML-to-image rendering with full customization.

When to Use

  • Take a screenshot of a live webpage
  • Render HTML/CSS to a PNG image (social cards, banners, certificates)
  • Generate full-page scrollable screenshots
  • Create retina-quality images with custom dimensions

Required Inputs

You must provide one of:

  • html_content — raw HTML string to render
  • url — a public URL to screenshot

Authentication

Send your API key in the CLIENT-API-KEY header.

Get your free API key at https://pdfapihub.com. Full API documentation is available at https://pdfapihub.com/docs.

Use Cases

  • Social Media Cards — Generate OG images, Twitter cards, or Instagram story images from HTML templates
  • Email Banners — Create personalized email header images with dynamic content
  • Website Screenshots — Capture full-page or viewport screenshots of live websites for monitoring or previews
  • Certificate Images — Render certificates as PNG images for sharing on social media
  • Product Mockups — Generate product images with dynamic text overlays
  • Thumbnail Generation — Create consistent thumbnail images for blog posts or video previews
  • QR Code Cards — Render HTML with embedded QR codes as shareable images

Key Options

ParameterDescription
------------------------
output_formaturl (default), base64, both, image/png/binary/file
width / heightOutput image dimensions in pixels
deviceScaleFactor1 (default), 2 for retina quality
full_pagetrue for full scrollable screenshot (URL mode)
wait_untilload, domcontentloaded, networkidle, commit
cookie_accept_textAuto-click cookie consent before screenshot
fontGoogle Font names, pipe-separated
dynamic_paramsKey-value object for {{placeholder}} replacement

Rate Limits

TierRequests/min
-------------------
Free/Basic/Pro10
Enterprise30
Business100

Example Usage

curl -X POST https://pdfapihub.com/api/v1/generateImage \
  -H "CLIENT-API-KEY: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "html_content": "<div style=\"padding:40px;background:#4F46E5;color:white;\"><h1>Hello {{name}}</h1></div>",
    "dynamic_params": { "name": "World" },
    "width": 800,
    "height": 400,
    "output_format": "url"
  }'

Notes

  • Files are automatically deleted after 30 days
  • Maximum output file size depends on your plan tier

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 09:01 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

PDF Parse

rishabhdugar
将 PDF 解析为结构化 JSON:包含文本、带有边界框的布局感知块、表格和图片元数据。
★ 0 📥 481

Document to PDF

rishabhdugar
通过PDFAPIHub云API将office文档(DOCX、DOC、PPT、PPTX、XLS、XLSX、CSV、TXT、ODT、RTF)转换为PDF,文档上传至pdfapihub.com完成转换。
★ 0 📥 805

Generate PDF from HTML

rishabhdugar
根据HTML内容或公开URL生成PDF文档,支持自定义页面尺寸、字体、页边距、视口尺寸、动态参数替换等功能。
★ 0 📥 728