{
  "id": "web.to_pdf",
  "object": "tool",
  "name": "Web page to PDF",
  "summary": "Print any page to PDF.",
  "description": "Renders a page in headless Chrome and prints it to PDF, with paper size, orientation, margins, scale, page ranges, background graphics, print or screen CSS, and header and footer templates with page numbers.",
  "category": "web",
  "hosted_by": "Opentools",
  "runtime": "browser",
  "side_effects": false,
  "status": "live",
  "credits": 2,
  "price": "$0.0020",
  "providers": [
    {
      "id": "opentools",
      "name": "Opentools",
      "price": "$0.0020"
    }
  ],
  "mcp_name": "web_to_pdf",
  "input_schema": {
    "type": "object",
    "properties": {
      "url": {
        "type": "string",
        "format": "uri",
        "description": "Public http(s) URL of the page"
      },
      "format": {
        "default": "A4",
        "description": "Paper size",
        "type": "string",
        "enum": [
          "A4",
          "Letter",
          "Legal",
          "A3",
          "A5",
          "Tabloid"
        ]
      },
      "landscape": {
        "default": false,
        "description": "Landscape orientation",
        "type": "boolean"
      },
      "margin": {
        "default": {
          "top": "15mm",
          "right": "15mm",
          "bottom": "15mm",
          "left": "15mm"
        },
        "description": "Page margins",
        "type": "object",
        "properties": {
          "top": {
            "default": "15mm",
            "type": "string",
            "pattern": "^\\d+(\\.\\d+)?(px|in|cm|mm)$",
            "description": "A length like \"10mm\", \"0.5in\" or \"20px\""
          },
          "right": {
            "default": "15mm",
            "type": "string",
            "pattern": "^\\d+(\\.\\d+)?(px|in|cm|mm)$",
            "description": "A length like \"10mm\", \"0.5in\" or \"20px\""
          },
          "bottom": {
            "default": "15mm",
            "type": "string",
            "pattern": "^\\d+(\\.\\d+)?(px|in|cm|mm)$",
            "description": "A length like \"10mm\", \"0.5in\" or \"20px\""
          },
          "left": {
            "default": "15mm",
            "type": "string",
            "pattern": "^\\d+(\\.\\d+)?(px|in|cm|mm)$",
            "description": "A length like \"10mm\", \"0.5in\" or \"20px\""
          }
        }
      },
      "print_background": {
        "default": true,
        "description": "Print background colours and images",
        "type": "boolean"
      },
      "scale": {
        "default": 1,
        "description": "Rendering scale, 0.1 to 2",
        "type": "number",
        "minimum": 0.1,
        "maximum": 2
      },
      "header_template": {
        "description": "HTML for the page header. Elements with class \"pageNumber\", \"totalPages\", \"title\", \"url\" or \"date\" are filled in. Use inline styles and a font-size.",
        "type": "string",
        "maxLength": 20000
      },
      "footer_template": {
        "description": "HTML for the page footer, same classes as the header",
        "type": "string",
        "maxLength": 20000
      },
      "page_numbers": {
        "default": false,
        "description": "Add a \"Page X of Y\" footer when no footer template is given",
        "type": "boolean"
      },
      "page_ranges": {
        "description": "Pages to print, like \"1-3, 5\". All if omitted.",
        "type": "string",
        "maxLength": 200
      },
      "media": {
        "default": "print",
        "description": "CSS media type to render with",
        "type": "string",
        "enum": [
          "print",
          "screen"
        ]
      },
      "name": {
        "default": "document.pdf",
        "description": "Name of the output file",
        "type": "string",
        "maxLength": 120
      },
      "device": {
        "default": "desktop",
        "description": "Device to emulate: viewport, pixel ratio, touch and user agent",
        "type": "string",
        "enum": [
          "desktop",
          "laptop",
          "iphone-15",
          "pixel-8",
          "ipad"
        ]
      },
      "width": {
        "description": "Viewport width in CSS pixels. Overrides the device.",
        "type": "integer",
        "minimum": 240,
        "maximum": 3840
      },
      "height": {
        "description": "Viewport height in CSS pixels. Overrides the device.",
        "type": "integer",
        "minimum": 240,
        "maximum": 4320
      },
      "dark_mode": {
        "description": "Emulate prefers-color-scheme: dark (true) or light (false)",
        "type": "boolean"
      },
      "user_agent": {
        "description": "Custom User-Agent header",
        "type": "string",
        "maxLength": 500
      },
      "headers": {
        "description": "Extra HTTP headers sent with every request",
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {
          "type": "string"
        }
      },
      "cookies": {
        "description": "Cookies to set before loading, e.g. a consent or session cookie",
        "maxItems": 50,
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "Cookie name"
            },
            "value": {
              "type": "string",
              "description": "Cookie value"
            },
            "domain": {
              "description": "Cookie domain. The page's domain if omitted.",
              "type": "string"
            },
            "path": {
              "description": "Cookie path. / if omitted.",
              "type": "string"
            }
          },
          "required": [
            "name",
            "value"
          ]
        }
      },
      "block": {
        "description": "Resource types to skip loading, for speed",
        "type": "array",
        "items": {
          "type": "string",
          "enum": [
            "fonts",
            "media",
            "images",
            "stylesheets"
          ]
        }
      },
      "wait_until": {
        "default": "networkidle",
        "description": "When the page counts as loaded. networkidle waits until the network is quiet.",
        "type": "string",
        "enum": [
          "load",
          "domcontentloaded",
          "networkidle"
        ]
      },
      "wait_for_selector": {
        "description": "Also wait until this CSS selector appears",
        "type": "string",
        "maxLength": 500
      },
      "delay_ms": {
        "default": 0,
        "description": "Extra wait after loading, in milliseconds",
        "type": "integer",
        "minimum": 0,
        "maximum": 15000
      },
      "timeout_ms": {
        "default": 30000,
        "description": "Give up loading after this long",
        "type": "integer",
        "minimum": 1000,
        "maximum": 60000
      }
    },
    "required": [
      "url"
    ]
  },
  "kind": "tool"
}