import { ObjectManager } from "../ObjectManager"; import { DocAction } from "./DocAction"; import { DestinationBase } from "./Destination"; import { type DestinationProperties } from "./Destination"; import { SubmitFormatType } from "../Enums"; import { HtmlFormFormatFlags } from "../Enums"; import { FDFFormatFlags } from "../Enums"; import { PDFFormatFlags } from "../Enums"; import { FileSpecification, type FileSpecificationProperties } from "./FileSpecification"; import { type Field } from "./AcroForms/Field"; /** * Represents an action that changes the view to a destination (page, location, and magnification factor) * specified by a {@link DestinationProperties} object. * @see {@link ActionGoTo} */ export type ActionGoToProperties = { type: "goto"; /** * The destination object defining the new document view. */ dest: DestinationProperties; }; /** * Represents a go-to remote action similar to {@link ActionGoTo}, * but jumps to a destination in another PDF file instead of the current file. * @see {@link ActionGoToR} */ export type ActionGoToRProperties = { type: "gotor"; /** * The value defining the another file. * @see {@link FileSpecification} * @see {@link FileSpecificationProperties} */ file?: FileSpecificationProperties | FileSpecification | string; /** * The destination object defining the new document view. */ dest?: DestinationProperties; /** * Indicates whether to open the destination document in a new window. */ newWindow?: boolean; }; /** * Represents an action that causes navigation to a specified URI. * @see {@link ActionURI} */ export type ActionURIProperties = { type: "uri"; /** * The URI to navigate. */ uri: string; /** * Indicates whether to track the mouse position when the URI is resolved. * * This property applies only to actions triggered by the user's clicking an annotation; * it is ignored for actions associated with {@link OutlineNode} or with a {@link PdfDocument#openAction} * property. */ isMap?: boolean; }; /** * Represents an action that causes a script to be compiled and executed by the JavaScript interpreter. * @see {@link ActionJavaScript} */ export type ActionJavaScriptProperties = { type: "javascript"; /** * The JavaScript to execute. */ javaScript: string; }; /** * Represents an action that causes a script to be compiled and executed by the JavaScript interpreter. * @see {@link ActionSubmitForm} */ export type ActionSubmitFormProperties = { type: "submit"; /** * The value defining URL of the script at the Web server that will process the submission. * @see {@link FileSpecification} * @see {@link FileSpecificationProperties} */ uri: FileSpecificationProperties | string | FileSpecification; /** * Indicates whether the fields specified by the 'fields' list * should be excluded for processing. * By default this property is "false", which means that the fields * in the list are processed. If this property is set to "true", * the fields in the list are excluded from processing. */ excludeSpecifiedFields?: boolean; /** * Indicates whether the fields without a value should be included in request. */ includeFieldsWithNoValue?: boolean; /** * Indicates whether any submitted field values representing dates are converted to * the standard format described in PDF specification. */ canonicalDateFormat?: boolean; /** * The format which should be used in request. */ submitFormat?: SubmitFormatType; /** * The additional flags used if {@link submitFormat} is {@link SubmitFormatType#HtmlForm}. */ htmlFormFormat?: HtmlFormFormatFlags; /** * The additional flags used if {@link submitFormat} is {@link SubmitFormatType#FDF}. */ fdfFormat?: FDFFormatFlags; /** * The additional flags used if {@link submitFormat} is {@link SubmitFormatType#PDF}. */ pdfFormat?: PDFFormatFlags; }; /** * Represents an action that resets selected interactive form fields to their default values. * If no default value is defined for a field, its value is cleared. * For fields that can have no value, for example, {@link PushButtonField}, the action has no effect. * @see {@link ActionResetForm} */ export type ActionResetFormProperties = { type: "reset"; /** * Indicates whether the fields specified by the 'fields' list * should be excluded for processing. * By default this property is "false", which means that the fields * in the list are processed. If this property is set to "true", * the fields in the list are excluded from processing. */ excludeSpecifiedFields?: boolean; }; /** * Represents an action that performs some viewer application action such as go to next or previous page, etc. * @see {@link ActionNamed} */ export type ActionNamedProperties = { type: "named"; /** * The name of action. * The most useful names: * NextPage, PrevPage, FirstPage, LastPage */ name: string; }; /** * The common type for all action properties types. * @see {@link ActionGoToProperties} * @see {@link ActionGoToRProperties} * @see {@link ActionURIProperties} * @see {@link ActionJavaScriptProperties} * @see {@link ActionSubmitFormProperties} * @see {@link ActionResetFormProperties} * @see {@link ActionNamedProperties} */ export type ActionProperties = ActionGoToProperties | ActionGoToRProperties | ActionURIProperties | ActionJavaScriptProperties | ActionSubmitFormProperties | ActionResetFormProperties | ActionNamedProperties; /** * Base class for PDF actions which can be performed when user clicks links, document outlines etc. */ export declare abstract class ActionBase extends DocAction { } /** * Represents an action that changes the view to a destination (page, location, and magnification factor) * specified by a {@link DestinationBase} object. */ export declare class ActionGoTo extends ActionBase { /** * Initialize a new instance of the {@link ActionGoTo} class. * * @param om - {@link ObjectManager} that controls the lifetime of the {@link ActionGoTo}. * @param dest - The destination object defining the new document view. */ constructor(om: ObjectManager, dest?: DestinationBase | DestinationProperties); /** * Initialize a new instance of the {@link ActionGoTo} class. * * @param dest - The destination object defining the new document view. */ constructor(dest?: DestinationBase | DestinationProperties); /** * Gets or sets the destination object defining the new document view. */ get dest(): DestinationBase | null; /** * Gets or sets the destination object defining the new document view. */ set dest(value: DestinationBase | DestinationProperties | null); } /** * Represents a go-to remote action similar to {@link ActionGoTo}, * but jumps to a destination in another PDF file instead of the current file. */ export declare class ActionGoToR extends ActionBase { /** * Creates a new {@link ActionGoToR}. * * @param om - {@link ObjectManager} that controls the lifetime of the {@link ActionGoToR}. */ constructor(om: ObjectManager); /** * Creates a new {@link ActionGoToR}. */ constructor(); /** * Gets or sets the value defining the another file. * @see {@link FileSpecification} * @see {@link FileSpecificationProperties} */ get file(): FileSpecification | null; /** * Gets or sets the value defining the another file. * @see {@link FileSpecification} * @see {@link FileSpecificationProperties} */ set file(value: FileSpecification | FileSpecificationProperties | string | null); /** * Gets or sets the destination object defining the new document view. */ get dest(): DestinationBase | null; /** * Gets or sets the destination object defining the new document view. */ set dest(value: DestinationBase | DestinationProperties | null); /** * Gets a value indicating whether to open the destination document in a new window. */ get newWindow(): boolean; /** * Gets a value indicating whether to open the destination document in a new window. */ set newWindow(value: boolean); } /** * Represents an action that causes navigation to a specified URI. */ export declare class ActionURI extends ActionBase { /** * Creates a new {@link ActionURI}. * * @param om - {@link ObjectManager} that controls the lifetime of the {@link ActionURI}. * @param uri - The URI to navigate to. */ constructor(om: ObjectManager, uri?: string); /** * Creates a new {@link ActionURI}. * * @param uri - The URI to navigate to. */ constructor(uri?: string); /** * Gets or sets the URI to navigate. */ get uri(): string | null; /** * Gets or sets the URI to navigate. */ set uri(value: string | null); /** * Gets or sets a value indicating whether to track the mouse position when the URI is resolved. * * This property applies only to actions triggered by the user's clicking an annotation; * it is ignored for actions associated with {@link OutlineNode} or with a {@link PdfDocument#openAction} * property. */ get isMap(): boolean; /** * Gets or sets a value indicating whether to track the mouse position when the URI is resolved. * * This property applies only to actions triggered by the user's clicking an annotation; * it is ignored for actions associated with {@link OutlineNode} or with a {@link PdfDocument#openAction} * property. */ set isMap(value: boolean); } /** * Represents an action that causes a script to be compiled and executed by the JavaScript interpreter. */ export declare class ActionJavaScript extends ActionBase { /** * Creates a new {@link ActionJavaScript}. * * @param om - {@link ObjectManager} that controls the lifetime of the {@link ActionJavaScript}. * @param javaScript - The JavaScript to execute. */ constructor(om: ObjectManager, javaScript?: string); /** * Creates a new {@link ActionJavaScript}. * * @param javaScript - The JavaScript to execute. */ constructor(javaScript?: string); /** * Gets or sets the JavaScript to execute. */ get javaScript(): string; /** * Gets or sets the JavaScript to execute. */ set javaScript(value: string); } /** * Base class for {@link ActionSubmitForm} and {@link ActionResetForm} classes, * operating over a set of specified fields. */ export declare abstract class ActionFieldsBase extends ActionBase { /** * Gets the list of fields that should be processed or excluded from processing * (depending on the value of 'excludeSpecifiedFields') by this action. * An item in this list can be either a field's name specified as a "string", * or the {@link Field} object itself. * An empty list means that all fields are included. * @see {@link excludeSpecifiedFields} */ get fields(): (string | Field)[] | null; /** * Gets the list of fields that should be processed or excluded from processing * (depending on the value of 'excludeSpecifiedFields') by this action. * An item in this list can be either a field's name specified as a "string", * or the {@link Field} object itself. * An empty list means that all fields are included. * @see {@link excludeSpecifiedFields} */ set fields(value: (string | Field)[] | null); /** * Gets or sets a value indicating whether the fields specified by the 'fields' list * should be excluded for processing. * By default this property is "false", which means that the fields * in the list are processed. If this property is set to "true", * the fields in the list are excluded from processing. */ get excludeSpecifiedFields(): boolean; /** * Gets or sets a value indicating whether the fields specified by the 'fields' list * should be excluded for processing. * By default this property is "false", which means that the fields * in the list are processed. If this property is set to "true", * the fields in the list are excluded from processing. */ set excludeSpecifiedFields(value: boolean); } /** * Represents an action that causes a script to be compiled and executed by the JavaScript interpreter. */ export declare class ActionSubmitForm extends ActionFieldsBase { /** * Creates a new {@link ActionSubmitForm}. * * @param om - {@link ObjectManager} that controls the lifetime of the {@link ActionSubmitForm}. * @param uri - The URL of the script at the Web server that will process the submission. */ constructor(om: ObjectManager, uri?: string); /** * Creates a new {@link ActionSubmitForm}. * * @param uri - The URL of the script at the Web server that will process the submission. */ constructor(uri?: string); /** * Gets or sets the value defining URL of the script at the Web server that will process the submission. * @see {@link FileSpecification} * @see {@link FileSpecificationProperties} */ get uri(): FileSpecification | null; /** * Gets or sets the value defining URL of the script at the Web server that will process the submission. * @see {@link FileSpecification} * @see {@link FileSpecificationProperties} */ set uri(value: FileSpecification | FileSpecificationProperties | string | null); /** * Gets or sets a value indicating whether the fields without a value should be included in request. */ get includeFieldsWithNoValue(): boolean; /** * Gets or sets a value indicating whether the fields without a value should be included in request. */ set includeFieldsWithNoValue(value: boolean); /** * Gets or sets a value indicating whether any submitted field values representing dates are converted to * the standard format described in PDF specification. */ get canonicalDateFormat(): boolean; /** * Gets or sets a value indicating whether any submitted field values representing dates are converted to * the standard format described in PDF specification. */ set canonicalDateFormat(value: boolean); /** * Gets or sets the format which should be used in request. */ get submitFormat(): SubmitFormatType; /** * Gets or sets the format which should be used in request. */ set submitFormat(value: SubmitFormatType); /** * Gets or sets additional flags used if {@link submitFormat} is {@link SubmitFormatType#HtmlForm}. */ get htmlFormFormat(): HtmlFormFormatFlags; /** * Gets or sets additional flags used if {@link submitFormat} is {@link SubmitFormatType#HtmlForm}. */ set htmlFormFormat(value: HtmlFormFormatFlags); /** * Gets or sets additional flags used if {@link submitFormat} is {@link SubmitFormatType#FDF}. */ get fdfFormat(): FDFFormatFlags; /** * Gets or sets additional flags used if {@link submitFormat} is {@link SubmitFormatType#FDF}. */ set fdfFormat(value: FDFFormatFlags); /** * Gets or sets additional flags used if {@link submitFormat} is {@link SubmitFormatType#PDF}. */ get pdfFormat(): PDFFormatFlags; /** * Gets or sets additional flags used if {@link submitFormat} is {@link SubmitFormatType#PDF}. */ set pdfFormat(value: PDFFormatFlags); } /** * Represents an action that resets selected interactive form fields to their default values. * If no default value is defined for a field, its value is cleared. * For fields that can have no value {@link PushButtonField}, the action has no effect. */ export declare class ActionResetForm extends ActionFieldsBase { /** * Creates a new {@link ActionResetForm}. * * @param om - {@link ObjectManager} that controls the lifetime of the {@link ActionResetForm}. */ constructor(om: ObjectManager); /** * Creates a new {@link ActionResetForm}. */ constructor(); } /** * Represents an action that performs some viewer application action such as go to next or previous page, etc. */ export declare class ActionNamed extends ActionBase { /** * Creates a new {@link ActionNamed}. * * @param om - {@link ObjectManager} that controls the lifetime of the {@link ActionNamed}. * @param name - The action name. */ constructor(om: ObjectManager, name?: string); /** * Creates a new {@link ActionNamed}. * * @param name - The action name. */ constructor(name?: string); /** * Gets or sets the name of action. * The most usefull names: * NextPage, PrevPage, FirstPage, LastPage */ get name(): string | null; /** * Gets or sets the name of action. * The most usefull names: * NextPage, PrevPage, FirstPage, LastPage */ set name(value: string | null); } /** * Represents an unknown action. */ export declare class ActionUnknown extends ActionBase { }