{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pdfconversionapi-com/json-schema/pdfconversionapi-com-html-to-pdf-form-schema.json",
  "title": "HtmlToPdfForm",
  "description": "The form for `html/to/pdf`: the parameters listed on https://pdfconversionapi.com/convert/html-to-pdf. Other parameters are sent as text.",
  "x-generated": "2026-12-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pdfconversionapi-com-openapi.json#/components/schemas/HtmlToPdfForm",
  "type": "object",
  "required": [
    "File"
  ],
  "properties": {
    "File": {
      "type": "string",
      "format": "binary",
      "contentMediaType": "application/octet-stream",
      "description": "The file to convert. Its name becomes the output's name, with the new extension."
    },
    "PageSize": {
      "type": "string",
      "description": "Paper size. Letter is 8.5 x 11 in; names are matched in any case.\n\nValues: `a0` to `a9`, `b0` to `b5`, `letter`, `legal`, `ledger`.\n\nDefault: letter."
    },
    "PageOrientation": {
      "type": "string",
      "enum": [
        "portrait",
        "landscape"
      ],
      "default": "portrait",
      "description": "Which way the paper is turned. Turning it sideways swaps width and height, so Letter prints at 11 x 8.5 in."
    },
    "PageWidth": {
      "type": "integer",
      "minimum": 10,
      "maximum": 30000,
      "description": "Custom paper width in millimeters. Replaces the width that `PageSize` sets.\n\nValues: 10 to 30000 (mm)."
    },
    "PageHeight": {
      "type": "integer",
      "minimum": 10,
      "maximum": 30000,
      "description": "Custom paper height in millimeters. Replaces the height that `PageSize` sets.\n\nValues: 10 to 30000 (mm)."
    },
    "MarginTop": {
      "type": "integer",
      "minimum": 0,
      "maximum": 500,
      "default": 10,
      "description": "Top margin in millimeters. A Header template prints inside it.\n\nValues: 0 to 500 (mm)."
    },
    "MarginRight": {
      "type": "integer",
      "minimum": 0,
      "maximum": 500,
      "default": 10,
      "description": "Right margin in millimeters.\n\nValues: 0 to 500 (mm)."
    },
    "MarginBottom": {
      "type": "integer",
      "minimum": 0,
      "maximum": 500,
      "default": 10,
      "description": "Bottom margin in millimeters. A Footer template prints inside it.\n\nValues: 0 to 500 (mm)."
    },
    "MarginLeft": {
      "type": "integer",
      "minimum": 0,
      "maximum": 500,
      "default": 10,
      "description": "Left margin in millimeters. If the margins leave no room for content, the request gets a 400.\n\nValues: 0 to 500 (mm)."
    },
    "PageRange": {
      "type": "string",
      "description": "Keep only these pages of the printed result. `last` is the last page, so `2-last` and `2-` both run to the end. A range may end past the last page and stops there; a page or range start past the end returns 400, such as \"PageRange asks for page 5, but the document has 3 pages\".\n\nValues: e.g. `1-3,5`, `2-` or `2-last`."
    },
    "Header": {
      "type": "string",
      "description": "HTML template printed in the top margin of every page. Elements with the class `pageNumber` or `totalPages` are filled in. A template that uses `title`, `date` or `url` sends the page to the browser engine, which fills those too. Since the page is uploaded, `url` prints the placeholder address `http://document.invalid/`, not where the page came from."
    },
    "Footer": {
      "type": "string",
      "description": "HTML template for the bottom margin, with the same placeholders as `Header`. The template does not inherit the page's CSS, so give it its own font and size."
    },
    "CssMediaType": {
      "type": "string",
      "enum": [
        "screen",
        "print"
      ],
      "default": "screen",
      "description": "Which `@media` rules apply. A page that has `@media` rules is printed by the browser engine with the default `screen` value; with `print` it stays in the in-process engine, which applies print rules."
    },
    "HideElements": {
      "type": "string",
      "description": "CSS selector. Matching elements are left out of the PDF (display: none)."
    },
    "AvoidBreakElements": {
      "type": "string",
      "description": "CSS selector. Page breaks avoid falling inside matching elements, such as a totals block or a signature box."
    },
    "BreakBeforeElements": {
      "type": "string",
      "description": "CSS selector. Each matching element starts on a new page."
    },
    "BreakAfterElements": {
      "type": "string",
      "description": "CSS selector. A new page starts after each matching element."
    },
    "UserCss": {
      "type": "string",
      "description": "Extra CSS applied after the page's own style sheets. Handy for print tweaks you don't want in the page itself."
    },
    "JavaScript": {
      "type": "boolean",
      "default": true,
      "description": "Set to `false` to print a page that contains scripts without running them. The page then stays in the in-process engine."
    },
    "UserJs": {
      "type": "string",
      "description": "`JavaScript` to run in the page after it loads and before it is printed. The request goes to the browser engine."
    },
    "WaitElement": {
      "type": "string",
      "description": "CSS selector to wait for before printing, for pages that build their content with scripts. The request goes to the browser engine. If the element never appears, the request fails with 400 when the time limit runs out."
    },
    "ConversionDelay": {
      "type": "integer",
      "minimum": 0,
      "maximum": 30,
      "default": 0,
      "description": "Seconds to wait after the page loads before printing. It applies to pages printed by the browser engine; a page without scripts has nothing to wait for and is printed at once.\n\nValues: 0 to 30 (seconds)."
    },
    "Background": {
      "type": "boolean",
      "default": true,
      "description": "Print background colors and images. `false` sends the page to the browser engine, which prints without them."
    },
    "Scale": {
      "type": "integer",
      "minimum": 10,
      "maximum": 200,
      "default": 100,
      "description": "Zoom for the printed page, like the scale box in a browser's print dialog. Any value other than 100 is printed by the browser engine.\n\nValues: 10 to 200 (%)."
    },
    "RespectViewport": {
      "type": "boolean",
      "default": false,
      "description": "`true` lays the page out at `ViewportWidth`, as on a desktop screen, and shrinks it to fit the paper (printed by the browser engine). The default lays the page out for the paper width, as a browser's Save as PDF does. ConvertAPI defaults to `true`, so send `RespectViewport=true` if you are moving from there and want the same layout."
    },
    "ViewportWidth": {
      "type": "integer",
      "minimum": 200,
      "maximum": 4000,
      "default": 1366,
      "description": "Browser window width in CSS pixels. Scripts read it as innerWidth, and `RespectViewport=true` lays the page out at this width. The in-process engine lays pages out for the paper and does not use it.\n\nValues: 200 to 4000 (px)."
    },
    "ViewportHeight": {
      "type": "integer",
      "minimum": 200,
      "maximum": 4000,
      "default": 1024,
      "description": "Browser window height in CSS pixels, which scripts read as innerHeight. Not used by the in-process engine.\n\nValues: 200 to 4000 (px)."
    },
    "FileName": {
      "type": "string",
      "description": "Name for the PDF, without the extension. Without it the PDF takes the uploaded file's name."
    },
    "StoreFile": {
      "type": "boolean",
      "default": false,
      "description": "Return a download link instead of the file. The link expires after 3 hours."
    }
  },
  "additionalProperties": {
    "type": "string"
  }
}