npm install @literate.ink/pdf-inspector
yarn add @literate.ink/pdf-inspector
pnpm add @literate.ink/pdf-inspector
bun add @literate.ink/pdf-inspector
import { parsePDF } from "@literate.ink/pdf-inspector";
const pages = await parsePDF(buffer);
for (const page of pages) {
console.log(`Page of ${page.Width}x${page.Height}px`);
console.log("- contains", page.Texts.length, "texts");
console.log("- contains", page.Fills.length, "fills");
}
The JS/TS implementation is a fork of the following projects :