HTML to PDF

👤 rishabhdugar 📦 v1.0.0 ⭐ 4.5 ⬇️ 636 下載
📄 辦公效率 免費 🔑 需 API Key

📖 技能介紹


name: PDF API Hub slug: pdf-api-hub version: 1.0.0 homepage: https://pdfapihub.com/ description: "Use when: integrating with PDF API Hub REST APIs for document automation — HTML/URL to PDF, merge, split, compress, OCR, watermark, sign, lock/unlock, convert, screenshot, parse, and file management via pdfapihub.com." metadata: {"clawdbot":{"emoji":"📑","requires":{"bins":[]},"os":["linux","darwin","win32"]}}


When to Use

User needs to call PDF API Hub endpoints (pdfapihub.com/api/v1/...) for document automation: generating PDFs from HTML/URLs, merging, splitting, compressing, OCR, watermarking, signing, encrypting/decrypting, converting between PDF and images, parsing/extracting text and tables, or managing uploaded files.

Scope

7w4.net提供免費和付費技能下載。

This skill ONLY: - Provides endpoint reference, request/response contracts, and integration patterns for the PDF API Hub REST API - Shows code examples in multiple languages (cURL, Python, Node.js, etc.) - Explains authentication, error handling, and output format options

This skill NEVER: - Executes API calls or generates files directly - Stores or transmits API keys - Accesses files outside the user's working directory

All code examples are reference patterns for the user to implement.

Quick Reference

Topic File
All endpoints & parameters endpoints.md
Code examples by use case examples.md
Advanced workflows advanced.md

Authentication

Every request requires the CLIENT-API-KEY header.

CLIENT-API-KEY: <your-api-key>
Content-Type: application/json

Get your API key at pdfapihub.com/signup.

Base URL

https://pdfapihub.com/api/v1/

All endpoints use POST with JSON body.

Endpoint Map

# Category Endpoint Path What it does
1 Document Generate PDF /generatePdf Render HTML or capture any webpage as a PDF
2 Document Parse PDF /pdf/parse Extract text, tables, or structured layout data
3 Document Merge PDFs /pdf/merge Combine multiple PDFs into one
4 Document Split PDF /pdf/split Split a PDF into pages, ranges, or chunks
5 Document Compress PDF /compressPdf Shrink file size (4 compression levels)
6 Document PDF Info /pdf/info Get metadata and page info from a PDF
7 Document Watermark /watermark Overlay text/logo watermarks on pages
8 Document Sign PDF /sign-pdf Stamp a signature image on PDF pages
9 Security Lock PDF /lockPdf AES-256 encryption with granular permissions
10 Security Unlock PDF /unlockPdf Remove password protection
11 Conversion Generate Image /generateImage Capture URL/HTML as PNG image
12 Conversion Compress Image /compressImage Reduce image file size
13 Conversion PDF to Image /pdfToImage Render PDF pages as PNG/JPG/WebP
14 Conversion Image to PDF /imageToPdf Combine images into a PDF
15 OCR PDF OCR /pdfOcr Extract text from scanned PDF documents
16 OCR Image OCR /imageOcr Extract text from photos/images
17 Utility URL to HTML /urlToHtml Fetch fully-rendered HTML via headless browser
18 File Mgmt Upload File /uploadFile Upload a file to cloud storage
19 File Mgmt List Files /listFiles List uploaded files
20 File Mgmt Delete File /deleteFile Delete an uploaded file
21 Templates Create Template /createTemplate Save a reusable HTML template
22 Templates List Templates /listTemplates List saved templates
23 Templates Delete Template /deleteTemplate Delete a saved template

Output Formats

Most endpoints support the output_format parameter:

Value Description
url Returns a hosted CDN URL (default)
file Returns the file as a download
base64 Returns base64-encoded content
binary Returns raw binary stream
pdf Returns PDF file directly

Error Handling

HTTP Code Meaning Action
400 Invalid Request Check JSON body shape and required fields
401 Unauthorized Verify CLIENT-API-KEY header
422 Validation Failed Check URL/HTML/options for conflicts
429 Rate Limited Back off and retry with exponential delay
500 Internal Error Retry; contact support if persistent

Common Response Shape

{
  "success": true,
  "pdf_url": "https://cdn.pdfapihub.com/pdf/a1b2c3d4.pdf",
  "file_size_bytes": 84321,
  "file_deletion_date": "2026-05-04",
  "source_type": "html"
}

Core Rules

1. Always Set output_format Explicitly

{ "output_format": "url" }

Don't rely on defaults — be explicit about whether you need a URL, file, or base64.

2. Use html_content for Dynamic Documents

{
  "html_content": "<h1>Invoice #{{number}}</h1>",
  "css_content": "h1 { color: #333; }",
  "dynamic_params": { "number": "INV-001" }
}

3. Use url for Webpage Capture

{
  "url": "https://example.com/report",
  "wait_until": "networkidle",
  "paper_size": "A4"
}

4. Handle Files via URL or Upload

For endpoints that operate on existing PDFs (merge, split, compress, etc.), provide files via: - Direct URL to the PDF - Previously uploaded file reference via the Upload File endpoint

5. Validate Responses

Always check success: true in the response before using the result.

Common Traps

Trap Consequence Fix
Missing CLIENT-API-KEY header 401 error Always include the header
Sending both url and html_content Undefined behavior Use one or the other
Not setting wait_until for SPAs Incomplete capture Use networkidle for JS-heavy pages
Ignoring file_deletion_date Broken links after expiry Download/store files before deletion
Large HTML without pagination Timeout or huge PDF Use page_size to limit output

Security & Privacy

  • All API calls go to pdfapihub.com over HTTPS
  • API keys should be stored in environment variables, never hardcoded
  • Files hosted on CDN have an expiration date — download promptly
  • This skill provides reference patterns only; it does not execute code or store credentials

Feedback

🤖 AI 評測

這是一個文件質量較高的 PDF 處理 API 參考工具,涵蓋了生成、合併、壓縮、OCR、簽名等常用 PDF 操作。文件分類清晰,程式碼示例豐富,語言通俗易懂,認證和錯誤處理說明完善,對新手友好。不足之處在於僅有靜態文件,沒有可執行的程式碼示例,部分高階引數的說明稍顯簡略,需要結合官方文件補充閱讀。

📊 多維度評分

適應性4.5
規範性4.4
有效性4.7
可靠性4.3
可信度4.3

📁 包含檔案 (6 個)

📄 EXTRA_FILES.txt 37 B
📄 SKILL.md 6.4 KB
📄 _meta.json 130 B
📄 advanced.md 9.3 KB
📄 endpoints.md 11.3 KB
📄 examples.md 12.3 KB