import { StreamFilters } from './document.js'; import { DocumentReader, ReadResult } from '../core/ir/adapters.js'; import { FlowDoc } from '../core/ir/flow.js'; /** * Parse PDF bytes into a {@link FlowDoc} (E-PDF EP5): reconstruct via the tagged * structure tree when present (EP3), else the layout heuristic (EP4), lifting * raster images back into reading order (EP6). Records losses for encryption that * could not be opened, heuristic (untagged) reconstruction, and the vector * regions that are not reconstructed (clipping paths, bare `sh` shadings). * * @param bytes The complete PDF file bytes. * @param password The user password for an encrypted source; the empty string * opens permissions-only encryption. * @param filters Decoders for `/Filter` names this reader does not implement * (§7.4); see {@link StreamFilters}. * @returns The reconstructed FlowDoc and its accumulated {@link Loss} report. * * Which of the two readings a file gets is the FILE's to decide and no * caller's: a page that is mostly marks is reproduced where it stands, one * that is mostly lines is re-set as a document, and the reader records which * it chose. There is no override — see the note on {@link readingOf}. */ export declare function readPdf(bytes: Uint8Array, password?: string, filters?: StreamFilters): ReadResult; /** * The `pdfReader` adapter: a {@link DocumentReader} that sniffs the `%PDF-` * header and parses the bytes into a {@link FlowDoc} (E-PDF EP5). */ export declare const pdfReader: DocumentReader;