No backend needed · Cloudflare Workers ready · OCR when it matters

PDFs and webpages, as clean HTML

extract-pdf turns a PDF into structured HTML with headings, lists, footnotes and code blocks in milliseconds, with Granite Docling OCR for the pages that need it. extract-webpage pulls the main content and its citation out of any URL.

extract-pdf on npmextract-webpage on npm
DocumentationLive demoGitHub

A few lines, anywhere

The same calls in a script, a server or a Worker.

import { convertPDFToHTML } from 'extract-pdf';

const { html, title, author, ocrScan } = await convertPDFToHTML('https://arxiv.org/pdf/1706.03762', {
  addPageNumbers: true,
});

console.log(title, author);
console.log(ocrScan.pagesNeedingOcr); // e.g. [3, 7]: pages with tables or figures