API Playground

Test the HTML to PDF conversion API with live examples and see the code

HTML Input

Enter or paste your HTML content

54 lines
1,522 chars

PDF Options

Configure your PDF output settings

Generate PDF

Create your PDF with the current settings

Code Examples

Use these snippets to integrate the API

curl -X POST https://api.htmltopdf.ac/api/convert \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "html": "<!DOCTYPE html>\n<html lang="en">\n<head>\n    <meta ...",
    "options": {
      "format": "A4",
      "orientation": "portrait",
      "margin": {
        "top": "1cm",
        "right": "1cm",
        "bottom": "1cm",
        "left": "1cm"
      },
      "printBackground": true
    }
  }' \
  --output document.pdf