import { TextRun } from './content.js'; import { PdfImage } from './images.js'; import { PdfPage } from './document.js'; import { PdfVector } from './vector.js'; /** A page's shown geometry: how big it is, and how to place a mark on it. */ export interface Display { /** The shown page's width in points — the `/MediaBox`'s, swapped on a quarter turn. */ readonly width: number; /** The shown page's height in points. */ readonly height: number; /** How far every mark turns with the page, degrees counter-clockwise. */ readonly turnDeg: number; /** Map a `/MediaBox`-space point into the shown page's own y-up frame. */ readonly place: (x: number, y: number) => { x: number; y: number; }; } /** * The {@link Display} a page's shown box and `/Rotate` describe. * * `/Rotate` turns the page CLOCKWISE when shown, so the content turns with it — * counter-clockwise by the same amount as seen from the content's own frame, * which is what `turnDeg` states. * * @param page The page whose shown geometry is wanted. * @returns Its size, its turn, and the map onto it. */ export declare function displayOf(page: PdfPage): Display; /** * The same runs, placed on the shown page. * * @param runs The runs as the content stream drew them. * @param d The page's shown geometry. * @returns The runs in the shown page's frame, each carrying the page's turn. */ export declare function placeRuns(runs: ReadonlyArray, d: Display): Array; /** * The same pictures, placed on the shown page. A quarter turn swaps a picture's * width and height and leaves it standing on its side, which the caller carries * as the picture's own rotation. * * @param images The pictures as the content stream placed them. * @param d The page's shown geometry. * @returns The pictures in the shown page's frame. */ export declare function placeImages(images: ReadonlyArray, d: Display): Array; /** * The same paths, placed on the shown page. A path is geometry, so every point * of it moves and the bounding box is taken again from what comes out. * * @param vectors The paths as the content stream painted them. * @param d The page's shown geometry. * @returns The paths in the shown page's frame. */ export declare function placeVectors(vectors: ReadonlyArray, d: Display): Array;