import { ObjectBase } from "../ObjectBase"; import type { Image } from "../Image"; import { PdfKeyedObjectCollection } from "./PdfKeyedObjectCollection"; /** * Defines formats that can be used to encode images in a PDF. */ export declare enum PdfImageFormat { /** * Select the optimal format automatically based on the particular image and document options (recommended). * The following rules are used: * -) If the image is a JPEG or a JPEG2000, the image data is written as is without any additional processing. * -) If the image contains transparency, "Raw" is used. * -) If {@link PdfDocument#compressionLevel} is "NoCompression", "Jpeg" is used. * -) Otherwise the format is selected that provides the minimal data size for the image. */ Auto = 0, /** * Use JPEG to encode images. * * Note that when using this format, any transparency that may be present * in an original image will be lost, as JPEG does not support transparency. */ Jpeg = 1, /** * Do not encode image data. * * When using this format, the {@link PdfDocument#compressionLevel} affects * the final PDF size, and in combination with "Optimal"" * it may produce better compression than JPEG for certain types of images * (e.g. screenshots of mostly text screens). */ Raw = 2 } /** * Represents and manages a {@link Image} * used in a {@link PdfDocument}. */ export declare class PdfImageHandler extends ObjectBase { /** * Gets or sets the format used to encode the image associated with this {@link PdfImageHandler}. * * By default this property is unspecified (null), and the actual embedding mode is determined * by {@link PdfDocument#imageOptions}. */ get format(): PdfImageFormat | null; /** * Gets or sets the format used to encode the image associated with this {@link PdfImageHandler}. * * By default this property is unspecified (null), and the actual embedding mode is determined * by {@link PdfDocument#imageOptions}. */ set format(value: PdfImageFormat | null); /** * Gets the {@link Image} object managed by this {@link PdfImageHandler} object. */ get image(): Image; } /** * Represents a collection of {@link PdfImageHandler} objects. **/ export declare class PdfImageHandlerCollection extends PdfKeyedObjectCollection { get count(): number; getAt(index: number): PdfImageHandler; setAt(index: number, item: PdfImageHandler): void; insert(index: number, item: PdfImageHandler): void; contains(item: PdfImageHandler): boolean; remove(item: PdfImageHandler): boolean; removeAt(index: number): void; clear(): void; get(key: Image): PdfImageHandler | undefined; containsKey(key: Image): boolean; removeByKey(key: Image): boolean; /** * Gets an existing {@link PdfImageHandler} associated with a specified {@link Image}, * or creates a new one if such image does not exist. * * @param image - The image * @returns The existing or newly created {@link PdfImageHandler}. */ getImageHandler(image: Image): PdfImageHandler; }