HTML/URL to PDF API

发布于:2025-07-16 ⋅ 阅读:(20) ⋅ 点赞:(0)

HTML/URL to PDF API

Category: Image Recognition
Endpoint: /v1/imagerecognition/html2pdf
Method: POST
Description: Converts HTML content or a given URL into a PDF file.

Overview

在这里插入图片描述

The HTML to PDF API by GuGuData is a powerful web-to-PDF conversion solution designed to transform both raw HTML content and live web pages into downloadable PDF files. Leveraging a multi-node CDN infrastructure, the service ensures high-speed document rendering, rapid response times, and rock-solid reliability. Each generated PDF is assigned a permanent storage link, making it easy to access, share, and integrate into your long-term workflow.

Key benefits include:

  • Superior performance: Efficiently handles complex HTML structures and large documents with minimal latency.
  • Flexible content input: Supports both direct HTML and URL-based conversions.
  • Permanent PDF links: Quickly retrieve or share your converted documents without reprocessing.
  • HTTPS/TLS support: Secure end-to-end encryption, meeting Apple ATS requirements.
  • Scalable load balancing: Manages high-volume traffic with stable performance.
  • CDN-optimized deployment: Ensures low-latency connections across multiple data centers.

This endpoint is ideal for a wide range of use cases — from automating marketing materials to bulk PDF creation and document archiving.

Request URL

POST https://api.gugudata.io/v1/imagerecognition/html2pdf

You can test the API directly using our demo endpoint:

https://api.gugudata.io/v1/imagerecognition/html2pdf/demo

Request Parameters

Below are the key parameters expected by the HTML to PDF API.

Parameter Type Required Default Value Description
appkey string Yes YOUR_APPKEY The APPKEY you obtain from the GuGuData Developer Center.
type string Yes YOUR_VALUE Possible values: HTML or URL. If type=URL, ensure the page can be accessed without encryption or anti-crawling blockers.
content string Yes YOUR_VALUE The content to be converted into PDF. If type=HTML, pass in your HTML. If type=URL, pass in the webpage URL to be converted.
landscape int No 0 Determines PDF orientation. Pass 1 for landscape mode; otherwise, default is 0 (portrait).

Response Parameters

The response from the HTML to PDF API includes the following fields:

Parameter Type Required Description
DataStatus.StatusCode int Yes The status code of the API response.
DataStatus.StatusDescription string Yes A brief description of the API response status.
DataStatus.ResponseDateTime string Yes The timestamp when the data is returned.
DataStatus.DataTotalCount int Yes The total data volume matching the request (useful for pagination).
Data string Yes The permanent link to the generated PDF file.

Error Codes

Below are common error codes you may encounter when using this API:

Error Code Error Content Notes
100 Normal return The request was successful.
101 Parameter error Possibly an issue with the supplied parameters.
102 Request frequency limited Rate-limiting triggered; cannot exceed 100 requests/second.
103 Account overdue Your account needs to be updated or reactivated.
104 Incorrect APPKEY Check that your APPKEY matches your Developer Center credentials.
110 Interface response error A general error indicating an unexpected issue with the API.

Features

  1. Superior performance conversion efficiency – Easily handle complex web pages or large HTML templates.
  2. HTML + CSS – Render styles accurately, preserving your site’s visual layout in the PDF.
  3. URL direct conversion – Provide any public URL; the API automatically fetches and converts it.
  4. Permanent file links – Access your PDF results any time without re-uploading or reprocessing.
  5. HTTPS (TLS) support – Data privacy and security are maintained through modern TLS protocols.
  6. Fully Apple ATS-compatible – Ensures smooth integration for iOS/macOS apps.
  7. Multi-node CDN deployment – Experience consistent speeds from geographically diverse servers.
  8. Load-balanced architecture – Reliably process high volumes of PDF requests without downtime.

Additional Notes for Developers

  • Accessibility: Make sure your HTML or target URLs are publicly reachable to the API service.
  • Landscape parameter: Perfect for wide layouts like certificates, charts, or spreadsheets.
  • High availability: GuGuData’s robust network topology guarantees minimal downtime and near-instant response.

Getting Started

  1. Sign up at GuGuData.io – Create an account to obtain your unique appkey.
  2. Send a POST request – Include all necessary parameters in your request body.
  3. Parse the response – Check the DataStatus fields for success codes, then access your PDF via the Data link.
  4. Integrate – Automate or incorporate PDF generation into any project, from online forms to marketing collateral.

About GuGuData

GuGuData is a leading data solutions and API provider, serving businesses for nearly a decade. We have curated an extensive data hub and offer thousands of specialized APIs, spanning from SSL Certificate Info to Image Recognition and beyond. Our continuous focus on data organization, cleaning, and integration ensures modern enterprises and developers have access to reliable, cutting-edge tools.

Key highlights:

  • Nine years in business – Delivering proven, stable solutions over almost a decade.
  • 4.2k+ APIs – A vast library of functionality and data.
  • 95% happy customers – Trusted by a broad spectrum of enterprises, researchers, and developers.

Whether you’re looking to convert web pages into PDF documents for marketing, compliance, or records management, the HTML to PDF API empowers you to do it seamlessly and reliably. Check out our official website for more innovative data-driven solutions.


网站公告

今日签到

点亮在社区的每一天
去签到