HtmlToPngForm
The form for `html/to/png`, `html/to/jpg`: the parameters listed on https://pdfconversionapi.com/convert/html-to-png. Other parameters are sent as text.
Properties
| Name | Type | Description |
|---|---|---|
| File | string | The file to convert. Its name becomes the output's name, with the new extension. |
| ViewportWidth | integer | Width the page is laid out at, in CSS pixels. The image is this wide unless you crop, zoom or resize it. Values: 200 to 4000 (px). |
| ViewportHeight | integer | Browser window height. A browser engine capture is at least this tall; the in-process engine ignores it and captures the content's own height. Values: 200 to 4000 (px). |
| CropX | integer | Left edge of the area to keep, counted from the left of the page. Values: 0 to 16384 (px). |
| CropY | integer | Top edge of the area to keep, counted from the top of the page. A crop that starts outside the page returns 400. Values: 0 to 16384 (px). |
| CropWidth | integer | Width of the area to keep. Values: 1 to 16384 (px). |
| CropHeight | integer | Height of the area to keep. It cuts and never pads: in the in-process engine, a page shorter than `CropHeight` comes out at its own height. Values: 1 to 16384 (px). |
| CropElement | string | CSS selector. The image is cut to the border box of the first matching element. Captured by the browser engine; a selector that matches nothing returns 400. |
| Zoom | number | CSS zoom applied to the whole page. Captured by the browser engine. Double `ViewportWidth` and set `Zoom=2` for a sharp 2x image. |
| TransparentBackground | boolean | Where the page paints no background, leave the PNG transparent instead of white. JPG has no transparency, so those areas are filled with white, or with `BackgroundColor`. |
| BackgroundColor | string | JPG only: the color that fills transparent areas when `TransparentBackground=true`. A value that is not a color returns 400. Values: `#RRGGBB`, `R,G,B`, `white`, `black`, `red`, `green`, `blue`, `gray |
| ImageWidth | integer | Resize the finished image to this width. Alone, the height follows the aspect ratio. Values: 1 to 20000 (px). |
| ImageHeight | integer | Resize to this height. With `ImageWidth` too, the image is fitted inside both, keeping its shape: 600 x 600 turns the 1200 x 630 sample into 600 x 315. Values: 1 to 20000 (px). |
| ScaleProportions | boolean | With `ImageWidth` and `ImageHeight` both set, `false` stretches the image to exactly that size. Sent without a size, it is accepted and changes nothing. |
| ImageQuality | integer | JPEG quality for `/to/jpg`. Lower values give smaller files with more compression artifacts. ConvertAPI's default is 75; send `ImageQuality=75` to match it. |
| ColorSpace | string | `gray` writes one gray channel: the sample card drops from 205,545 to 80,865 bytes as PNG, and to 63,331 bytes as JPG. `monochrome` turns every pixel black or white (14,366 bytes): the card's dark gra |
| ImageResolution | integer | Only labels the file with a DPI: PNG gets a pHYs chunk and JPG a JFIF density. The pixels stay as the viewport and crop make them, so `ImageResolution=144` still gives a 1200 x 630 card. Left out, the |
| HideElements | string | CSS selector. Matching elements are hidden before the capture, for cookie bars, chat buttons or anything else you don't want in the picture. |
| UserCss | string | Extra CSS added after the page's own styles, for example to swap a theme or bump a font size for the snapshot. |
| CssMediaType | string | Which `@media` rules apply. Images use `screen` rules; if the page has `@media` rules and you ask for `print`, the capture is done by the browser engine. |
| JavaScript | boolean | `false` draws a page that contains scripts without running them, in the in-process engine. |
| UserJs | string | Script to run in the loaded page before the capture. Captured by the browser engine. |
| WaitElement | string | CSS selector to wait for before the capture, so content a script adds late is in the image. Captured by the browser engine. |
| ConversionDelay | integer | Extra seconds to wait after load before a browser engine capture. Pages drawn in process are captured straight away. Values: 0 to 30 (seconds). |
| FileName | string | Name for the image, without the extension. Without it the image takes the uploaded file's name. |
| StoreFile | boolean | Return a download link instead of the image data. The link expires after 3 hours. |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://artifacts.apis.io/pdfconversionapi-com/json-schema/pdfconversionapi-com-html-to-png-form-schema.json",
"title": "HtmlToPngForm",
"description": "The form for `html/to/png`, `html/to/jpg`: the parameters listed on https://pdfconversionapi.com/convert/html-to-png. 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/HtmlToPngForm",
"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."
},
"ViewportWidth": {
"type": "integer",
"minimum": 200,
"maximum": 4000,
"default": 1366,
"description": "Width the page is laid out at, in CSS pixels. The image is this wide unless you crop, zoom or resize it.\n\nValues: 200 to 4000 (px)."
},
"ViewportHeight": {
"type": "integer",
"minimum": 200,
"maximum": 4000,
"default": 1024,
"description": "Browser window height. A browser engine capture is at least this tall; the in-process engine ignores it and captures the content's own height.\n\nValues: 200 to 4000 (px)."
},
"CropX": {
"type": "integer",
"minimum": 0,
"maximum": 16384,
"description": "Left edge of the area to keep, counted from the left of the page.\n\nValues: 0 to 16384 (px)."
},
"CropY": {
"type": "integer",
"minimum": 0,
"maximum": 16384,
"description": "Top edge of the area to keep, counted from the top of the page. A crop that starts outside the page returns 400.\n\nValues: 0 to 16384 (px)."
},
"CropWidth": {
"type": "integer",
"minimum": 1,
"maximum": 16384,
"description": "Width of the area to keep.\n\nValues: 1 to 16384 (px)."
},
"CropHeight": {
"type": "integer",
"minimum": 1,
"maximum": 16384,
"description": "Height of the area to keep. It cuts and never pads: in the in-process engine, a page shorter than `CropHeight` comes out at its own height.\n\nValues: 1 to 16384 (px)."
},
"CropElement": {
"type": "string",
"description": "CSS selector. The image is cut to the border box of the first matching element. Captured by the browser engine; a selector that matches nothing returns 400."
},
"Zoom": {
"type": "number",
"minimum": 0.1,
"maximum": 10,
"default": 1,
"description": "CSS zoom applied to the whole page. Captured by the browser engine. Double `ViewportWidth` and set `Zoom=2` for a sharp 2x image."
},
"TransparentBackground": {
"type": "boolean",
"default": false,
"description": "Where the page paints no background, leave the PNG transparent instead of white. JPG has no transparency, so those areas are filled with white, or with `BackgroundColor`."
},
"BackgroundColor": {
"type": "string",
"default": "white",
"description": "JPG only: the color that fills transparent areas when `TransparentBackground=true`. A value that is not a color returns 400.\n\nValues: `#RRGGBB`, `R,G,B`, `white`, `black`, `red`, `green`, `blue`, `gray`."
},
"ImageWidth": {
"type": "integer",
"minimum": 1,
"maximum": 20000,
"description": "Resize the finished image to this width. Alone, the height follows the aspect ratio.\n\nValues: 1 to 20000 (px)."
},
"ImageHeight": {
"type": "integer",
"minimum": 1,
"maximum": 20000,
"description": "Resize to this height. With `ImageWidth` too, the image is fitted inside both, keeping its shape: 600 x 600 turns the 1200 x 630 sample into 600 x 315.\n\nValues: 1 to 20000 (px)."
},
"ScaleProportions": {
"type": "boolean",
"default": true,
"description": "With `ImageWidth` and `ImageHeight` both set, `false` stretches the image to exactly that size. Sent without a size, it is accepted and changes nothing."
},
"ImageQuality": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"default": 85,
"description": "JPEG quality for `/to/jpg`. Lower values give smaller files with more compression artifacts. ConvertAPI's default is 75; send `ImageQuality=75` to match it."
},
"ColorSpace": {
"type": "string",
"enum": [
"default",
"rgb",
"gray",
"monochrome"
],
"default": "default",
"description": "`gray` writes one gray channel: the sample card drops from 205,545 to 80,865 bytes as PNG, and to 63,331 bytes as JPG. `monochrome` turns every pixel black or white (14,366 bytes): the card's dark gradient comes out solid black, with the text, logo and bars in white. `rgb` drops the alpha channel when every pixel is opaque: the card comes back as a 196,941-byte RGB PNG with the same pixels. With `TransparentBackground=true` the alpha stays. `cmyk` returns 400."
},
"ImageResolution": {
"type": "integer",
"minimum": 10,
"maximum": 800,
"description": "Only labels the file with a DPI: PNG gets a pHYs chunk and JPG a JFIF density. The pixels stay as the viewport and crop make them, so `ImageResolution=144` still gives a 1200 x 630 card. Left out, the file has no DPI."
},
"HideElements": {
"type": "string",
"description": "CSS selector. Matching elements are hidden before the capture, for cookie bars, chat buttons or anything else you don't want in the picture."
},
"UserCss": {
"type": "string",
"description": "Extra CSS added after the page's own styles, for example to swap a theme or bump a font size for the snapshot."
},
"CssMediaType": {
"type": "string",
"enum": [
"screen",
"print"
],
"default": "screen",
"description": "Which `@media` rules apply. Images use `screen` rules; if the page has `@media` rules and you ask for `print`, the capture is done by the browser engine."
},
"JavaScript": {
"type": "boolean",
"default": true,
"description": "`false` draws a page that contains scripts without running them, in the in-process engine."
},
"UserJs": {
"type": "string",
"description": "Script to run in the loaded page before the capture. Captured by the browser engine."
},
"WaitElement": {
"type": "string",
"description": "CSS selector to wait for before the capture, so content a script adds late is in the image. Captured by the browser engine."
},
"ConversionDelay": {
"type": "integer",
"minimum": 0,
"maximum": 30,
"default": 0,
"description": "Extra seconds to wait after load before a browser engine capture. Pages drawn in process are captured straight away.\n\nValues: 0 to 30 (seconds)."
},
"FileName": {
"type": "string",
"description": "Name for the image, without the extension. Without it the image takes the uploaded file's name."
},
"StoreFile": {
"type": "boolean",
"default": false,
"description": "Return a download link instead of the image data. 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.
Call it yourself
curl for this page
curl "https://apis.io/api/v1/json-schemas/pdfconversionapi-com-html-to-png-form"
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.