Skip to main content
Glama

PDF.co MCP Server

Official
by pdfdotco
MIT License
1
  • Apple
  • Linux

webpage_to_pdf

Convert any webpage URL into a PDF document with customizable headers, footers, margins, and paper size. Ideal for saving web content or generating print-ready files directly from URLs.

Instructions

Convert external webpage URL to PDF. Ref: https://developer.pdf.co/api-reference/pdf-from-url.md The header and footer parameters can contain valid HTML markup with the following classes used to inject printing values into them: - date: formatted print date - title: document title - url: document location - pageNumber: current page number - totalPages: total pages in the document - img: tag is supported in both the header and footer parameter, provided that the src attribute is specified as a base64-encoded string. For example, the following markup will generate Page N of NN page numbering: ```html <span style='font-size:10px'>Page <span class='pageNumber'></span> of <span class='totalPages'></span>.</span>

Input Schema

NameRequiredDescriptionDefault
DoNotWaitFullLoadNofalse by default. Set to true to skip waiting for full load (like full video load etc. that may affect the total conversion time). (Optional)
api_keyNoPDF.co API key. If not provided, will use X_API_KEY environment variable. (Optional)
footerNoUser definable HTML for the footer to be applied on every page footer. (Optional)
headerNoUser definable HTML for the header to be applied on every page header. (Optional)
httppasswordNoHTTP auth password if required to access source url. (Optional)
httpusernameNoHTTP auth user name if required to access source url. (Optional)
marginsNoSet to CSS style margins like 10px, 5mm, 5in for all sides or 5px 5px 5px 5px (the order of margins is top, right, bottom, left). (Optional)
mediaTypeNoUses print by default. Set to screen to convert HTML as it appears in a browser or print to convert as it appears for printing or none to set none as mediaType for CSS styles. (Optional)
nameNoFile name for the generated output. (Optional)
orientationNoSet to Portrait or Landscape. Portrait is set by default. (Optional)
paperSizeNoA4 is set by default. Can be Letter, Legal, Tabloid, Ledger, A0, A1, A2, A3, A4, A5, A6 or a custom size. Custom size can be set in px (pixels), mm or in (inches) with width and height separated by space like this: 200 300, 200px 300px, 200mm 300mm, 20cm 30cm or 6in 8in. (Optional)
printBackgroundNotrue by default. Set to false to disable printing of background. (Optional)
urlYesURL to the source file (external webpage URL).

Input Schema (JSON Schema)

{ "properties": { "DoNotWaitFullLoad": { "default": false, "description": "false by default. Set to true to skip waiting for full load (like full video load etc. that may affect the total conversion time). (Optional)", "title": "Donotwaitfullload", "type": "boolean" }, "api_key": { "default": null, "description": "PDF.co API key. If not provided, will use X_API_KEY environment variable. (Optional)", "title": "Api Key", "type": "string" }, "footer": { "default": "", "description": "User definable HTML for the footer to be applied on every page footer. (Optional)", "title": "Footer", "type": "string" }, "header": { "default": "", "description": "User definable HTML for the header to be applied on every page header. (Optional)", "title": "Header", "type": "string" }, "httppassword": { "default": "", "description": "HTTP auth password if required to access source url. (Optional)", "title": "Httppassword", "type": "string" }, "httpusername": { "default": "", "description": "HTTP auth user name if required to access source url. (Optional)", "title": "Httpusername", "type": "string" }, "margins": { "default": "", "description": "Set to CSS style margins like 10px, 5mm, 5in for all sides or 5px 5px 5px 5px (the order of margins is top, right, bottom, left). (Optional)", "title": "Margins", "type": "string" }, "mediaType": { "default": "", "description": "Uses print by default. Set to screen to convert HTML as it appears in a browser or print to convert as it appears for printing or none to set none as mediaType for CSS styles. (Optional)", "title": "Mediatype", "type": "string" }, "name": { "default": "", "description": "File name for the generated output. (Optional)", "title": "Name", "type": "string" }, "orientation": { "default": "", "description": "Set to Portrait or Landscape. Portrait is set by default. (Optional)", "title": "Orientation", "type": "string" }, "paperSize": { "default": "", "description": "A4 is set by default. Can be Letter, Legal, Tabloid, Ledger, A0, A1, A2, A3, A4, A5, A6 or a custom size. Custom size can be set in px (pixels), mm or in (inches) with width and height separated by space like this: 200 300, 200px 300px, 200mm 300mm, 20cm 30cm or 6in 8in. (Optional)", "title": "Papersize", "type": "string" }, "printBackground": { "default": true, "description": "true by default. Set to false to disable printing of background. (Optional)", "title": "Printbackground", "type": "boolean" }, "url": { "description": "URL to the source file (external webpage URL).", "title": "Url", "type": "string" } }, "required": [ "url" ], "type": "object" }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pdfdotco/pdfco-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server