EPecho-pdf docs
API

VL-first local primitives, one product surface.

The local package API is intentionally small. The supported public import surface is the root package plus @echofiles/echo-pdf/local, both centered on render, page understanding, semantic structure, and workspace artifacts.

PrimitiveReturnsWritesPrimary use
get_documentdocument metadatadocument.jsonsource snapshot and document root
get_document_structurestable page indexstructure.jsoniterate pages and locate page artifacts
get_semantic_document_structureheading tree + cross-page tables, formulas, figuressemantic-structure.jsonchapter navigation plus merged structured elements without mutating pages[]; requires provider + model
get_page_contentpage text artifactpages/<page>.jsonpage retrieval and semantic input
get_page_renderrender metadatarenders/<page>.json + PNGvisual page reuse and VL input
get_page_tables_latexLaTeX tabular artifactstables/<page>...jsonstructured table extraction; requires provider + model
get_page_formulas_latexLaTeX math artifactsformulas/<page>...jsondisplayed formula extraction; requires provider + model
get_page_understandingtables + formulas + figuresunderstanding/<page>...jsoncombined single-page extraction in one LLM call; requires provider + model

Import surface

import {
  get_document,
  get_document_structure,
  get_semantic_document_structure,
  get_page_content,
  get_page_render,
  get_page_tables_latex,
  get_page_formulas_latex,
  get_page_understanding,
} from "@echofiles/echo-pdf/local"

Provider-backed semantic call

const semantic = await get_semantic_document_structure({
  pdfPath: "./sample.pdf",
  provider: "ollama",
  model: "llava:13b",
})

Runtime expectation

  • Node.js >=20
  • ESM import support
  • local-first Node/Bun runtime
  • package exports aware consumer
  • get_semantic_document_structure requires provider and model parameters or configured defaults
  • that provider may be a local OpenAI-compatible endpoint via baseUrl: "http://127.0.0.1:..."

Not the place for broad tool sprawl.

This reference is intentionally centered on the main VL-first primitives. Worker, MCP, and hosted-service entrypoints are not part of the supported package surface.