import { CssMediaType, HorizontalAlignment, Length, VerticalAlignment, } from "./types"; /** * An options for {@link PdfDocument.stampHtml} */ export interface HtmlStampOptions extends BaseStampOptions { // /** // * The HTML base URL for which references to external CSS, Javascript and Image files will be relative. // * @default undefined // */ // baseUrl ?: string | undefined; //not supported /** * Css media type. Enables Media="screen" CSS Styles and StyleSheets * * Note: By setting {@link CssMediaType.Print}, IronPdf renders Stamp from HTML using CSS for media="print" as * if printing a web page in a browser print dialog. It renders exactly as per Google Chrome. * @default {@link CssMediaType.Screen}

*/ cssMediaType?: CssMediaType | undefined; } /** * An options for {@link PdfDocument.stampImage} */ export type ImageStampOptions = BaseStampOptions; /** * An options for {@link PdfDocument.stampBarcode} */ export interface BarcodeStampOptions extends BaseStampOptions { /** * The width in px of barcode * * @default 250 */ widthPx?: number | undefined; /** * The height in px of barcode * * @default 250 */ heightPx?: number | undefined; /** * Barcode encoding type to use for this Stamper. Supported encoding types include: QRCode, Code128, and Code39. Please see {@link BarcodeType}] * * @default {@link BarcodeType.qrCode} */ barcodeType?: BarcodeType | undefined; } /** * An options for {@link PdfDocument.stampText} */ export interface TextStampOptions extends BaseStampOptions { /** * @default false */ isBold?: boolean | undefined; /** * @default false */ isItalic?: boolean | undefined; /** * @default false */ isUnderline?: boolean | undefined; /** * @default false */ isStrikethrough?: boolean | undefined; /** * Font family name for the text. * * Note: If using a web font from https://fonts.google.com/ then you must set {@link TextStampOptions.useGoogleFont} property of this TextStampOptions to true. * @default Arial */ fontFamily?: string | undefined; /** * @default 12 */ fontSize?: number | undefined; /** * Must be set to true, when using {@link TextStampOptions.fontFamily} from https://fonts.google.com/ as a web font * @default false */ useGoogleFont?: boolean | undefined; /** * @default #000000 */ textColor?: string | undefined; /** * @default #00FFFFFF */ backgroundColor?: string | undefined; } export interface BaseStampOptions { /** * The horizontal alignment of the stamp relative to the page. * * @default {@link HorizontalAlignment.Center} */ horizontalAlignment?: HorizontalAlignment | undefined; /** * The vertical alignment of the stamp relative to the page. * * @default {@link VerticalAlignment.Middle} */ verticalAlignment?: VerticalAlignment | undefined; /** * The horizontal offset. * Value of 0 has no effect. Positive indicates an offset to the right direction. * Negative indicates an offset to the left direction. * * @default {@link MeasurementUnit.Percentage} value 0 (no offset) */ horizontalOffset?: Length | undefined; /** * The horizontal offset. * Value of 0 has no effect. Positive indicates an offset to the downward direction. * Negative indicates an offset to the upward direction. * * @default {@link MeasurementUnit.Percentage} value 0 (no offset) */ verticalOffset?: Length | undefined; /** * Gets opacity. Allows the stamp to be transparent. 0 is fully invisible, 100 if fully opaque. * * @default 100 */ opacity?: number | undefined; /** * Rotates the stamp clockwise from 0 to 360 degrees as specified. * * @default 0 */ rotation?: number | undefined; /** * Makes stamped elements of this Stamper have an on-click hyperlink. Note: HTML links * created by <a href=''> tags are not reserved by stamping. * * @default undefined */ hyperlink?: string | undefined; /** * Applies a percentage scale to the stamps to be larger or smaller. * * @default 100 (Percent) which has no effect. */ scale?: number | undefined; /** * Set to true for apply stamp behind the content. * If the content is opaque, the stamp may be invisible. * * @default false */ behindExistingContent?: boolean | undefined; /** * Render timeout in seconds * * @default 60 */ timeout?: number | undefined; /** * Milliseconds to wait after Html is rendered before printing. * This can use useful when considering the rendering of JavaScript, Ajax or animations. * * @default value for HtmlStamper is 100, The other Stamper is 0. */ renderDelay ?: number | undefined; /** * The maximum width of the output stamp. * * @default undefined */ maxWidth ?: Length | undefined; /** * The maximum height of the output stamp. * * @default undefined */ maxHeight ?: Length | undefined; /** * The minimum width of the output stamp. * * @default undefined */ minWidth ?: Length | undefined; /** * The minimum height of the output stamp. * * @default undefined */ minHeight ?: Length | undefined; } /** * Barcode Encoding Types. Please check the supported characters for each encoding type as some do not support all symbols. * Setting a {@link BarcodeType} when rendering Barcodes chooses the type and design of barcode to be generated. */ export enum BarcodeType { /** * Code 128 (1D barcode format). Code 128 is a high-density linear barcode symbology defined in ISO/IEC 15417:2007. * * Supported characters include: All alphabetic and numeric characters. */ code128 = 32, /** * Code 39 (1D barcode format). Code 39 is a variable length, discrete barcode symbology. The Code 39 specification defines 43 characters. * * Supported characters include: Digits from (0-9), Uppercase (A through Z), and these symbols: (-.$/+% space) */ code39 = 8, /** * QR Code (2D barcode format). QR code (abbreviated from Quick Response Code) is a machine-readable optical label that * contains information about the item to which it is attached. * A QR code uses four standardized encoding modes to efficiently store data. * * Supported characters include: All numeric, alphanumeric, byte/binary, and Japanese kanji. */ qrCode = 524288, }