{"success":true,"url":"https://pub-6db99bab215e44889f46c4b2a619f8c5.r2.dev/html_to_pdf/20260619/79d194ed-dfd7-42a0-8d27-51c71eec225b.pdf","source":"html","page_format":"A4","output_bytes":13372,"processing_time":"1484ms"}
curl --location --request POST 'https://zylalabs.com/api/12962/html+and+url+to+pdf+converter+api/25879/convert+html+or+url+to+pdf' --header 'Authorization: Bearer YOUR_API_KEY'
--data-raw '{
"html": "Invoice 1024
Amount due: $499.00
",
"page_format": "A4"
}'
注册后,每个开发者都会被分配一个个人 API 访问密钥,这是一个唯一的字母和数字组合,用于访问我们的 API 端点。要使用 HTML和URL转PDF转换器 API 进行身份验证,只需在 Authorization 标头中包含您的 bearer token。
| 标头 | 描述 |
|---|---|
授权
|
必需
应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。
|
无长期承诺。随时升级、降级或取消。 免费试用包括最多 50 个请求。
(年度计费可节省 2 个月 🎉)
The endpoint returns a structured JSON response containing a success status, a secure URL to the generated PDF, the source of the content (HTML or URL), the page format used, the size of the output in bytes, and the processing time taken for the conversion.
The key fields in the response data include "success" (boolean), "url" (string), "source" (string), "page_format" (string), "output_bytes" (integer), and "processing_time" (string). These fields provide essential information about the conversion result.
Users can customize their requests by specifying parameters such as the HTML string or URL to convert, page format (e.g., A4, Letter), margins, orientation (landscape or portrait), and scaling options. These parameters allow for tailored PDF generation.
响应数据以JSON格式组织,以键值对表示转换结果 这种结构允许用户轻松访问特定信息,例如PDF网址和处理细节,以便在应用程序中进一步使用
Typical use cases include generating invoices, reports, tickets, contracts, and receipts from HTML content or URLs. It is also useful for archiving web content, creating certificates, and automating document generation workflows in various applications.
Users can utilize the returned data by accessing the "url" field to download the generated PDF. The "processing_time" can help assess performance, while the "output_bytes" field indicates the file size, which can be useful for storage considerations.
数据准确性通过使用真实的无头Chromium引擎来维持,该引擎按现代网页浏览器中显示的方式呈现HTML或URL内容。这确保生成的PDF与原始内容的外观紧密匹配
Standard data patterns include a "success" field indicating whether the conversion was successful, a valid "url" for the PDF, and consistent values for "page_format" and "output_bytes." Users can expect these patterns for reliable integration into their applications.