import * as em from "./Enums"; import { type Image } from "./Image"; import { type Bitmap } from "./Bitmap"; import { type BilevelBitmap } from "./BilevelBitmap"; import { type GrayscaleBitmap } from "./GrayscaleBitmap"; import { type Pen } from "./Pen"; import { type Brush } from "./Brush"; import { type Font } from "./Font"; import { type FontCollection } from "./FontCollection"; import { type Format } from "./Format"; import { type Layout } from "./Layout"; import { type SplitOptions } from "./SplitOptions"; import { type Transform } from "./Transform"; /** * Represents a color in one of the following formats: * - Named colors, such as "SandyBrown", "RebeccaPurple", "aliceblue". * - Named colors with transparency, such as "rgba(blueviolet, 50%)", "hsl(Plum / 0.7)". * - RGB Hexadecimal, such as "#f09", "#ff0099". * - RGBA Hexadecimal, such as "#f093", "#ff009933". * - RGB (Red, Green, Blue), such as "rgb(255 10% 153)", "rgb(255 10% 153 / 80%)". * - RGBA (Red, Green, Blue, Alpha), such as "rgba(255, 10%, 153)", "rgba(255 10% 153 0.8)". * - HSL (Hue, Saturation, Lightness), such as "hsl(30 82% 43%)", "hsl(270 82 43 / 50%)". * - HSLA (Hue, Saturation, Lightness, Alpha), such as "hsla(30 82 43%)", "hsla(270 82 43 / 0.5)". * - array of RGB integers, such as [0xFF, 0x00, 0x99]. * - array of RGBA values, such as [255, 0, 153, 0.5]. **/ export type Color = string | number[]; /** * Represents a date/time value as a Date * or an ASCII string D:YYYYMMDDHHmmSSOHH'mm' where * - YYYY is the year * - MM is the month * - DD is the day (01-31) * - HH is the hour (00-23) * - mm is the minute (00-59) * - SS is the second (00-59) * - O is the relationship of local time to Universal Time (UT), denoted by one of the characters +, -, or Z (local time is equal to UT) * - HH followed by ' is the absolute value of the offset from UT in hours (00–23) * - mm followed by ' is the absolute value of the offset from UT in minutes (00–59) * * The apostrophe character (') after HH and mm is part of the syntax. * All fields after the year are optional. * * For example, December 23, 1998, at 7:52 PM, U.S. Pacific Standard Time, is represented by the string * D:199812231952-08'00' **/ export type PdfDateTime = Date | string; /** * Represents an {@link Image} or any bitmap object. **/ export type ImageOrBitmap = Image | Bitmap | BilevelBitmap | GrayscaleBitmap; /** * Represents a location in (x, y) coordinate space. * The origin is at the top left corner. **/ export type Point = { /** * The X coordinate. */ x: number; /** * The Y coordinate. */ y: number; }; /** * Represents the width and height of an object. **/ export type Size = { /** * The width. */ width: number; /** * The height. */ height: number; }; /** * Represents the location and size of a rectangle. * The origin is at the top left corner. **/ export type Rect = { /** * The X coordinate of the rectangle. */ x: number; /** * The Y coordinate of the rectangle. */ y: number; /** * The width of the rectangle. */ width: number; /** * The height of the rectangle. */ height: number; }; /** * Represents rectangular boundaries in various ways. * The origin is at the top left corner. **/ export type Bounds = { /** * The X coordinate of the rectangle. */ x?: number; /** * The Y coordinate of the rectangle. */ y?: number; /** * The width of the rectangle. */ width?: number; /** * The height of the rectangle. */ height?: number; /** * Coordinate of the left side of the rectangle. */ left?: number; /** * Coordinate of the top side of the rectangle. */ top?: number; /** * Coordinate of the right side of the rectangle. */ right?: number; /** * Coordinate of the bottom side of the rectangle. */ bottom?: number; /** * Coordinates of the top left corner of the rectangle. */ location?: Point; /** * The size of the rectangle. */ size?: Size; }; /** * Represents a quadrilateral. */ export type Quadrilateral = { /** * The first vertex of the quadrilateral. * If initialized from a rectangle, corresponds to the rectangle's bottom left corner. */ a: Point; /** * The second vertex of the quadrilateral. * If initialized from a rectangle, corresponds to the rectangle's top left corner. */ b: Point; /** * The third vertex of the quadrilateral. * If initialized from a rectangle, corresponds to the rectangle's top right corner. */ c: Point; /** * The fourth vertex of the quadrilateral. * If initialized from a rectangle, corresponds to the rectangle's bottom right corner. */ d: Point; }; /** * Represents four values corresponding to the four sides of a rectangular area. **/ export type Offsets = { /** * The left side offset. */ left: number; /** * The top side offset. */ top: number; /** * The right side offset. */ right: number; /** * The bottom side offset. */ bottom: number; }; /** * Represents options used by: * {@link PdfDocument#exportFormDataToFDF} methods. */ export type ExportFormDataOptions = { /** * Gets or sets a value indicating whether values of {@link TextField} fields with * the property {@link TextField#password} set to true should be exported. */ exportPasswordFields?: boolean; }; /** * Defines ID of PDF file. */ export type FileID = { /** * Gets or sets 16-byte array defining a permanent identifier based on the contents of the file at the time it was originally * created and does not change when the file is incrementally updated. */ permanentID: number[]; /** * Gets or sets 16-byte array defining a changing identifier based on the file's contents at the time it was last updated. */ changingID: number[]; }; /** * Represents text search parameters. */ export type FindTextParams = { /** * The text to search. */ text: string; /** * Indicates whether to match whole words only. The default is false. */ wholeWord?: boolean; /** * Indicates whether to match case. The default is false. */ matchCase?: boolean; }; /** * Represents a fragment of text in a text map. */ export type TextMapFragment = TextLineFragment[]; /** * Defines a position on the {@link PdfDocument}'s page where the text was found. */ export type FoundPosition = { /** * The page index. */ pageIndex: number; /** * The text near the found position. */ nearText: string; /** * The zero-based position of the found string in 'nearText'. */ positionInNearText: number; /** * The {@link TextMapFragment} defining the position of found text. */ textMapFragment: TextMapFragment; /** * The array of {@link Quadrilateral} defining the area of found text on the page. */ bounds: Quadrilateral[]; }; /** * Represents a range of characters in a text line. */ export type TextLineFragment = { /** * The index of the text line in the text map. */ lineIndex: number; /** * The index of the first char in the text line. */ startIndex: number; /** * The number of text char in this fragment. * A value of -1 indicates that this fragment includes all characters * from 'startIndex' to the end of the line. */ length: number; }; /** * Identifies a typographic feature in the OpenType font. **/ export type FontFeature = { /** * The OpenType name identifier of the feature. **/ featureTag: string; /** * Indicates whether the feature should be enabled. **/ enabled?: boolean; /** * 1-based position of the alternate glyph ID in Alternate Substitution lookup. **/ parameter?: number; /** * Indicates whether the last alternative should be applied if the specified position exceeds the number of alternatives. **/ applyLastAlternative?: boolean; }; /** * Search options to be passed to the {@link FontCollection#searchFont} method. **/ export type SearchFontOptions = { /** * The full font name that reflects all family and relevant subfamily descriptors. **/ fullFontName?: string; /** * The PostScript name of the font. **/ postScriptName?: string; /** * The font family name. Up to four faces can share the same font family name. **/ fontFamily?: string; /** * If true, searches for the Bold font. **/ bold?: boolean; /** * If true, searches for the Italic font. **/ italic?: boolean; }; /** * Provides settings for creating a new instance of {@link BilevelBitmap}. **/ export type BilevelBitmapProperties = { /** * Specifies whether pixels with lower column indices are stored in the lower-order bits of the byte. **/ lowerBitsFirst?: boolean; /** * Indicates whether the image is used to define an alpha mask of another image. **/ transparencyMask?: boolean; /** * Indicates whether 0 represents white and 1 represents black (if true) or vice versa (if false). **/ whiteIsZero?: boolean; /** * The optional value to initialize pixels of a BilevelBitmap (true is 1, false is 0). **/ initialValue?: number | boolean; }; /** * Provides settings for creating a new instance of {@link GrayscaleBitmap}. **/ export type GrayscaleBitmapProperties = { /** * Indicates whether the image is used to define an alpha mask of another image. **/ transparencyMask?: boolean; /** * If true, specifies that 0 is imaged as white and 255 is imaged as black. **/ whiteIsZero?: boolean; /** * The optional value to initialize pixels of a GrayscaleBitmap (between 0 and 255). **/ initialValue?: number; }; /** * Provides options for the {@link Bitmap#resize} method. **/ export type ResizeBitmapOptions = { /** * The width of the resized image, in pixels. **/ width?: number; /** * The height of the resized image, in pixels. **/ height?: number; /** * The scale factor for resizing. **/ scale?: number; /** * Clipping rectangle specifying the area of the source image to be processed. **/ clipBounds?: Bounds | null; /** * The interpolation mode to use when scaling. **/ interpolationMode?: em.InterpolationMode; }; /** * Provides options for the {@link Bitmap#bitBlt} method. **/ export type BitBltOptions = { /** * The width, in pixels, of the source and destination rectangles. **/ width?: number; /** * The height, in pixels, of the source and destination rectangles. **/ height?: number; /** * The x-coordinate, in pixels, of the upper-left corner of the source rectangle. **/ srcX?: number; /** * The y-coordinate, in pixels, of the upper-left corner of the source rectangle. **/ srcY?: number; /** * Clipping rectangle specifying the area of the destination Bitmap to be processed. **/ clipBounds?: Bounds | null; }; /** * Provides options for the {@link Bitmap#alphaBlend} method. **/ export type AlphaBlendOptions = BitBltOptions & { /** * The opacity [0, 1] of the source bitmap, to multiply to the source bitmap's alpha channel. The default is 1. **/ opacity?: number; }; /** * Provides options for the {@link Bitmap#compositeAndBlend} method. **/ export type CompositeAndBlendOptions = BitBltOptions & { /** * The Porter Duff compositing method. The default is "SourceOver". **/ compositeMode?: em.CompositeMode; /** * The blending method used to mix the source and destination colors. The default is "Normal". **/ blendMode?: em.BlendMode; }; /** * Provides settings for creating a {@link DrawingContext} for {@link Bitmap}. **/ export type BmpContextProperties = { /** * The scale factor for mapping from graphic units to pixels. * The default is 1.0: the width and height are in pixels (96 DPI). **/ scale?: number; /** * The width of the drawing surface, in graphic units. **/ width?: number; /** * The height of the drawing surface, in graphic units. **/ height?: number; /** * An optional background color to fill the drawing surface. **/ backColor?: Color | null; }; /** * Provides settings for creating a new {@link Pen}. **/ export type PenProperties = { /** * A reference to the pen used as the base for the new pen. **/ basePen?: Pen | null; /** * The pen color. The default is Black. * Overrides the value from base pen if {@link PenProperties.basePen} is specified. **/ color?: Color; /** * The pen width, in units used for drawing. The default is 1. * Overrides the value from base pen if {@link PenProperties.basePen} is specified. **/ width?: number; /** * The line cap style specifies the shape to be used at the ends of open subpaths (and dashes, if any) when they are stroked. * Overrides the value from base pen if {@link PenProperties.basePen} is specified. **/ lineCap?: em.PenLineCap; /** * The line join style specifies the shape to be used at the corners of paths that are stroked. * Overrides the value from base pen if {@link PenProperties.basePen} is specified. **/ lineJoin?: em.PenLineJoin; /** * A maximum on the ratio of the miter length to the pen width. When the limit is exceeded, the join is converted from a miter to a bevel. * Overrides the value from base pen if {@link PenProperties.basePen} is specified. **/ miterLimit?: number; /** * The distance within the dash pattern where a dash begins. The default value is 0. * Overrides the value from base pen if {@link PenProperties.basePen} is specified. **/ dashOffset?: number; /** * The style of dashed lines drawn with this pen. * Overrides the value from base pen if {@link PenProperties.basePen} is specified. **/ dashStyle?: em.DashStyle; /** * The custom dash pattern of lines drawn with this pen. * Overrides the value from base pen if {@link PenProperties.basePen} is specified. **/ dashPattern?: number[] | null; }; /** * Represents a transition point in a gradient. **/ export type GradientStop = { /** * The color of this gradient stop. **/ color: Color; /** * The location of this stop within the gradient vector. Valid values are from 0 (vector's start) to 1 (vector's end). **/ offset: number; }; /** * Provides settings for creating a linear gradient brush. **/ export type LinearGradientBrushProperties = { /** * The starting gradient color. **/ startColor: Color; /** * The start point of the current linear gradient brush. (0, 0) is the top-left corner, (1, 1) is the bottom-right corner. * The default is (0, 0.5). **/ startPoint?: Point; /** * The ending gradient color. **/ endColor: Color; /** * The end point of the current linear gradient brush. (0, 0) is the top-left corner, (1, 1) is the bottom-right corner. * The default is (1, 0.5). **/ endPoint?: Point; /** * The array of gradient stops. **/ gradientStops?: GradientStop[] | null; }; /** * Provides settings for creating a radial gradient brush. **/ export type RadialGradientBrushProperties = { /** * The starting gradient color. **/ startColor: Color; /** * The ending gradient color. **/ endColor: Color; /** * The array of gradient stops. **/ gradientStops?: GradientStop[] | null; /** * The radius of the end circle that defines the end of the gradient, as a fraction of the normalized diagonal. * The normalized diagonal length is calculated as sqrt(width * width + height * height) / 2. * If not specified, the end radius is equal to max(width, height) / 2. **/ radiusOfEndCircle?: number | null; /** * The radius of the start circle that defines the beginning of the gradient, as a fraction of the normalized diagonal. * The normalized diagonal length is calculated as sqrt(width * width + height * height) / 2. * The default is 0. **/ radiusOfStartCircle?: number; /** * The center of the end circle that defines the end of the gradient. * (0, 0) is the top-left corner, (1, 1) is the bottom-right corner. * The default is (0.5, 0.5). **/ centerOfEndCircle?: Point; /** * The center of the start circle that defines the beginning of the gradient. * (0, 0) is the top-left corner, (1, 1) is the bottom-right corner. * If not specified, the center of the start circle coincides with {@link RadialGradientBrushProperties.centerOfEndCircle}. **/ centerOfStartCircle?: Point | null; /** * Indicates whether to extend the gradient beyond the start circle. * The default is true. **/ extendStartCircle?: boolean; /** * Indicates whether to extend gradient beyond the end circle. * The default is true. **/ extendEndCircle?: boolean; /** * Indicates whether to normalize the brush ensuring that it renders the same way on all supported * target contexts (such as {@link PdfContext}, {@link BmpContext}, and {@link SvgContext}). * If true, and the focal point is outside the end circle, it is moved to be on the end circle. * If false, the focal point position is not adjusted if it is outside the end circle, * and the result will depend on the implementation of the target {@link DrawingContext}. * The default is true. **/ normalize?: boolean; }; /** * Provides settings for creating a brush with hatch style. **/ export type HatchBrushProperties = { /** * The hatch style of the {@link HatchBrush}. **/ style?: em.HatchStyle; /** * The color of spaces between the hatch lines. **/ backColor?: Color; /** * The color of hatch lines. **/ foreColor?: Color; }; /** * Represents text formatting attributes such as font, colors, decorations and so on. **/ export type FormatProperties = { /** * A reference to the Format object to copy the initial data from. **/ baseFormat?: Format | null; /** * A reference to the font to be used by this format. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ font?: Font | null; /** * Index of a palette used for drawing color fonts. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ paletteIndex?: number | null; /** * The font family name. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ fontFamily?: string; /** * Indicates whether the font should be bolded. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ bold?: boolean; /** * Indicates whether the font should be italicized. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ italic?: boolean; /** * The logical font size, in graphic units. The default value is 16. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ fontSize?: number; /** * Indicates whether the size of a fallback font should be coerced to the size of original font. The default is true. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ recalcFontSizeForFallbackFonts?: boolean; /** * Indicates if the glyphs should be displayed as subscript. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ subscript?: boolean; /** * Indicates if the glyphs should be displayed as superscript. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ superscript?: boolean; /** * Indicates if the text is underlined. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ underline?: boolean; /** * Indicates if the text is double underlined. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ doubleUnderline?: boolean; /** * Indicates if the strikethrough style is applied to the text. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ strikethrough?: boolean; /** * Text foreground color. The default is black. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ foreColor?: Color; /** * Text background color. The default is transparent. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ backColor?: Color; /** * Indicates if the embedded bitmaps from the EBDT font table can be used. The default is true. * This property affects text drawing on BmpContext only. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ allowFontSbits?: boolean; /** * Indicates if the glyphs are hollow (outlined), otherwise they are solid. The strokePen property must be set in order to draw outlined glyphs. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ hollow?: boolean; /** * A reference to the pen to draw glyph outlines. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ strokePen?: Pen | null; /** * A reference to the brush to fill the glyphs. * This property has a priority over the foreColor. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ fillBrush?: Brush | null; /** * The array of Microsoft OpenType typography properties. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ fontFeatures?: FontFeature[] | null; /** * Indicates whether the typographical font metrics should be applied instead of Windows-specific and Apple-specific font metrics. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ useTypoMetrics?: boolean; /** * The preferred glyph widths (generally used in CJKV fonts). * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ glyphWidths?: em.GlyphWidths; /** * The Neutral Culture string. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ language?: string; /** * Indicates whether the whole text run should be considered as a single Grapheme Cluster. * It allows displaying several characters side-by-side horizontally in vertical text. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ textRunAsCluster?: boolean; /** * Indicates if the normally sideways characters should be drawn upright in vertical text. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ uprightInVerticalText?: boolean; /** * Indicates if all characters should appear as rotated 90 or -90 degrees in vertical text. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ sidewaysInVerticalText?: boolean; /** * Indicates if ASCII characters should be transformed into fullwidth characters. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ transformToFullWidth?: boolean; /** * Indicates whether the canonical decomposition, reordering, and composition stages should be omitted. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ skipNormalization?: boolean; /** * Indicates whether to apply normalization to Singleton Decompositions and Post Composition Version precomposed characters. * If set to true, CJK compatibility ideographs can be changed to CJK unified ideographs during the normalization process. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ strictCanonicalDecomposition?: boolean; /** * Indicates whether the character 'HYPHEN-MINUS' (U+002D) is treated as the character 'HYPHEN' (U+2010) by the Unicode line breaking algorithm. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ treatHyphenMinusAsHyphen?: boolean; /** * The character width scale factor. Valid values are between 0.1 and 10.0. The default is 1. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ charWidthFactor?: number; /** * The scaling factor for the glyph advance value relative to font's Average Character Width. Valid values are from 0.5 up. The default is 1. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ glyphAdvanceFactor?: number; /** * The absolute increment (delta) for the glyph advance value, in graphic units. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ glyphAdvanceOffset?: number; /** * The offset of the text in the orthogonal direction, in graphic units. The default is 0. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ transverseOffset?: number; /** * Specifies the explicit line gap (if not null), in graphic units. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ lineGap?: number | null; /** * Indicates that for sideways text in vertical flow, line gap will be set according to {@link Font.verticalLineGap}. * If false (the default), line gap for lines containing sideways text is set according to {@link Font.horizontalLineGap}, * which can lead to different gaps between columns that contain sideways text runs and those that do not. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ useVerticalLineGapForSideways?: boolean; /** * Indicates if the horizontal ascending, descending, and line gap settings should be applied to vertical text. * The special vertical metrics are used by default. * Overrides the value from base format if {@link FormatProperties.baseFormat} is specified. **/ useHorizontalMetricsForVerticalText?: boolean; }; /** * Represents a section of formatted text. **/ export type RunProperties = { /** * The text of the section. **/ text: string; /** * A reference to the Format to be applied to the section. * Setting any of the subsequent properties creates a new format based on 'format'. * The null or empty value indicates the default format. **/ format?: Format | null; /** * A reference to the font to be used by this run. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ font?: Font | null; /** * Index of a palette used for drawing color fonts. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ paletteIndex?: number | null; /** * The font family name. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ fontFamily?: string; /** * Indicates whether the font should be bolded. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ bold?: boolean; /** * Indicates whether the font should be italicized. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ italic?: boolean; /** * The logical font size, in graphic units. The default value is 12. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ fontSize?: number; /** * Indicates whether the size of fallback font should be coerced to the size of original font (true by default). * Overrides the value from base format if {@link RunProperties.format} is specified. **/ recalcFontSizeForFallbackFonts?: boolean; /** * Indicates if the glyphs should be displayed as subscript. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ subscript?: boolean; /** * Indicates if the glyphs should be displayed as superscript. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ superscript?: boolean; /** * Indicates if the text is underlined. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ underline?: boolean; /** * Indicates if the text is double underlined. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ doubleUnderline?: boolean; /** * Indicates if the strikethrough style is applied to the text. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ strikethrough?: boolean; /** * Text foreground color. The default is black. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ foreColor?: Color; /** * Text background color. The default is transparent. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ backColor?: Color; /** * Indicates if the glyphs are hollow (outlined), otherwise they are solid. The strokePen property must be set in order to draw outlined glyphs. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ hollow?: boolean; /** * A reference to the pen to draw glyph outlines. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ strokePen?: Pen | null; /** * A reference to the brush to fill the glyphs. * This property has a priority over the foreColor. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ fillBrush?: Brush | null; /** * An array of Microsoft OpenType typography properties. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ fontFeatures?: FontFeature[] | null; /** * Indicates whether the typographical font metrics should be applied instead of Windows-specific and Apple-specific font metrics. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ useTypoMetrics?: boolean; /** * The preferred glyph widths (generally used in CJKV fonts). * Overrides the value from base format if {@link RunProperties.format} is specified. **/ glyphWidths?: em.GlyphWidths; /** * The Neutral Culture string. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ language?: string; /** * Indicates whether the whole text run should be considered as a single Grapheme Cluster. * It allows displaying several characters side-by-side horizontally in vertical text. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ textRunAsCluster?: boolean; /** * Indicates if the normally sideways characters should be drawn upright in vertical text. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ uprightInVerticalText?: boolean; /** * Indicates if all characters should appear as rotated 90 or -90 degrees in vertical text. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ sidewaysInVerticalText?: boolean; /** * Indicates if ASCII characters should be transformed into fullwidth characters. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ transformToFullWidth?: boolean; /** * Indicates whether the canonical decomposition, reordering, and composition stages should be omitted. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ skipNormalization?: boolean; /** * Indicates whether to apply normalization to Singleton Decompositions and Post Composition Version precomposed characters. * If set to true, CJK compatibility ideographs can be changed to CJK unified ideographs during the normalization process. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ strictCanonicalDecomposition?: boolean; /** * Indicates whether the character 'HYPHEN-MINUS' (U+002D) is treated as the character 'HYPHEN' (U+2010) by the Unicode line breaking algorithm. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ treatHyphenMinusAsHyphen?: boolean; /** * The character width scale factor. Valid values are between 0.1 and 10.0. The default is 1. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ charWidthFactor?: number; /** * The scaling factor for the glyph advance value relative to font's Average Character Width. Valid values are from 0.5 up. The default is 1. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ glyphAdvanceFactor?: number; /** * The absolute increment (delta) for the glyph advance value, in graphic units. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ glyphAdvanceOffset?: number; /** * The offset of the text in the orthogonal direction, in graphic units. The default is 0. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ transverseOffset?: number; /** * Specifies the explicit line gap (if not null), in graphic units. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ lineGap?: number | null; /** * Indicates that for sideways text in vertical flow, line gap will be set according to {@link Font.verticalLineGap}. * If false (the default), line gap for lines containing sideways text is set according to {@link Font.horizontalLineGap}, * which can lead to different gaps between columns that contain sideways text runs and those that do not. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ useVerticalLineGapForSideways?: boolean; /** * Indicates if the horizontal ascending, descending, and line gap settings should be applied to vertical text. * The special vertical metrics are used by default. * Overrides the value from base format if {@link RunProperties.format} is specified. **/ useHorizontalMetricsForVerticalText?: boolean; }; /** * Represents a tab stop in a {@link Layout} object. **/ export type TabStop = { /** * The tab stop position relative to the left/right (for LTR/RTL text) margin, in graphic units. **/ offset: number; /** * Specifies how the text is aligned relative to the tab stop. **/ alignment?: em.TabStopAlignment; /** * The type of the leader line displayed under the tab character. **/ leader?: em.TabStopLeader; /** * The separator character or its UTF-32 code used when the alignment property is set to "Separator". **/ separator?: number | string; }; /** * Specifies properties for a new {@link Layout} object. * Represents one or more paragraphs of multi-formatted text. Provides text analysis and layout functionality. **/ export type LayoutProperties = { /** * The array of text runs to apply layout. **/ runs?: RunProperties[]; /** * A reference to the Layout object to copy the initial data from. **/ baseLayout?: Layout | null; /** * The base direction for horizontal and sideways text. The default is false. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ rightToLeft?: boolean; /** * The flow direction (how lines of text are placed relative to one another). * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ flowDirection?: em.FlowDirection; /** * Indicates whether sideways text should be rotated counterclockwise. The default is false. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ rotateSidewaysCounterclockwise?: boolean; /** * The alignment of paragraphs along the flow direction axis. The default is "Near". * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ paragraphAlignment?: em.ParagraphAlignment; /** * The alignment of text along the reading direction axis. The default is "Leading". * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ textAlignment?: em.TextAlignment; /** * A reference to the {@link Format} object to be used as default text format for the current {@link Layout}. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ defaultFormat?: Format | null; /** * The font collection used for searching fonts and font fallbacks. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ fontCollection?: FontCollection | null; /** * Indicates whether the fonts should be searched in the custom collection only, if any specified. The default is false. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ restrictedFontLookup?: boolean; /** * Specifies the scope for searching fallback fonts for the glyphs missing in the font defined in {@link Format}. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ fontFallbackScope?: em.FontFallbackScope; /** * Indicates if the linked and fallback fonts have to be embeddable. The default is false. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ useEmbeddableFonts?: boolean; /** * Indicating if shaping and positioning of graphemes should be skipped for the sake of speed. The default is false. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ suppressShaping?: boolean; /** * The uniform scale factor for all fonts used in the current {@link Layout}. Valid values are from 0.001 to 1000. The default is 1. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ fontScaleFactor?: number; /** * The maximum fraction of the last line's height overflowing beyond the layout bounds for that line not to be truncated. * The default is 0 (last line must completely fit within the layout bounds). Valid values are from 0 to 1. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ maxLastLineOverflowFactor?: number; /** * The width of the layout box, in graphic units. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ maxWidth?: number | null; /** * The height of the layout box, in graphic units. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ maxHeight?: number | null; /** * Sets all margins of the layout box, in graphic units. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ marginAll?: number; /** * The left margin of the layout box, in graphic units. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ marginLeft?: number; /** * The right margin of the layout box, in graphic units. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ marginRight?: number; /** * The top margin of the layout box, in graphic units. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ marginTop?: number; /** * The bottom margin of the layout box, in graphic units. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ marginBottom?: number; /** * The width of the layout box measured from the left margin (for positive values) or from the right margin (for negative values), in graphic units. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ columnWidth?: number | null; /** * The height of the layout box measured from the top margin (for positive values) or from the bottom margin (for negative values), in graphic units. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ rowHeight?: number | null; /** * Specifies how text lines are broken to avoid text overflowing the layout box. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ wrapMode?: em.WrapMode; /** * Indicates whether long words can overhang beyond the layout box bounds. The default is false. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ allowOverhangingWords?: boolean; /** * The text granularity used to trim text overflowing the layout box. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ trimmingGranularity?: em.TrimmingGranularity; /** * A UTF-32 code of the omission sign (ellipsis character) for text trimming. Setting this property to 0 prevents the ellipsis character from showing. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ ellipsisCharCode?: number; /** * A UTF-32 character code used as a delimiter that signals the beginning of the portion of text to be preserved (for text trimming). * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ delimiterCharCode?: number; /** * The delimiter count, counting from the end of the text, to preserve text from (for text trimming). * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ delimiterCharCount?: number; /** * A UTF-32 character code used as replacement for soft hyphen characters (0x00AD) at ends of lines when breaking words across lines. * The default is 0x002D (the Unicode hyphen-minus character). * Setting this to 0 breaks words without showing any visible hyphen character. * Setting this to -1 prevents breaking words at soft hyphens. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ softHyphenReplacementCharCode?: number; /** * The minimum number of lines not using hyphens after breaking a word across lines and displaying a visible hyphen at the position of soft hyphen. The default is 0. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ linesBetweenConsecutiveHyphens?: number; /** * Indicates whether the typographic line gap should be added before the first line of text. The default is false. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ lineGapBeforeFirstLine?: boolean; /** * Indicates whether the line spacing should be added after the last line of text. The default is false. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ addSpacingAfterLastLine?: boolean; /** * Indicates whether the first line of text is the start of paragraph. The default is true. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ firstLineIsStartOfParagraph?: boolean; /** * Indicates whether the last line of text is the end of paragraph. The default is true. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ lastLineIsEndOfParagraph?: boolean; /** * The additional spacing between paragraphs, in graphic units. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ paragraphSpacing?: number; /** * Spacing between the default tab stops, in graphic units. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ defaultTabSize?: number; /** * The array of custom tab stops. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ tabStops?: TabStop[] | null; /** * The indent of the first line after paragraph separator, in graphic units. * Positive value applies indentation to the first line, negative value applies indentation to all lines except the first one. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ firstLineIndent?: number; /** * Indicates whether the whole first line of a paragraph with indentation can be skipped. The default is true. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ canSkipFirstLineWithIndentation?: boolean; /** * Specifies the rules used for justified text extension. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ textExtensionStrategy?: em.TextExtensionStrategy; /** * Specifies the line breaking algorithm. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ lineBreakingRules?: em.LineBreakingRules; /** * Specifies the word breaking algorithm. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ wordBoundaryRules?: em.WordBoundaryRules; /** * Indicating whether for paragraphs that have textAlignment set to "Distributed" the last line will be justified (typical in East Asian typography). * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ justifyLastLine?: boolean; /** * The white space shrinking factor when text is justified. Valid values are from 0.0 to 1.0. The default is 0.2. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ justifiedSpaceShrinking?: number; /** * The maximum white space extension factor before applying extension to other characters when text is justified. Valid values are from 0 to 10000. The default is 2.5. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ justifiedSpaceExtension?: number; /** * The maximum text extension factor when text is justified. Valid values are from 0 to 10000. The default is 0.3. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ justifiedTextExtension?: number; /** * The scaling factor to be applied to the computed line height. Valid values are from 0 to 1000. The default is 1. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ lineSpacingScaleFactor?: number; /** * The explicit distance between lines, in graphic units. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ uniformLineSpacing?: number | null; /** * The explicit minimal distance between lines, in graphic units. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ minimalLineSpacing?: number | null; /** * Indicates whether line spacing for the last line is considered a part of the layout content. The default is false. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ honorLastLineSpacing?: boolean; /** * Indicates whether the ideographic baseline should be used instead of the Roman baseline for hieroglyph characters. The default is false. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ honorIdeographicBaseline?: boolean; /** * Indicates whether the trailing line break causes a blank line to be added to the output text layout. The default is false. * Overrides the value from base Layout if {@link LayoutProperties.baseLayout} is specified. **/ honorTrailingLineBreak?: boolean; }; /** * Provides options for text splitting. **/ export type SplitOptionsProperties = { /** * A reference to the {@link Layout} object to copy the initial data from. **/ baseLayout?: Layout | null; /** * A reference to the {@link SplitOptions} object to copy the initial data from. * If the {@link SplitOptionsProperties.baseLayout} is assigned, this property is ignored. **/ baseSplitOptions?: SplitOptions | null; /** * Indicates whether, if no part of the content can fit in the current Layout, * to move all content to the rest Layout. The default is false. * Overrides the existing value if either {@link SplitOptionsProperties.baseLayout} or {@link SplitOptionsProperties.baseSplitOptions} are specified. **/ allowMovingAllToRest?: boolean; /** * The width of the layout box for the rest of the text after splitting, in graphic units. * Overrides the existing value if either {@link SplitOptionsProperties.baseLayout} or {@link SplitOptionsProperties.baseSplitOptions} are specified. **/ restMaxWidth?: number | null; /** * The height of the layout box for the rest of the text after splitting, in graphic units. * Overrides the existing value if either {@link SplitOptionsProperties.baseLayout} or {@link SplitOptionsProperties.baseSplitOptions} are specified. **/ restMaxHeight?: number | null; /** * The left margin of the layout box for the rest of the text after splitting, in graphic units. * Overrides the existing value if either {@link SplitOptionsProperties.baseLayout} or {@link SplitOptionsProperties.baseSplitOptions} are specified. **/ restMarginLeft?: number; /** * The right margin of the layout box for the rest of the text after splitting, in graphic units. * Overrides the existing value if either {@link SplitOptionsProperties.baseLayout} or {@link SplitOptionsProperties.baseSplitOptions} are specified. **/ restMarginRight?: number; /** * The top margin of the layout box for the rest of the text after splitting, in graphic units. * Overrides the existing value if either {@link SplitOptionsProperties.baseLayout} or {@link SplitOptionsProperties.baseSplitOptions} are specified. **/ restMarginTop?: number; /** * The bottom margin of the layout box for the rest of the text after splitting, in graphic units. * Overrides the existing value if either {@link SplitOptionsProperties.baseLayout} or {@link SplitOptionsProperties.baseSplitOptions} are specified. **/ restMarginBottom?: number; /** * The width of the layout box measured from left or right margin for the rest of the text after splitting, in graphic units. * Overrides the existing value if either {@link SplitOptionsProperties.baseLayout} or {@link SplitOptionsProperties.baseSplitOptions} are specified. **/ restColumnWidth?: number | null; /** * The height of the layout box measured from top or bottom margin for the rest of the text after splitting, in graphic units. * Overrides the existing value if either {@link SplitOptionsProperties.baseLayout} or {@link SplitOptionsProperties.baseSplitOptions} are specified. **/ restRowHeight?: number | null; /** * The minimum number of lines that must appear at the beginning of the last paragraph to prevent orphans. * Overrides the existing value if either {@link SplitOptionsProperties.baseLayout} or {@link SplitOptionsProperties.baseSplitOptions} are specified. **/ minLinesInLastParagraph?: number; /** * The minimum number of lines on the last page (or at the ending of the first paragraph on the next page) to prevent widows. * Overrides the existing value if either {@link SplitOptionsProperties.baseLayout} or {@link SplitOptionsProperties.baseSplitOptions} are specified. **/ minLinesInFirstParagraph?: number; /** * Indicates whether paragraphs should be kept together (cannot be split between pages or columns). * Overrides the existing value if either {@link SplitOptionsProperties.baseLayout} or {@link SplitOptionsProperties.baseSplitOptions} are specified. **/ keepParagraphLinesTogether?: boolean; /** * Indicates whether a line spacing should be added after the last line of the current Layout after splitting. * Overrides the existing value if either {@link SplitOptionsProperties.baseLayout} or {@link SplitOptionsProperties.baseSplitOptions} are specified. **/ addSpacingAfterLastLine?: boolean; /** * Indicates whether the typographic line gap should be added before the first line of the rest Layout. * Overrides the existing value if either {@link SplitOptionsProperties.baseLayout} or {@link SplitOptionsProperties.baseSplitOptions} are specified. **/ lineGapBeforeFirstLine?: boolean; }; /** * Represents an isolated section of text with the same formatting. **/ export type GlyphRun = { /** * Indicates if the glyph run should appear from right to left. * This affects how the 'offset', 'length', and 'advance' properties are applied. **/ rightToLeft: boolean; /** * The offset of the glyph run start along the reading direction * (the X coordinate for horizontal text), in graphic units. **/ offset: number; /** * The length of the glyph run along the reading direction * (the width for horizontal text), in graphic units. **/ length: number; /** * The array of code point indices (not UTF-32 code points!) in * the code points array returned from Layout.getCodePoints(). **/ indices: number[]; /** * The array of glyph advances for each code point, in graphic units. **/ advance: number[]; }; /** * Represents a single line of text in a {@link Layout} object. **/ export type TextLine = { /** * The position of the text line along the flow direction (the Y coordinate of the line top for horizontal text), in graphic units. **/ position: number; /** * The width of the line, in graphic units. **/ width: number; /** * The height of the line, in graphic units. **/ height: number; /** * The indent of the text line, in graphic units. **/ indent: number; /** * The additional spacing before the text line, in graphic units. **/ lineGap: number; /** * The additional spacing after the text line, in graphic units. **/ spacing: number; /** * The offset from line position to the Roman baseline, in graphic units. **/ baselineOffset: number; /** * The offset from the Roman baseline to Ideographic centered baseline, in graphic units. * This property exists only for vertical flow direction. **/ verticalBaselineOffset?: number; /** * The length (width or height) of the trailing whitespace, in graphic units. **/ trailingWhitespaceLength: number; /** * Indicates whether the line is the first in the paragraph. **/ firstLineInParagraph: boolean; /** * Indicates whether the line is the last in the paragraph. **/ lastLineInParagraph: boolean; /** * Indicates whether the current line is trimmed. **/ trimmed: boolean; /** * The array of glyph runs in the text line. **/ glyphRuns: GlyphRun[]; }; /** * Specifies properties of an SVG attribute. **/ export type SvgAttribute = { /** * The name of the attribute, including the optional prefix. **/ attributeName: string; /** * A string value of the attribute. **/ value: string; /** * The namespace of the attribute. **/ namespace?: string; }; /** * Provides settings for creating a {@link DrawingContext} for SVG. **/ export type SvgContextProperties = { /** * A hint to the implementation about what tradeoffs to make as it renders vector graphics elements. **/ shapeRendering?: em.ShapeRendering; /** * A hint to the implementation about how to make speed vs. quality tradeoffs as it performs image processing. **/ imageRendering?: em.ImageRendering; /** * Indicates if text is rendered using the graphic primitives instead of the specialized text drawing services. **/ drawTextAsPath?: boolean; /** * Indicates whether the positions are set for each individual character within the 'text' element. **/ preciseCharPositions?: boolean; /** * Indicates whether the fonts used in 'text' elements should be embedded. **/ embedFonts?: boolean; }; /** * Provides settings for saving {@link SvgDocument} to a byte array. **/ export type SaveSvgOptions = { /** * The type of text encoding to use. The default is "UTF8". **/ encoding?: em.XmlEncoding; /** * Indicates whether to write the sequence of bytes that specifies the encoding used. **/ byteOrderMark?: boolean; /** * Indicates whether to omit an XML declaration. **/ omitXmlDeclaration?: boolean; /** * Indicates whether to skip comments in SVG. **/ skipComments?: boolean; /** * Indicates whether to indent elements. The default is true. **/ indent?: boolean; /** * Indicates whether to use CR LF sequence for new lines. **/ useWindowsNewLine?: boolean; /** * Indicates whether to write attributes on a new line. **/ newLineOnAttributes?: boolean; /** * Indicates whether to escape all non-ASCII characters. **/ escapeNonAscii?: boolean; }; /** * Represents the decryption options used when loading a PDF document. **/ export type PdfDecryptionOptions = { /** * The string specifying the password to open a PDF document. * Note if both 'password' and 'passwordBytes' are specified then 'passwordBytes' preferred. **/ password?: string; /** * The bytes array specifying the password to open a PDF document. * This property is useful when password contains specific regional character * which cannot be converted to bytes using UTF8 encoding. * Note if both 'password' and 'passwordBytes' are specified then 'passwordBytes' preferred. **/ passwordBytes?: string; /** * Indicating whether to throw an exception if the specified password is invalid. * If "false", the document will be opened even if the specified password is invalid, * but many methods and properties will not work in this case. * Not specified means "true". */ throwExceptionIfInvalidPassword?: boolean; /** * Indicating whether to throw an exception * if the definition of the security handler is in unknown or invalid format. * If "false", the document will be opened even if the security handler cannot be parsed, * but many methods and properties will not work in this case. * Not specified means "true". */ throwExceptionIfUnsupportedSecurityOptions?: boolean; }; /** * Provides options for creating a new {@link PdfDocument}. **/ export type PdfDocumentOptions = { /** * The default width of new pages, in points. **/ defaultPageWidth?: number; /** * The default height of new pages, in points. **/ defaultPageHeight?: number; /** * The compression level. The default is "Fastest". **/ compressionLevel?: em.CompressionLevel; /** * The PDF/A conformance level. The default is "None". **/ conformanceLevel?: em.PdfAConformanceLevel; /** * The format used to represent fonts in the PDF document. The default is "Type0AutoOneByteEncoding". **/ pdfFontFormat?: em.PdfFontFormat; /** * The font embedding mode. The default is "EmbedSubset". **/ fontEmbedMode?: em.FontEmbedMode; /** * The font embedding mode for the 14 standard PDF fonts. The default is "NotEmbed". **/ standardFontEmbedMode?: em.FontEmbedMode; }; /** * Contains information about the PDF document. This information includes the document author, title, keywords, etc. **/ export type DocumentInfoProperties = { /** * The title of the document. **/ title?: string; /** * The name of the application that created the original document. **/ creator?: string; /** * The name of the application that created the document. **/ producer?: string; /** * The name of the person that created the document. **/ author?: string; /** * The subject of the document. **/ subject?: string; /** * Keywords (separated by comma) associated with the document. **/ keywords?: string; /** * The creation date and time of the document. **/ createDate?: PdfDateTime; /** * The date and time the document was most recently modified. **/ modifyDate?: PdfDateTime; }; /** * Represents a custom metadata property. **/ export type MetadataUserProp = { /** * The XML namespace. **/ namespace: em.UserPropNamespace; /** * The property name. **/ name: string; /** * The property value. **/ value?: string; }; /** * Provides options for creating metadata for a PDF document. **/ export type MetadataProperties = { /** * The PDF/A conformance version. **/ pdfA?: em.PdfAConformanceLevel; /** * The PDF/UA conformance version. * Null indicates that the document is not PDF/UA compliant. **/ pdfUa?: number | null; /** * The document's producer. Maps to PDF 'Producer' property. **/ producer?: string; /** * The document's title. Maps to Dublin Core 'title' property. **/ title?: string; /** * The document description. Maps to Dublin Core 'description' property. **/ description?: string; /** * The document coverage. Maps to Dublin Core 'coverage' property. **/ coverage?: string; /** * The document identifier. Maps to Dublin Core 'identifier' property. **/ identifier?: string; /** * The document copyright. Maps to Dublin Core 'rights' property. **/ copyright?: string; /** * The document source. Maps to Dublin Core 'source' property. **/ source?: string; /** * The creation date. Maps to XMP 'CreateDate' property. * If not set, the current date/time is used. **/ createDate?: Date; /** * The modification date. Maps to XMP 'ModifyDate' property. * If not set, the current date/time is used. **/ modifyDate?: Date; /** * The metadata date. Maps to XMP 'MetadataDate' property. * If not set, the current date/time is used. **/ metadataDate?: Date; /** * The creator tool, in PDF/A compatible documents this value * should be the same as {@link DocumentInfo.creator}. **/ creatorTool?: string; /** * Indicates whether the metadata is marked as read-only. **/ readOnly?: boolean; /** * The list of document creators. Maps to Dublin Core 'creator' property. **/ creators?: string[]; /** * The list of document keywords, or subjects. Maps to Dublin Core 'subject' property. **/ keywords?: string[]; /** * The list of document contributors. Maps to Dublin Core 'contributor' property. **/ contributors?: string[]; /** * The list of document languages. Maps to Dublin Core 'language' property. **/ languages?: string[]; /** * The list of document publishers. Maps to Dublin Core 'publisher' property. **/ publishers?: string[]; /** * The list of document relations. Maps to Dublin Core 'relation' property. **/ relations?: string[]; /** * The list of document types. Maps to Dublin Core 'type' property. **/ types?: string[]; /** * The list of document dates. Maps to Dublin Core 'date' property. **/ dates?: string[]; /** * The list of document custom properties. **/ userProps?: MetadataUserProp[]; }; /** * Specifies which pages of the PDF document has to be exported or merged. * Note: all page numbers are 1-based. **/ export type OutputRange = { /** * The number of the first page (1-based) to include. **/ fromPage?: number; /** * The number of the last page (1-based) to include. **/ toPage?: number; /** * Indicates if the range's iterator should go from the end of the range backwards. **/ inverted?: boolean; /** * The array of page numbers (1-based) to include. **/ pageNumbers?: number[]; /** * The string specifying page numbers (1-based) and page intervals with dashes ('-'), separated by commas (','). * A dash at the start or at the end of interval implies infinity. **/ pages?: string; }; /** * Represents options for controlling the merging of PDF documents. **/ export type MergeDocumentOptions = { /** * Specifies the range of pages in the source document that will be merged into the destination document. * The default is all pages. **/ range?: OutputRange; /** * The starting position in the destination document at which the pages of the source document will be inserted. * -1 (default) means that pages will be added to the end of the document. **/ index?: number; /** * Specifies whether to do NOT parse content streams and copy all objects referenced from resource streams. * The default is false. **/ forceDirectCopy?: boolean; /** * Specifies whether to copy files embedded in the source document. * The default is false. **/ copyDocumentLevelEmbeddedFiles?: boolean; /** * Specifies whether to copy AcroForm fields. * The default is true. **/ copyFields?: boolean; /** * The outline merge mode. * The default is None (in this mode, outlines from the source document are ignored). **/ outlineMergeMode?: em.OutlineMergeMode; /** * Specifies whether to merge structure trees. * The default is false. **/ mergeStructTree?: boolean; /** * Specifies whether to copy named destinations. * The default is false. * Note that if the source document contains destinations with same names * as in the target document, then those destinations will be skipped. **/ copyNamedDestinations?: boolean; /** * Specifies whether to copy OptionalContent. * The default is true. **/ copyOptionalContent?: boolean; /** * Specifies whether to copy AssociatedFiles. * The default is true. **/ copyAssociatedFiles?: boolean; /** * Specifies whether to copy ArticleThreads. * The default is true. **/ copyArticleThreads?: boolean; }; /** * Provides options for the {@link PdfDocument#addEmbeddedFile} method. **/ export type FileSpecProperties = { /** * The file name (it is used as the key, must not duplicate). **/ fileName: string; /** * The file's MIME type. **/ mimeType?: string; /** * The file description. **/ description?: string; /** * The date and time when the embedded file was created. **/ creationDate?: PdfDateTime | null; /** * The date and time when the embedded file was last modified. **/ modificationDate?: PdfDateTime | null; }; /** * Provides options for the {@link PdfPage#draw} method. **/ export type DrawPdfPageOptions = { /** * The document view mode. **/ viewStateMode?: em.ViewStateMode; /** * The document zoom value (1 is actual size, no zoom). **/ viewStateZoom?: number; /** * Indicates whether to draw the annotations. **/ drawAnnotations?: boolean; /** * Indicates whether to draw the form fields. **/ drawFormFields?: boolean; }; /** * Provides settings for adding a new page to a PDF document. **/ export type PdfPageContextOptions = { /** * The resolution of the page context. The default is 72, i.e. the width and height are in points (72 DPI). **/ resolution?: number; /** * The width of the page, in graphic units, taking {@link resolution} into account. **/ width?: number; /** * The height of the page, in graphic units, taking {@link resolution} into account. **/ height?: number; /** * The number of degrees by which the page should be rotated clockwise when displayed or printed. * The value must be a multiple of 90. **/ rotation?: number; }; /** * Defines the document permission options. * If the document is opened using {@link EncryptOptions.userPassword}, * these permissions will be enforced, preventing the user from performing * actions restricted by the specified options. */ export type PermissionOptions = { /** * Gets or sets the password required to change permissions of a PDF document. */ ownerPassword: string; /** * Gets or sets a value controlling how a document can be printed. * The default value: PrintingPermissions.Disabled. */ printingPermissions?: em.PrintingPermissions; /** * Gets or sets a value controlling how a document can be edited. * The default value: EditingPermissions.Disabled. */ editingPermissions?: em.EditingPermissions; /** * Gets or sets a value indicating whether a document's content can be copied or extracted. * The default value: false. */ copyContent?: boolean; }; /** * Defines the options for the {@link Security#setEncryptOptions} method. */ export type EncryptOptions = { /** * Gets or sets the password required to open a PDF document. */ userPassword: string; /** * Gets or sets encryption level. * The default value: EncryptionLevel.AES256. */ encryptionLevel?: em.EncryptionLevel; /** * Gets or sets a value indicating whether the document-level metadata stream * is to be encrypted. * The default value: true. */ encryptMetadata?: boolean; /** * Gets or sets a {@link PermissionOptions} object defining the document permissions. */ permissions?: PermissionOptions; }; /** * Provides options for saving a PDF document. **/ export type SavePdfOptions = { /** * Specifies the PDF save mode. **/ saveMode?: em.SaveMode; /** * Specifies how existing PDF streams will be handled when the document is saved. **/ pdfStreamHandling?: em.PdfStreamHandling; /** * Indicates whether to use object streams when saving the PDF. **/ useObjectStreams?: em.UseObjectStreams; }; /** * Represents additional options to use when a document is being redacted. */ export type RedactOptions = { /** * The maximum distance (in points) between a PDF object's boundary * that is outside a redact area, and the redact area's edge, at which * the object is still considered to be inside the redact. * * The default value is 2 points. */ precision?: number; /** * Indicates whether to completely remove objects that * need to be partially redacted but which are unreadable or unknown to DsPdfJS. * * If true (the default), such objects will be silently removed. * Otherwise an exception will be thrown. */ ignoreUnreadableObjects?: boolean; /** * Indicates whether images within the redacted area that * also appear in other locations will be copied before applying the redact. * If this property is true, only the appearance of the redacted area will be affected. * If this property is false, if an image within the redacted area also appears in other locations, * all these locations will be affected. * The default is false. */ copyImagesOnRedact?: boolean; /** * The additional options used when a redact action requires that some PDF * content is rendered as an image. */ renderOptions?: { /** * The zoom factor. The default is 1. */ zoom?: number; /** * The background color. The default is "White". */ backColor?: Color; /** * Indicates whether to use the rendering cache. * * This property is true by default. Setting this property to false reduces * memory consumption, at the cost of slower rendering speed. */ useRenderingCache?: boolean; /** * Indicates whether glyphs are cached as bitmaps rather than as glyph paths. * The default is true. * This property is ignored if 'UseRenderingCache' is false. */ useGlyphBitmapCache?: boolean; /** * Indicating whether bitmaps embedded in an OpenType font should be rendered. * The default is true. * This property is ignored if either 'UseRenderingCache' or 'UseGlyphBitmapCache' is false. */ allowFontSbits?: boolean; /** * The sampling mode to use when drawing images with resizing. * Default is "NearestNeighbor". */ interpolationMode?: em.InterpolationMode; }; }; /** * Represents options used by the SaveAs* methods on {@link PdfPage}. **/ export type SaveAsImageOptions = { /** * The sampling mode to use when drawing images with resizing. The default is "Downscale". **/ interpolationMode?: em.InterpolationMode; /** * Scaling factor of the resulting image. The default is 1.0. **/ zoom?: number; /** * The background color. The default is "White". **/ backColor?: Color; /** * Indicates whether to draw annotations. The default is true. **/ drawAnnotations?: boolean; /** * Indicates whether to render form fields. The default is true. **/ drawFormFields?: boolean; /** * Indicates whether to use rendering cache. **/ useRenderingCache?: boolean; /** * Indicates whether glyphs are cached as bitmaps rather than as glyph paths. **/ useGlyphBitmapCache?: boolean; /** * Indicates whether bitmaps embedded in an OpenType font should be rendered. **/ allowFontSbits?: boolean; /** * Indicates whether SVG text elements should be rendered as graphic paths. **/ drawSvgTextAsPath?: boolean; /** * Indicates whether the positions are set for each individual character within the SVG text element. **/ preciseCharPositions?: boolean; /** * Indicates whether fonts used in the SVG text elements should be embedded. **/ embedSvgFonts?: boolean; }; /** * Provides settings for creating an elliptical arc between two points. **/ export type ArcSegmentProperties = { /** * A value that specifies whether the given arc is larger than 180 degrees. **/ arcSize?: em.ArcSize; /** * The end point of the arc. **/ point?: Point; /** * A value that specifies how many degrees in the clockwise direction the ellipse is rotated relative to the current coordinate system. **/ rotationAngle?: number; /** * The x-radius and y-radius of the arc. **/ size?: Size; /** * A value that specifies whether the arc sweep is clockwise or counterclockwise. **/ sweepDirection?: em.SweepDirection; }; /** * Provides options for drawing the image. **/ export type DrawImageOptions = { /** * The clipping rectangle on the target surface. **/ clipBounds?: Bounds | null; /** * The sampling mode to use when drawing images with resizing. * This property does not affect drawing to {@link PdfContext}. **/ interpolationMode?: em.InterpolationMode; /** * Indicates whether to keep the aspect ration of the image when resizing. The default if false. **/ keepAspectRatio?: boolean; /** * If true, the image is scaled down as much as possible but covers the entire destination rectangle. * If false, the image is scaled up as much as possible, but does not extend beyond the bounds of the destination rectangle. * The value of this property is ignored if keepAspectRatio is false. The default if false. **/ scaleToFill?: boolean; /** * The horizontal alignment of the image. The default is "Left". **/ alignX?: em.ImageAlignHorz; /** * The vertical alignment of the image. The default is "Top". **/ alignY?: em.ImageAlignVert; /** * The image opacity. The default is 1. **/ opacity?: number; }; /** * Provides options for drawing and filling a {@link GraphicsPath}. **/ export type DrawPathOptions = { /** * A reference to the brush to fill the interior of the path. * This property has a priority over the {@link DrawPathOptions.fillColor}. **/ fillBrush?: Brush | null; /** * The optional bounds for the fill brush. **/ brushBounds?: Bounds | null; /** * The transformation applied to the brush. **/ brushTransform?: Transform | null; /** * The color to fill the interior of the path. * This property is ignored if the {@link DrawPathOptions.fillBrush} is assigned. **/ fillColor?: Color; /** * A reference to the pen to draw the path outline. **/ strokePen?: Pen | null; /** * The color of the path outline. * Overrides the existing value if {@link DrawPathOptions.strokePen} is specified. **/ lineColor?: Color; /** * The width of the line pen to draw the path outline, in units used for drawing. * Overrides the existing value if {@link DrawPathOptions.strokePen} is specified. **/ lineWidth?: number; /** * The line cap style specifies the shape to be used at the ends of open subpaths (and dashes, if any) when they are stroked. * Overrides the existing value if {@link DrawPathOptions.strokePen} is specified. **/ lineCap?: em.PenLineCap; /** * The line join style specifies the shape to be used at the corners of line segments. * Overrides the existing value if {@link DrawPathOptions.strokePen} is specified. **/ lineJoin?: em.PenLineJoin; /** * The style of dashed pen to draw the path outline. * Overrides the existing value if {@link DrawPathOptions.strokePen} is specified. **/ lineStyle?: em.DashStyle; }; /** * Provides options for drawing and filling a polygon. **/ export type DrawPolygonOptions = { /** * The fill mode ("Alternate" by default). **/ fillMode?: em.FillMode; /** * A reference to the brush to fill the interior of the polygon. * This property has a priority over the {@link DrawPolygonOptions.fillColor}. **/ fillBrush?: Brush | null; /** * The optional bounds for the fill brush. **/ brushBounds?: Bounds | null; /** * The transformation applied to the brush. **/ brushTransform?: Transform | null; /** * The color to fill the interior of the polygon. * This property is ignored if the {@link DrawPolygonOptions.fillBrush} is assigned. **/ fillColor?: Color; /** * A reference to the pen to draw the polygon outline. **/ strokePen?: Pen | null; /** * The color of the polygon outline. * Overrides the existing value if {@link DrawPolygonOptions.strokePen} is specified. **/ lineColor?: Color; /** * The width of the line pen to draw the polygon outline, in units used for drawing. * Overrides the existing value if {@link DrawPolygonOptions.strokePen} is specified. **/ lineWidth?: number; /** * The line cap style specifies the shape to be used at the ends of open subpaths (and dashes, if any) when they are stroked. * Overrides the existing value if {@link DrawPolygonOptions.strokePen} is specified. **/ lineCap?: em.PenLineCap; /** * The line join style specifies the shape to be used at the corners of line segments. * Overrides the existing value if {@link DrawPolygonOptions.strokePen} is specified. **/ lineJoin?: em.PenLineJoin; /** * The style of dashed pen to draw the polygon outline. * Overrides the existing value if {@link DrawPolygonOptions.strokePen} is specified. **/ lineStyle?: em.DashStyle; }; /** * Provides options for drawing and filling a rectangle. **/ export type DrawRectangleOptions = { /** * The radius for the quarter ellipse that is drawn to replace every corner of the rectangle. **/ radius?: number; /** * The x-radius for the quarter ellipse that is drawn to replace every corner of the rectangle. **/ radiusX?: number; /** * The y-radius for the quarter ellipse that is drawn to replace every corner of the rectangle. **/ radiusY?: number; /** * A reference to the brush to fill the interior of the rectangle. * This property has a priority over the {@link DrawRectangleOptions.fillColor}. **/ fillBrush?: Brush | null; /** * The optional bounds for the fill brush. **/ brushBounds?: Bounds; /** * The transformation applied to the brush. **/ brushTransform?: Transform | null; /** * The color to fill the interior of the rectangle. * This property is ignored if the {@link DrawRectangleOptions.fillBrush} is assigned. **/ fillColor?: Color; /** * A reference to the pen to draw the rectangle outline. **/ strokePen?: Pen | null; /** * The color of the rectangle outline. * Overrides the existing value if {@link DrawRectangleOptions.strokePen} is specified. **/ lineColor?: Color; /** * The width of the line pen to draw the rectangle outline, in units used for drawing. * Overrides the existing value if {@link DrawRectangleOptions.strokePen} is specified. **/ lineWidth?: number; /** * The line cap style specifies the shape to be used at the ends of open subpaths (and dashes, if any) when they are stroked. * Overrides the existing value if {@link DrawRectangleOptions.strokePen} is specified. **/ lineCap?: em.PenLineCap; /** * The line join style specifies the shape to be used at the corners of line segments. * Overrides the existing value if {@link DrawRectangleOptions.strokePen} is specified. **/ lineJoin?: em.PenLineJoin; /** * The style of dashed pen to draw the rectangle outline. * Overrides the existing value if {@link DrawRectangleOptions.strokePen} is specified. **/ lineStyle?: em.DashStyle; }; /** * Provides options for drawing and filling an ellipse. **/ export type DrawEllipseOptions = { /** * A reference to the brush to fill the interior of the ellipse. * This property has a priority over the {@link DrawEllipseOptions.fillColor}. **/ fillBrush?: Brush | null; /** * The optional bounds for the fill brush. **/ brushBounds?: Bounds; /** * The transformation applied to the brush. **/ brushTransform?: Transform | null; /** * The color to fill the interior of the ellipse. * This property is ignored if the {@link DrawEllipseOptions.fillBrush} is assigned. **/ fillColor?: Color; /** * A reference to the pen to draw the ellipse outline. **/ strokePen?: Pen | null; /** * The color of the ellipse outline. * Overrides the existing value if {@link DrawEllipseOptions.strokePen} is specified. **/ lineColor?: Color; /** * The width of the line pen to draw the ellipse outline, in units used for drawing. * Overrides the existing value if {@link DrawEllipseOptions.strokePen} is specified. **/ lineWidth?: number; /** * The line cap style specifies the shape to be used at the ends of open subpaths (and dashes, if any) when they are stroked. * Overrides the existing value if {@link DrawEllipseOptions.strokePen} is specified. **/ lineCap?: em.PenLineCap; /** * The line join style specifies the shape to be used at the corners of line segments. * Overrides the existing value if {@link DrawEllipseOptions.strokePen} is specified. **/ lineJoin?: em.PenLineJoin; /** * The style of dashed pen to draw the ellipse outline. * Overrides the existing value if {@link DrawEllipseOptions.strokePen} is specified. **/ lineStyle?: em.DashStyle; };