import { PathSeg } from './content.js'; import { ShapeGradient } from '../core/vector.js'; import { Loss } from '../core/ir/index.js'; import { PdfFile, PdfPage } from './document.js'; /** * One painted vector path lifted off a page (E-PDF EP10/EP11/EP16c): the path * segments, whichever of solid fill / gradient fill / stroke survived the * de-cluttering filter, and the path's page-space bounding box plus enclosing * marked-content id. */ export interface PdfVector { /** * §8.5.3 — where this was painted, as the chain of positions leading to it: * `[4]` is the fifth mark of the page, `[4, 2]` the third mark of the form * that mark called. Compared element by element it is the page's painting * order across forms and patterns alike, which is the only thing that says * what covers what. */ readonly orderKey: ReadonlyArray; readonly segs: ReadonlyArray; /** Present iff a qualifying solid fill survived (EP10). */ readonly fillHex?: string; /** Present iff a shading-pattern fill survived (EP16c). */ readonly gradient?: ShapeGradient; /** §11.6.4.4 — how opaque the fill is, when the page asked for less than all. */ readonly alpha?: number; /** * §11.3.5 — the fill only DARKENS what it covers, so the marks under it read * through. A highlighter is this, and nothing on a page reads it as paint. */ readonly darkens?: boolean; /** Present iff a qualifying stroke survived (EP11). */ readonly strokeHex?: string; /** Stroke width in page-space points (EP11). */ readonly lineWidth?: number; readonly minX: number; readonly minY: number; readonly maxX: number; readonly maxY: number; /** §9.6.6 — a traced glyph rather than artwork: type the file states no character for. */ readonly glyph?: boolean; readonly mcid?: number; } /** * Lift the painted vector paths off a page (E-PDF EP10/EP11/EP16c). Runs the * content interpreter for its fill (EP10), stroke (EP11) and shading-pattern * (EP16c) placements and keeps only the ones that read as real graphics: * hairline/degenerate fills, invisible white paint, short stroke specks and the * near-full-page background are all dropped, so a reconstructed document gains * genuine coloured shapes, lines and gradients without the dot / page-background * clutter. Clips and the bare `sh` operator are not captured (a documented loss). */ export declare function collectPageVectors(file: PdfFile, page: PdfPage, occupied?: ReadonlyArray): PageVectors; /** The paths lifted off one page, plus a loss if the page ran past the cap. */ export interface PageVectors { readonly vectors: Array; readonly losses: ReadonlyArray; } /** A page-space rectangle: what something covers. */ interface Box { readonly minX: number; readonly minY: number; readonly maxX: number; readonly maxY: number; } export {};