DEV Community

GuGuData
GuGuData

Posted on

HTML 转 PDF API 接口

HTML 转 PDF API 接口

支持网页转 PDF。

gugudata_api_cover

1. 产品功能

  • 超高性能转换效率;
  • 支持将传递的 HTML 转换为 PDF,支持转换 HTML 中的 CSS 格式;
  • 支持传递网站 URL,直接转换页面成对应的 PDF 文件;
  • 转换后的 PDF 提供永久存储文件地址;
  • 全接口支持 HTTPS(TLS v1.0 / v1.1 / v1.2 / v1.3);
  • 全面兼容 Apple ATS;
  • 全国多节点 CDN 部署;
  • 接口极速响应,多台服务器构建 API 接口负载均衡。

2. API 文档

API 详情地址: https://www.gugudata.com/api/details/html2pdf

接口请求地址: https://api.gugudata.com/imagerecognition/html2pdf

返回格式: application/json; charset=utf-8

请求方式: POST

请求协议: HTTPS

请求示例: https://api.gugudata.com/imagerecognition/html2pdf

数据预览: https://www.gugudata.com/preview/html2pdf

接口测试: https://api.gugudata.com/imagerecognition/html2pdf/demo

3. 请求参数

参数名 参数类型 是否必须 默认值 备注
appkey string YOUR_APPKEY 付费后获取的 APPKEY
type string YOUR_VALUE 可选参数为 HTML 或 URL
content string YOUR_VALUE 内容正文,如果 type=HTML,那么传递 HTML 内容;如果 type=URL,那么传递需要存储为 PDF 的站点 URL 即可

4. 返回参数

参数名 参数类型 备注
DataStatus.StatusCode int 接口返回状态码
DataStatus.StatusDescription string 接口返回状态说明
DataStatus.ResponseDateTime string 接口数据返回时间
DataStatus.DataTotalCount int 此条件下的总数据量,一般用于分页计算
Data string 转换后的 PDF 永久链接

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay