import { PdfRef } from './objects.js'; import { PdfDocument } from './writer.js'; import { EmbedImageOptions, PreparedImage } from '../core/images.js'; export { detectImageFormat, prepareImage } from '../core/images.js'; export type { EmbedImageOptions, ImageFormat, PreparedImage } from '../core/images.js'; /** A reference to an embedded image XObject plus its pixel dimensions. */ export interface EmbeddedImage { /** Indirect reference to the image XObject, for a page's `/XObject` resources. */ readonly ref: PdfRef; readonly widthPx: number; readonly heightPx: number; } /** * Create the PDF image-XObject objects from an already-prepared image (ISO * 32000-1 §8.9.5), emitting an `/SMask` soft-mask object first when present. * The decode/validate work happens earlier in `prepareImage`; this only writes * the objects. * * @param prepared The decoded, ready-to-emit image stream. * @returns The image reference and its pixel dimensions. */ export declare function addImage(doc: PdfDocument, prepared: PreparedImage): EmbeddedImage; /** * Decode raw image `bytes` and embed them in one step — a convenience over * `prepareImage` + {@link addImage}. * * @param bytes The raw image file bytes (PNG/JPEG/…). * @param options Decode/embed options. * @returns The image reference and its pixel dimensions. */ export declare function embedImage(doc: PdfDocument, bytes: Uint8Array, options?: EmbedImageOptions): EmbeddedImage;