Skip to content

Node.js API

Convert a PDF file to the specified format.

Parameters:

ParameterTypeDefaultDescription
pathstringrequiredPath to the PDF file
options.formatstring"markdown"Output format
options.pagesstringundefinedPage range, e.g. "1-5"
options.tableMethodstringundefinedTable detection method

Returns: string — the converted content.

import { convert } from "edgeparse";
const markdown = convert("document.pdf", { format: "markdown" });
const json = convert("document.pdf", { format: "json" });
const html = convert("document.pdf", { format: "html" });
const text = convert("document.pdf", { format: "text" });
interface ConvertOptions {
format?: "markdown" | "json" | "html" | "text";
pages?: string;
tableMethod?: "border" | "cluster";
}