{
  "openapi": "3.0.1",
  "info": {
    "title": "HTML To PDF API",
    "description": "Convert HTML content and webpage URLs to high-quality PDF documents instantly. HTML to PDF converter with customizable page formats (A4, Letter), scale control, background graphics, and smart waiting for dynamic content. Perfect for reports, documentation, and automated PDF generation workflows.",
    "version": "1.0",
    "x-build-id": "A92l7GjRlF72jpjCq"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/igview-owner~html-to-pdf-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-igview-owner-html-to-pdf-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/igview-owner~html-to-pdf-api/runs": {
      "post": {
        "operationId": "runs-sync-igview-owner-html-to-pdf-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/igview-owner~html-to-pdf-api/run-sync": {
      "post": {
        "operationId": "run-sync-igview-owner-html-to-pdf-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "html": {
            "title": "📝 HTML Content",
            "type": "string",
            "description": "Paste your full HTML document here. Inline <style> tags and external assets (images, fonts) are supported. Maximum size: 5 MB. Either HTML or URL is required — not both."
          },
          "url": {
            "title": "🌐 Page URL",
            "type": "string",
            "description": "Enter a live webpage URL to render and convert to PDF (e.g., 'https://example.com'). The page will be fully loaded before conversion. Leave empty if you are providing HTML content above."
          },
          "filename": {
            "title": "📎 Output Filename",
            "type": "string",
            "description": "Name for the generated PDF file (without .pdf extension). For example, entering 'invoice' will produce 'invoice.pdf'.",
            "default": "document"
          },
          "format": {
            "title": "📐 Paper Size",
            "enum": [
              "A3",
              "A4",
              "A5",
              "Letter",
              "Legal",
              "Tabloid"
            ],
            "type": "string",
            "description": "Select the paper format for the PDF output.",
            "default": "A4"
          },
          "orientation": {
            "title": "🔄 Page Orientation",
            "enum": [
              "portrait",
              "landscape"
            ],
            "type": "string",
            "description": "Choose between portrait (vertical) or landscape (horizontal) page layout.",
            "default": "portrait"
          },
          "marginTop": {
            "title": "⬆️ Top Margin",
            "type": "string",
            "description": "Top margin with CSS units (e.g., '15mm', '0.5in', '40px').",
            "default": "15mm"
          },
          "marginRight": {
            "title": "➡️ Right Margin",
            "type": "string",
            "description": "Right margin with CSS units (e.g., '15mm', '0.5in', '40px').",
            "default": "15mm"
          },
          "marginBottom": {
            "title": "⬇️ Bottom Margin",
            "type": "string",
            "description": "Bottom margin with CSS units (e.g., '15mm', '0.5in', '40px').",
            "default": "15mm"
          },
          "marginLeft": {
            "title": "⬅️ Left Margin",
            "type": "string",
            "description": "Left margin with CSS units (e.g., '15mm', '0.5in', '40px').",
            "default": "15mm"
          },
          "printBackground": {
            "title": "🎨 Print Background",
            "type": "boolean",
            "description": "Include CSS background colors and images in the PDF output.",
            "default": true
          },
          "scale": {
            "title": "🔍 Rendering Scale",
            "minimum": 0.1,
            "maximum": 2,
            "type": "number",
            "description": "Scale of the webpage rendering (0.1 to 2). Use values less than 1 to zoom out, greater than 1 to zoom in.",
            "default": 1
          },
          "displayHeaderFooter": {
            "title": "📑 Show Header/Footer",
            "type": "boolean",
            "description": "Enable header and footer rendering on every page. Keep margins ≥ 20mm so they are not clipped.",
            "default": false
          },
          "headerTemplate": {
            "title": "⬆️ Header Template",
            "type": "string",
            "description": "Inline-styled HTML shown at the top of every page. Must include explicit font-size. Example: <div style=\"font-size:8px;width:100%;text-align:center;\">My Header</div>"
          },
          "footerTemplate": {
            "title": "⬇️ Footer Template",
            "type": "string",
            "description": "Inline-styled HTML shown at the bottom of every page. Supports special classes: pageNumber, totalPages, date. Example: <div style=\"font-size:8px;width:100%;text-align:center;\"><span class=\"pageNumber\"></span> / <span class=\"totalPages\"></span></div>"
          },
          "pageRanges": {
            "title": "📄 Page Ranges",
            "type": "string",
            "description": "Print only selected pages (e.g., '1-3,5'). Leave empty to print all pages."
          },
          "emulateMedia": {
            "title": "🖥️ Emulate Media",
            "enum": [
              "print",
              "screen"
            ],
            "type": "string",
            "description": "Emulate CSS media type during rendering. 'print' uses print stylesheets, 'screen' uses screen stylesheets.",
            "default": "print"
          },
          "waitUntil": {
            "title": "⏳ Wait Until",
            "enum": [
              "load",
              "domcontentloaded",
              "networkidle0",
              "networkidle2"
            ],
            "type": "string",
            "description": "When to consider the page fully loaded: 'load' (default), 'domcontentloaded', 'networkidle0' (no connections for 500ms), 'networkidle2' (≤2 connections for 500ms).",
            "default": "load"
          },
          "timeout": {
            "title": "⏱️ Render Timeout (ms)",
            "minimum": 1000,
            "maximum": 60000,
            "type": "integer",
            "description": "Maximum time in milliseconds to wait for the page to render (1000–60000).",
            "default": 30000
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}