five

HTML to PDF

收藏
RapidAPI2025-09-10 更新2025-08-02 收录
下载链接:
https://rapidapi.com/VoidSpace/api/html-to-pdf31
下载链接
链接失效反馈
官方服务:
资源简介:
The HTML to PDF API lets developers easily convert raw HTML strings or webpages into high-quality PDFs. Perfect for invoices, reports, and printable documents. Customize output with page size (A4, Letter, etc.), scaling, and background options. Lightweight, fast, and reliable – ideal for production-grade workflows
创建时间:
2025-09-10
原始信息汇总

HTML to PDF API 数据集概述

基本信息

  • API名称: HTML to PDF
  • 类别: Business Software
  • 提供商: VoidSpace
  • 订阅人数: 2
  • 基础URL: https://html-to-pdf31.p.rapidapi.com/

功能描述

  • 将原始HTML字符串或网页转换为高质量的PDF文件。
  • 适用于发票、报告和可打印文档。
  • 支持自定义输出,包括页面大小(A4、Letter等)、缩放和背景选项。

认证方式

  • 认证类型: RapidAPI密钥认证
  • 必需请求头:
    • X-RapidAPI-Key: YOUR_RAPIDAPI_KEY
    • X-RapidAPI-Host: html-to-pdf31.p.rapidapi.com
    • Content-Type: application/json

端点

  • 方法: POST
  • 路径: /html2pdf.php

请求参数

示例1: 将HTML字符串转换为PDF

json { "pdf": { "format": "A4" }, "source": { "html": "<!DOCTYPE html><html><body><h1>Hello PDF</h1><p>This is from HTML string</p></body></html>" } }

示例2: 将URL转换为PDF

json { "pdf": { "format": "A4" }, "source": { "url": "https://example.com" } }

响应

  • 返回二进制PDF数据。
  • 浏览器或客户端可设置以下响应头以下载文件:
    • Content-Type: application/pdf
    • Content-Disposition: attachment; filename="document.pdf"

支持的页面格式

["A0","A1","A2","A3","A4","A5","A6","A7","A8","A9", "B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","B10", "C5E","Comm10E","DLE","Executive","Folio", "Ledger","Legal","Letter","Tabloid"]

注意事项

  • source可以包含htmlurl(不能同时包含)。
  • 默认pdf.format为A4(如果未指定)。
  • 输出为PDF文件流(非JSON格式)。

cURL示例

bash curl --request POST --url https://html-to-pdf31.p.rapidapi.com/html2pdf.php --header X-RapidAPI-Key: YOUR_RAPIDAPI_KEY --header X-RapidAPI-Host: YOUR_PROJECT_NAME.p.rapidapi.com --header Content-Type: application/json --data { "pdf": { "format": "A4" }, "source": { "html": "<html><body><h1>Hello PDF</h1></body></html>" } } --output result.pdf

订阅计划

  • BASIC: $0.00 / mo
  • PRO: $8.00 / mo
  • ULTRA: $30.00 / mo
  • MEGA: $50.00 / mo
搜集汇总
数据集介绍
main_image_url
背景与挑战
背景概述
该数据集提供了一个HTML转PDF的API工具,可将原始HTML字符串或网页高效转换为高质量的PDF文档,适用于发票、报告等可打印文件。它支持自定义页面尺寸、缩放和背景选项,具有轻量、快速和可靠的特点,适合生产级工作流程。
以上内容由遇见数据集搜集并总结生成
5,000+
优质数据集
54 个
任务类型
进入经典数据集
二维码
社区交流群

面向社区/商业的数据集话题

二维码
科研交流群

面向高校/科研机构的开源数据集话题

数据驱动未来

携手共赢发展

商业合作