360 Secure SkillHub
360 安全技能中心

PDF to Image

通过 pdfapihub 外部 API 将 PDF 指定页面渲染为 PNG、JPG 或 WebP 图片,支持 DPI(72–300)、尺寸缩放、背景色填充、页码范围选择以及 URL、base64、文件等输出方式,单次最多 100 页,请求需在头部携带 API key。

rishabhdugar
rishabhdugar
热度 48.32
最近更新 2026-05-11 17:44:03
分类:效率依赖:第三方 API应用场景:文件转换

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add pdf-to-image
Metadata
name
pdf-to-image
description
Convert PDF pages to images (PNG, JPG, or WebP). Supports DPI control, resize, background color, and page selection.

PDF to Image

What It Does

Renders selected pages of a PDF as images in PNG, JPG, or WebP format. Supports DPI control, resize dimensions, background color fill, and multiple output modes.

When to Use

  • Generate thumbnail previews of PDF pages
  • Convert PDF pages to images for social media (OG images)
  • Create high-DPI images for print
  • Extract specific pages as images

Required Inputs

Provide one of:

  • url — public URL to a PDF
  • file — base64-encoded PDF
  • Multipart upload with file field

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

  • PDF Thumbnails — Generate preview thumbnails for document management systems
  • Social Media Previews — Create OG images (1200×630) from the first page of a PDF
  • E-commerce Product Sheets — Convert product PDF spec sheets into gallery images
  • Document Previews — Show image previews of PDFs in web apps without embedding a PDF viewer
  • Print-Ready Exports — Export PDF pages as high-DPI images for print workflows
  • Slide Extraction — Extract individual slides from PDF presentations as images

Key Options

Parameter Description
page / pages Single page or range (e.g. "1-5")
image_format png (default), jpg, webp
dpi 72–300 (default 150)
width / height Resize output dimensions
background_color Fill transparent areas (hex)
output url, base64, both, file

Limits

  • Max 100 pages per request
  • DPI range: 72–300
  • Max resize dimension: 10000 px

Example Usage

curl -X POST https://pdfapihub.com/api/v1/convert/pdf/image \
  -H "CLIENT-API-KEY: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://pdfapihub.com/sample-pdfapi-intro.pdf",
    "pages": "1-3",
    "image_format": "jpg",
    "dpi": 200,
    "output": "url"
  }'