PDFConversionAPI · Schema

HtmlToPdfForm

The form for `html/to/pdf`: the parameters listed on https://pdfconversionapi.com/convert/html-to-pdf. Other parameters are sent as text.

CompanyPDFConversionDevelopers

Properties

Name Type Description
File string The file to convert. Its name becomes the output's name, with the new extension.
PageSize string Paper size. Letter is 8.5 x 11 in; names are matched in any case. Values: `a0` to `a9`, `b0` to `b5`, `letter`, `legal`, `ledger`. Default: letter.
PageOrientation string Which way the paper is turned. Turning it sideways swaps width and height, so Letter prints at 11 x 8.5 in.
PageWidth integer Custom paper width in millimeters. Replaces the width that `PageSize` sets. Values: 10 to 30000 (mm).
PageHeight integer Custom paper height in millimeters. Replaces the height that `PageSize` sets. Values: 10 to 30000 (mm).
MarginTop integer Top margin in millimeters. A Header template prints inside it. Values: 0 to 500 (mm).
MarginRight integer Right margin in millimeters. Values: 0 to 500 (mm).
MarginBottom integer Bottom margin in millimeters. A Footer template prints inside it. Values: 0 to 500 (mm).
MarginLeft integer Left margin in millimeters. If the margins leave no room for content, the request gets a 400. Values: 0 to 500 (mm).
PageRange string 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 r
Header string 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 e
Footer string 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 string 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 string CSS selector. Matching elements are left out of the PDF (display: none).
AvoidBreakElements string CSS selector. Page breaks avoid falling inside matching elements, such as a totals block or a signature box.
BreakBeforeElements string CSS selector. Each matching element starts on a new page.
BreakAfterElements string CSS selector. A new page starts after each matching element.
UserCss string Extra CSS applied after the page's own style sheets. Handy for print tweaks you don't want in the page itself.
JavaScript boolean Set to `false` to print a page that contains scripts without running them. The page then stays in the in-process engine.
UserJs string `JavaScript` to run in the page after it loads and before it is printed. The request goes to the browser engine.
WaitElement string 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 tim
ConversionDelay integer 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. Values: 0 to 30 (seconds
Background boolean Print background colors and images. `false` sends the page to the browser engine, which prints without them.
Scale integer 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. Values: 10 to 200 (%).
RespectViewport boolean `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
ViewportWidth integer 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. V
ViewportHeight integer Browser window height in CSS pixels, which scripts read as innerHeight. Not used by the in-process engine. Values: 200 to 4000 (px).
FileName string Name for the PDF, without the extension. Without it the PDF takes the uploaded file's name.
StoreFile boolean Return a download link instead of the file. The link expires after 3 hours.
View JSON Schema on GitHub

JSON Schema

pdfconversionapi-com-html-to-pdf-form-schema.json Raw ↑
{
  "$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"
  }
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/pdfconversionapi-com-html-to-pdf-form"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.