Docs/Skills/PDF to HTML

PDF to HTML

Convert PDF pages to HTML that looks like the PDF

OperationalCredits 20 per callp50 3080msDocuments

Overview

Pages are converted by pdf2htmlEX 0.18.8, which uses Poppler to read the PDF. Every text run becomes an absolutely positioned element in the PDF's own font: embedded fonts are extracted, re-encoded so their characters map to Unicode, and inlined as WOFF web fonts, and fonts the PDF only names are matched to metric-compatible system fonts. Everything that is not text (images, vector paths, shading) is rendered into one PNG background image per page. CSS, fonts and images are all embedded, so the output is a single HTML file with no external references; pages are `div` elements with ids `pf1`, `pf2` and so on, numbered by their position in the PDF.

`pages` takes one page (`3`), a closed range (`2-7`) or an open range (`5-`, to the end); the default is the whole document from page 1. Each call converts at most 10 pages from the start of the range (2 on the Free plan); `nextPage` is the first page left in the requested range, or null, so a loop that sends `pages=<nextPage>-` walks the document. Page numbers past the end return 400 with the page count. The PDF is checked with Poppler's pdfinfo first: an encrypted file without `password` returns 400 "password-protected", a wrong password 400 "not correct". Copy-restriction flags are not enforced.

`textOnly` turns off the background layer, so only positioned text remains; it is much smaller and suits indexing. HTML up to 512 KB is returned in `html` and `inline` is true; larger output has `html` null and is read from `downloadURL`, a signed link valid for two days (`expires`, Unix milliseconds). A conversion has 22 seconds; image-heavy pages that take longer return 504, and a call whose HTML would pass 30 MB returns 413, so convert fewer pages or use textOnly. Scanned PDFs without a text layer come out as background images only.

Live Test PDF to HTML Skill →

The tool

Once your client is connected to the VerveKit server, this appears in its tool list as PDFtoHTML. It is read-only and open-world — it fetches and never mutates anything on your side — so most clients call it without asking you to confirm.

Tool call
{
  "name": "PDFtoHTML",
  "arguments": {}
}

Connecting

One server URL covers every skill in the catalog, including this one. Authorization is OAuth: the client opens a browser once, and there is no key to paste into a config file.

{
  "mcpServers": {
    "vervekit": {
      "url": "https://api.vervekit.com/v1/mcp"
    }
  }
}

Per-client setup — Claude, Cursor, VS Code, ChatGPT — is on the MCP setup page.

Arguments

These are the properties on the tool's inputSchema, so a well-behaved client validates them before the call is made. Premium arguments are accepted on every plan but only take effect on plans that include them.

ArgumentTypeDescription
pdfOptionalstringThe PDF file to convert (up to 10 MB), or a public PDF URL
pagesOptionalstringOne page or range: 3, 2-7, or 5- for page 5 onwards. Each call converts up to 10 pages (2 on the Free plan) from the start of the range; nextPage says where to continue
default 1- · length 0–20
passwordOptionalstringUser or owner password of an encrypted PDF
length 0–256
textOnlyOptionalbooleanLeave out images and vector graphics and keep only the positioned text in its fonts

What the model gets back

The result carries a structuredContent object matching the tool's declared outputSchema, so a client reads fields without parsing prose. status is "ok" and error is null on success; a null field means the value was not available for that input, not that the call failed.

Result
{
  "status": "ok",
  "error": null,
  "data": {
    "htmlName": "7c1e4b9a-2f3d-4e8a-9b6c-5d0a1f2e3c4b.html",
    "pageCount": 14,
    "firstPage": 1,
    "lastPage": 10,
    "pagesConverted": 10,
    "nextPage": 11,
    "textOnly": false,
    "encrypted": false,
    "size": 1873402,
    "inline": false,
    "html": null,
    "expires": 1792400000000,
    "downloadURL": "https://storage.googleapis.com/apiverve/APIData/pdftohtml/7c1e4b9a-2f3d-4e8a-9b6c-5d0a1f2e3c4b.html?GoogleAccessId=635500398038-compute%40developer.gserviceaccount.com&Expires=1792400000&Signature=SAMPLE"
  }
}

Response fields

Paths are relative to data. Premium fields are absent rather than zeroed on plans that do not include them, so check for presence instead of comparing to 0.

FieldTypeExampleDescription
htmlNamestring7c1e4b9a-2f3d-4e8a-9b6c-5d0a1f2e3c4b.htmlFile name of the stored HTML
pageCountnumber14Total pages in the PDF
firstPagenumber1First page converted
lastPagenumber10Last page converted
pagesConvertednumber10Pages in this call's HTML
nextPagenumber11Page to send next (as pages=<nextPage>-) to continue the requested range, or null when it is done
textOnlybooleanfalseWhether images and graphics were left out
encryptedbooleanfalseWhether the PDF was password-protected
sizenumber1873402Size of the HTML in bytes
inlinebooleanfalseWhether the HTML is included in html; false over 512 KB
htmlobjectnullThe HTML document, or null when it is over 512 KB (use downloadURL)
expiresnumber1792400000000When the download link expires (Unix time in milliseconds)
downloadURLstringhttps://storage.googleapis.com/apiverve/APIData/pdftohtml/7c1e4b9a-2f3d-4e8a-9b6c-5d0a1f2e3c4b.html?…Signed link to download the HTML, valid for 2 days

Failure modes

Errors come back as tool errors carrying a sentence the model can act on, not a bare status code. Error handling covers the full list.

StatusWhat it means
400 / 422The arguments did not validate. The message names the offending one.
401The OAuth session is invalid or expired — reconnect the server.
403Blocked by a key restriction or an IP allow-list. Never a bad identity.
404This skill is not part of VerveKit. Check the catalog.
429Out of credits, or a brief rate limit. The message tells them apart.

A call costs 20 credits each time the tool actually runs; a model that reasons about the tool without calling it costs nothing.

Use cases

Documents in the Browser
Show invoices, statements and reports inside your web app as HTML instead of sending users a PDF download.
Searchable Archives
Turn PDF archives into HTML pages that search engines and site search can index, with the original look intact.
Email and CMS Publishing
Publish brochures, menus and newsletters made as PDFs on a website or in a CMS without retyping them.
Accessibility Workflows
Get selectable, copyable text in its original position as a starting point for accessible versions of PDF documents.

Other ways to use PDF to HTML

Set up PDF to HTML on VerveKit, or reach the same source a different way. Your VerveKit account and credits work on all of them — one key, one balance.

Call it as a REST APIOne HTTPS endpoint and an x-api-key header, with SDKs for Node, Python and .NET.APIVerve →Reference →

More in Documents:

Was this page helpful?