import type { PDFRef } from '../core/pdf-ref.ts'; import type { LineCapStyle, LineJoinStyle } from './content-stream.ts'; import type { PDFContext } from './pdf-context.ts'; import { PDFResource } from './pdf-resource.ts'; /** * Blend mode names available in PDF. */ export type BlendMode = 'Normal' | 'Multiply' | 'Screen' | 'Overlay' | 'Darken' | 'Lighten' | 'ColorDodge' | 'ColorBurn' | 'HardLight' | 'SoftLight' | 'Difference' | 'Exclusion' | 'Hue' | 'Saturation' | 'Color' | 'Luminosity'; /** * Rendering intent names available in PDF. */ export type RenderingIntent = 'AbsoluteColorimetric' | 'RelativeColorimetric' | 'Saturation' | 'Perceptual'; /** * Options for creating an ExtGState (Graphics State Parameter * Dictionary). All properties are optional; only specified properties * will be included in the dictionary. */ export type ExtGStateOptions = { /** * Stroke opacity (alpha). Range: 0.0 (transparent) to 1.0 (opaque). * * PDF key: `CA` */ strokeOpacity?: number; /** * Fill opacity (alpha). Range: 0.0 (transparent) to 1.0 (opaque). * * PDF key: `ca` */ fillOpacity?: number; /** * Blend mode for transparency compositing. * * PDF key: `BM` */ blendMode?: BlendMode; /** * Line width in user space units. * * PDF key: `LW` */ lineWidth?: number; /** * Line cap style. Use values from `LineCapStyle` constant. * * PDF key: `LC` */ lineCap?: LineCapStyle; /** * Line join style. Use values from `LineJoinStyle` constant. * * PDF key: `LJ` */ lineJoin?: LineJoinStyle; /** * Miter limit for line joins. * * PDF key: `ML` */ miterLimit?: number; /** * Dash pattern as [dashArray, dashPhase]. * * PDF key: `D` */ dashPattern?: [number[], number]; /** * Rendering intent for color conversions. * * PDF key: `RI` */ renderingIntent?: RenderingIntent; /** * Overprint mode for stroke operations. * * PDF key: `OP` */ strokeOverprint?: boolean; /** * Overprint mode for fill operations. * * PDF key: `op` */ fillOverprint?: boolean; /** * Overprint mode (0 or 1). * * PDF key: `OPM` */ overprintMode?: 0 | 1; /** * Flatness tolerance for curve rendering. * * PDF key: `FL` */ flatness?: number; /** * Smoothness tolerance for shading. * * PDF key: `SM` */ smoothness?: number; /** * Stroke adjustment flag. * * PDF key: `SA` */ strokeAdjustment?: boolean; /** * Alpha source flag (whether to use shape or opacity for alpha). * * PDF key: `AIS` */ alphaIsShape?: boolean; /** * Text knockout flag. * * PDF key: `TK` */ textKnockout?: boolean; }; /** * Represents an Extended Graphics State (ExtGState) resource within a PDF document. * ExtGState dictionaries allow setting graphics state parameters that cannot be * set directly with operators in the content stream. * * See PDF 1.7, Section 4.3.4 */ export declare class ExtGState extends PDFResource { readonly key: string; private readonly _options; constructor(options: ExtGStateOptions); get options(): Readonly; register(context: PDFContext): PDFRef; /** * Computes a unique key based on the options for deduplication. */ private computeKey; }