import { PdfDict, PdfStream } from '../pdf/objects.js'; import { PdfFile } from './document.js'; /** * A generated normal appearance for an annotation that carries none, or * `undefined` when its subtype or its geometry says nothing to draw. * * The stream is in PAGE space, so the caller places it with the identity: it is * not fitted to `/Rect` the way an authored appearance is, because what it is * drawn from is already stated in page coordinates. * * @param file The owning file, for resolving references. * @param annot The annotation dictionary. * @returns The synthesized appearance stream, or `undefined`. */ export declare function drawnAppearance(file: PdfFile, annot: PdfDict): PdfStream | undefined; /** * §12.7.2 `/DR` — the resources a generated field appearance draws with. * * The `/DA` string names a font (`/Helv 12 Tf`) and that name means nothing * without the form's own default resource dictionary, which is where every * field's face lives. * * @param file The owning file. * @param annot The annotation the appearance was generated for. * @returns The form's `/DR`, or `undefined` when there is none. */ export declare function drawnResources(file: PdfFile, annot: PdfDict): PdfDict | undefined; /** * §12.5.6.10 — what a TEXT-MARKUP annotation says about the words it covers. * * A highlight, an underline, a strikeout and a squiggle are not drawings: each * names a run of text and a way of marking it. Lifted as artwork they are a * band and a rule anchored to the page, which is right until the text re-sets * and is then a band sitting between two paragraphs it does not mark. Carried * on the RUNS they survive the reflow, and a .docx gets what the annotation * meant — `w:shd`, `w:u`, `w:strike`. * * @param file The owning file. * @param annot The annotation dictionary. * @returns How it marks and what it marks, or `undefined` for another subtype. */ export declare function textMarkupOf(file: PdfFile, annot: PdfDict): TextMarkupAnnot | undefined; /** A text-markup annotation: how it marks, and the boxes it marks. */ export interface TextMarkupAnnot { readonly mark: TextMarkup; readonly quads: ReadonlyArray; } /** §12.5.6.10 — how a text-markup annotation marks the words it covers. */ export interface TextMarkup { /** `/Highlight` — the wash painted behind them (6-hex). */ readonly highlightHex?: string; /** `/Underline`, `/Squiggly` — a rule under them, straight or wavy. */ readonly underline?: 'single' | 'wave'; /** The rule's own colour (6-hex), when the annotation states one. */ readonly underlineHex?: string; /** `/StrikeOut` — a rule through them. */ readonly strike?: boolean; } /** One marked box in page space: its span of x, its foot and its height. */ export interface Quad { readonly x0: number; readonly x1: number; readonly y0: number; readonly h: number; }