import { PdfDocument } from "./pdfDocument"; export * from "./affix"; export * from "./image"; export * from "./ironpdfglobalconfig"; export * from "./page"; export * from "./paper"; export * from "./signature"; export * from "./stamp"; export * from "./render"; export * from "./security"; export * from "./naturalLanguages"; /** * Horizontal layout alignment relative to the PDF page. */ export enum HorizontalAlignment { Left = 0, Center = 1, Right = 2, } /** * Vertical layout alignment relative to the PDF page. */ export enum VerticalAlignment { Top = 0, Middle = 1, Bottom = 2, } /** * Defines which style-sheet should be rendered. 'Print' or 'Screen'. This matches the CSS3 Media * Queries standard. */ export enum CssMediaType { /** * Renders as expected for a web browser. */ Print = 0, /** * Ignores 'Print' styles and includes additional 'Screen' styles where available. */ Screen = 1, } /** * Behaviors when fitting HTML content to a physical paper size * Can affect zoom level and css layout */ export enum FitToPaperModes { /** * Do nothing. * Default Chrome PDF printing behavior. Uses {@link ChromePdfRenderOptions.zoom} to specify zoom level. * {@link ChromePdfRenderOptions.viewPortWidth} has no effect. * * Instead, Chrome will automatically set the view port based on {@link ChromePdfRenderOptions.paperSize}. * Use {@link ChromePdfRenderOptions.cssMediaType} to specify CSS media style. * * Useful when using {@link ChromePdfRenderOptions.cssMediaType.Print} CSS media style or printing documents to match the Chrome browser print preview. */ Default = 0, /** * Fit an exact number of pixels onto each PDF page. * Uses {@link ChromePdfRenderOptions.viewPortWidth} to specify the pixel width to fit on each PDF page. * {@link ChromePdfRenderOptions.zoom} has no effect. Instead, IronPdf will calculate the zoom level based on * {@link ChromePdfRenderOptions.viewPortWidth} and {@link ChromePdfRenderOptions.paperSize} * * Useful when an optimal pixel width is known or printing documents to match a Chrome browser window display */ FitToWidth = 1, /** * Measures minimum HTML content width after it is rendered by the browser and calculates {@link ChromePdfRenderOptions.zoom} * based on the width of the content. * {@link ChromePdfRenderOptions.zoom} and {@link ChromePdfRenderOptions.viewPortWidth} have no effect and are calculated automatically by IronPdf. * * Useful when fitting a wide content or content of unknown width onto a PDF page */ FitToHeight = 2, /** * Measures minimum HTML content width after it is rendered by the browser using the smallest view port possible, and calculates * {@link ChromePdfRenderOptions.zoom} based on the width of the content. * Use {@link ChromePdfRenderOptions.viewPortWidth} to specify the minimum number of pixels to be fit on each PDF page. * {@link ChromePdfRenderOptions.zoom} has no effect and is calculated automatically by IronPdf. * * Useful when fitting smaller content onto a wide page */ FitToPage = 3, /** * Creates a single page PDF which will force its entire content's width and height to fit into one page. * Can be used for a consumer bill or receipt. * * Useful when printing bill or receipt */ ContinuousFeed = 4, } /** * Specifies which HTML heading tags should be converted into * a Table of Contents when rendering HTML to PDF. */ export enum TableOfContentsTypes { None = 0, Basic = 1, WithPageNumbers = 2, } /** * A PageSelection is a collection of pages from a PDF document. * PageSelection can be used to perform operations on a subset of pages from a PDF document.< * See {@link PdfDocument} * * @Default undefined or "all" which mean all pages */ export type PdfPageSelection = number | number[] | "all" | undefined; /** * The unit of measurement used for positioning and sizing. */ export enum MeasurementUnit { Percentage, Millimeter, Inch, Centimeter, Pixel, Points, } /** * PDF saving options see {@link PdfDocument.saveAs} */ export interface SaveOptions { /** * Sets user password and enables 128Bit encryption of PDF content. * A user password is a password that each user must enter to open or print the PDF document. * * @default undefined */ userPassword?: string | undefined; /** * Sets owner password and enables 128Bit encryption of PDF content. An owner password is one * used to enable and disable all other security settings. * OwnerPassword must be set to a non-empty string value for {@link PdfDocument.setPermission}, * * @default undefined */ ownerPassword?: string | undefined; /** * Convert the current document into the specified PDF-A standard format * * @default false */ saveAsPdfA?: boolean | undefined; /** * Signs the PDF with digital signature with advanced options. * Note that the PDF will not be fully signed until Saved using {@link PdfDocument.saveAs} * * @default undefined */ // digitalSignatures?: DigitalSignature[]; // not working yet /** * Saves the PDF as byte array with changes appended to the end of the file. * * @default false */ incremental?: boolean | undefined; } /** * A length value with {@link MeasurementUnit} * Allows use and interchange of units such as inches, mm, pt, percentages, pixels and points when editing a PDF. */ export interface Length { value: number; /** * {@link MeasurementUnit} */ unit: MeasurementUnit; } /** * Stores the location and size of a rectangular region. (in Pixel) */ export interface CropRectangle { /** * Image horizontal position x */ x?: number | undefined; /** * Image vertical position y */ y?: number | undefined; /** * Image width */ width?: number | undefined; /** * Image width */ height?: number | undefined; // /** // * Measurement Unit of {@link x} {@link y} {@link width} and {@link height} // */ // measurementUnit?: MeasurementUnit; } /** * The margin configuration. see {@link ChromePdfRenderOptions.margin} */ export interface MarginConfig { /** * Default margin for all side, apply when the specific margin for each side was not specify */ default?: number | undefined; /** * Top margin */ top?: number | undefined; /** * Right margin */ right?: number | undefined; /** * Bottom margin */ bottom?: number | undefined; /** * Left margin */ left?: number | undefined; } /** * A union type that wrap all supported type that can converted to PdfDocument. * * Including: {@link PdfDocument} {@link Buffer} {@link HtmlString} {@link HtmlFilePath} {@link ZipFilePath} {@link PdfFilePath} {@link URL} {@link UrlString} */ export type PdfInput = | PdfDocument | Buffer | HtmlString | HtmlFilePath | ZipFilePath | PdfFilePath | URL | UrlString /** * A string that pointed to .pdf file path */ export type PdfFilePath = string; /** * A string that pointed to .zip file path */ export type ZipFilePath = string; /** * A string that hold raw HTML string */ export type HtmlString = string; /** * A string that pointed to .html or .htm file path */ export type HtmlFilePath = string; /** * A string that pointed to website URL */ export type UrlString = string; /** * A string that pointed to the image file path */ export type ImageFilePath = string; /** * An image binary object */ export type ImageBuffer = Buffer; /** * A flag that only apply the specific side of margin */ export enum UseMargins { None = 0, Top = 1, Bottom = 2, Left = 4, Right = 8, TopAndBottom = 3, LeftAndRight = 12, All = 15, } /** * A PDF password including user-password and owner-password */ export type PdfPassword = { userPassword ?: string | undefined; ownerPassword?: string | undefined }; /** * Union type representing different Chrome GPU modes. * - Disabled": Disable GPU hardware utilization * - Software": Enable software acceleration * - Hardware": Enable hardware acceleration * - HardwareFull": Enable hardware acceleration with Vulkan features */ export enum ChromeGpuModes { Disabled = "Disabled", Software = "Software", Hardware = "Hardware", HardwareFull = "HardwareFull" } export enum ChangeTrackingModes{ AutoChangeTracking = 0, EnableChangeTracking = 1, DisableChangeTracking = 2 }