export declare namespace PdfViewing { export namespace Internal { abstract class NativeBase { } abstract class NativeObject extends NativeBase { equals(obj: object): boolean; getHashCode(): number; } } export class PdfViewingError extends Error { constructor(message?: string); } /** * * Specifies functional features which can be supported by the ViewingSDK. * A given license key can permit or prohibit any of these features. */ export enum LicenseFeature { /** * * Viewer may create and edit annotations. */ Annotate = 1, /** * * Viewer may fill out form fields. */ FillFormFields = 2, /** * * Viewer may rotate individual pages. */ PageRotation = 4 } export interface ViewingViewerControllerEventMap { /** * * Event is raised when the PdfViewingSDK started or ended a busy period. * This can be used to indicate to the user that the ViewingSDK is currently processing and visual updates will be incoming soon. * * Whether the PdfViewingSDK is now newly busy or not. */ busyChanged: boolean; /** * * An internal Error has occured. Asynchronous internal functionality that is not directly controlled at the interface such as rendering will report any internal errors with this event. */ errorOccured: void; } export type ViewingViewerControllerEventListener = (e: ViewingViewerControllerEventMap[K]) => void; export type ViewingViewerControllerEventTypes = keyof ViewingViewerControllerEventMap; /** * */ export class ViewerController extends Internal.NativeObject { private eventListeners; /** * @event */ addEventListener(type: K, listener: (e: ViewingViewerControllerEventMap[K]) => void): void; removeEventListener(type: K, listener: (e: ViewingViewerControllerEventMap[K]) => void): void; /** * * * @throws {@link PdfViewing.LicenseError} The license is not valid. */ constructor(); /** * Close the object * * Release all native resources associated with the object. */ close(): void; /** * * Open a PDF and optionally one or more associated FDFs. * @param pdfFile * The PDF file to be opened. * @param fdfFiles * A list of FDF or XFDF files that are opened jointly with the {@link PdfViewing.ViewerController.open pdfFile}. * @param password * The password used for opening the {@link PdfViewing.ViewerController.open pdfFile}. * Set `null` if unencrypted. * @returns * The document that has been opened. * * @throws {@link PdfViewing.PasswordError} The file from {@link PdfViewing.ViewerController.open pdfFile} is encrypted and the password is not valid. * @throws {@link PdfViewing.IOError} Error reading from a stream. * @throws {@link PdfViewing.CorruptError} The file from {@link PdfViewing.ViewerController.open pdfFile} is corrupt or not a PDF. * @throws {@link PdfViewing.NotFoundError} The file from {@link PdfViewing.ViewerController.open pdfFile} is missing. * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed. */ open(pdfFile: PdfViewing.IO.InputDocument, fdfFiles?: PdfViewing.IO.InputDocumentList | null, password?: string | null): Promise; private openCallback; /** * * @param pdf * @param fdf * @param password * the password to open the PDF document * @returns * The document that has been opened. * * @throws {@link PdfViewing.PasswordError} The file is encrypted and the password is not valid. * @throws {@link PdfViewing.CorruptError} The file is corrupt or not a PDF. * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * * @deprecated Deprecated in Version 3.11. Use Open method instead. */ openMem(pdf: Uint8Array, fdf: Uint8Array | null, password: string | null): Promise; private openMemCallback; /** * * @param pdfUri * @param fdfUri * @param password * the password to open the PDF document * @param pdfAuthorization * @param fdfAuthorization * @returns * The document that has been opened. * * @throws {@link PdfViewing.PasswordError} The file is encrypted and the password is not valid. * @throws {@link PdfViewing.CorruptError} The file is corrupt or not a PDF. * @throws {@link PdfViewing.NotFoundError} The file from {@link PdfViewing.ViewerController.openUri pdfUri} or {@link PdfViewing.ViewerController.openUri fdfUri} is missing. * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * * @deprecated Deprecated in Version 3.11. Use Open method instead. */ openUri(pdfUri: string, fdfUri: string | null, password: string | null, pdfAuthorization: string | null, fdfAuthorization: string | null): Promise; private openUriCallback; /** * * Merge two input documents into one document. * @param first * The first PDF document. This document is the parent document. It's metadata and viewing properties will be used. * @param second * The second PDF document. It's pages will be appended to {@link PdfViewing.ViewerController.merge first} * @param firstDocumentPassword * The password for the first PDF document. * @param secondDocumentPassword * The password for the second PDF document. * @param mergeOptions * Document merge options. * @returns * Binary buffer containing the new document. * * @throws {@link PdfViewing.PasswordError} Either {@link PdfViewing.ViewerController.merge first} or {@link PdfViewing.ViewerController.merge second} is encrypted and the password is not valid. * @throws {@link PdfViewing.IOError} Error reading from a stream. * @throws {@link PdfViewing.CorruptError} Either {@link PdfViewing.ViewerController.merge first} or {@link PdfViewing.ViewerController.merge second} is corrupt or not a PDF. * @throws {@link PdfViewing.NotFoundError} Either {@link PdfViewing.ViewerController.merge first} or {@link PdfViewing.ViewerController.merge second} is missing. * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed. */ merge(first: PdfViewing.IO.InputDocument, second: PdfViewing.IO.InputDocument, firstDocumentPassword?: string | null, secondDocumentPassword?: string | null, mergeOptions?: PdfViewing.IO.MergeOptions | null): Promise; private mergeCallback; /** * True if viewer is currently still processing any the latest inputs and some updates to the viewport are incoming. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get isBusy(): boolean; /** * Set how formfields highlights are colored. * Use a fully transparent color to disable highlighting. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set formsHighlightColor(formsHighlightColor: PdfViewing.Pdf.Annotations.Color); /** * Set how required formfields highlights are colored. * Use a fully transparent color to disable highlighting. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set formsHighlightRequiredColor(formsHighlightRequiredColor: PdfViewing.Pdf.Annotations.Color); } /** * */ export class Sdk extends Internal.NativeObject { /** * * @param license * Pass the license key to activate the product. * An empty string may be passed to use a default license which will watermark all pages. * @param producerSuffix * * @throws {@link PdfViewing.UnknownFormatError} if the format (version) of the {@link PdfViewing.Sdk.initialize license} argument is unknown * @throws {@link PdfViewing.CorruptError} if the {@link PdfViewing.Sdk.initialize license} argument is not a correct license key * @throws {@link PdfViewing.LicenseError} if the {@link PdfViewing.Sdk.initialize license} argument can be read but the license check failed */ static initialize(license: string, producerSuffix: string | null): void; /** * */ static get version(): string; /** * */ static get producerFullName(): string; /** * Returns a bitfield describing which features are supported with the currently set license */ static get supportedFeatures(): PdfViewing.LicenseFeature; } /** * */ export class IntegerSet extends Internal.NativeObject implements Set { private nativeGet; [Symbol.iterator](): IterableIterator; clear(): void; delete(value: number): boolean; forEach(callbackfn: (value: number, value2: number, set: Set) => void, thisArg?: any): void; has(value: number): boolean; add(value: number): this; get size(): number; entries(): IterableIterator<[number, number]>; keys(): IterableIterator; values(): IterableIterator; [Symbol.toStringTag]: string; } /** * * A list of strings */ export class StringList extends Internal.NativeObject implements List { remove(element: string): boolean; add(element: string): boolean; addRange(inputList: StringList): boolean; set(index: number, element: string): void; clear(): void; get(index: number): string; getRange(index: number, count: number): StringList; get size(): number; [Symbol.iterator](): Iterator; } /** * * A map that maps strings to strings. */ export class StringMap extends Internal.NativeObject implements Map { private nativeGet; [Symbol.iterator](): IterableIterator<[string, string]>; clear(): void; delete(key: string): boolean; forEach(callbackfn: (value: string, key: string, map: Map) => void, thisArg?: any): void; get(key: string): string; has(key: string): boolean; set(key: string, value: string): this; get size(): number; entries(): IterableIterator<[string, string]>; keys(): IterableIterator; values(): IterableIterator; [Symbol.toStringTag]: string; } export namespace IO { /** * * Describes the type of the file. */ enum FileType { /** * * A PDF file contains all content. */ Pdf = 0, /** * * A FDF file may only contain annotations and form fields. */ Fdf = 1 } /** * * A PDF, FDF or XFDF File */ class InputDocument extends Internal.NativeObject { /** * Tag that identifies annotations coming from present document (PDF, FDF or XFDF). * The tag for an annotation can be retrieved by {@link PdfViewing.Pdf.Annotations.Annotation.sourceTag }. */ get sourceTag(): string | null; } /** * * A file that can be opened on a text-uri. */ class InputUri extends PdfViewing.IO.InputDocument { /** * * @param uri * The uri where the file can be loaded from. * @param httpOptions * Contains custom settings that one wants to apply to the HTTP request. * @param sourceTag * Tag that identifies annotations coming from present document (PDF, FDF or XFDF). * The tag for an annotation can be retrieved by {@link PdfViewing.Pdf.Annotations.Annotation.sourceTag }. * * @throws {@link PdfViewing.InvalidOperationError} if the file is an encrypted FDF or XFDF. */ constructor(uri: string, httpOptions?: PdfViewing.IO.HttpOptions | null, sourceTag?: string | null); /** * Get uri where this file is loaded from. */ get uri(): string; } /** * */ class InputFile extends PdfViewing.IO.InputDocument { /** * * @param data * The byte array containing the file in memory. * @param sourceTag * Tag that identifies annotations coming from present document (PDF, FDF or XFDF). * The tag for an annotation can be retrieved by {@link PdfViewing.Pdf.Annotations.Annotation.sourceTag }. * * @throws {@link PdfViewing.InvalidOperationError} if the file is an encrypted FDF or XFDF. */ constructor(data: Uint8Array, sourceTag?: string | null); /** * Get byte array containing the file in memory. */ get data(): Uint8Array; } /** * * A list of files */ class InputDocumentList extends Internal.NativeObject implements List { /** * */ constructor(); remove(element: PdfViewing.IO.InputDocument): boolean; add(element: PdfViewing.IO.InputDocument): boolean; addRange(inputList: InputDocumentList): boolean; set(index: number, element: PdfViewing.IO.InputDocument): void; clear(): void; get(index: number): PdfViewing.IO.InputDocument; getRange(index: number, count: number): InputDocumentList; get size(): number; [Symbol.iterator](): Iterator; } /** * * Contains options that are applied to a HTTP request. */ class HttpOptions extends Internal.NativeObject { /** * */ constructor(); /** * The mode for the request, possible values among others: * - "cors" * - "no-cors" * - "same-origin" */ get mode(): string | null; /** * The mode for the request, possible values among others: * - "cors" * - "no-cors" * - "same-origin" */ set mode(mode: string | null); /** * A string indicating how the request will interact with the browser's HTTP cache. * The possible values are: * - "default" * - "no-store" * - "reload" * - "no-cache" * - "force-cache" * - "only-if-cached" */ get cache(): string | null; /** * A string indicating how the request will interact with the browser's HTTP cache. * The possible values are: * - "default" * - "no-store" * - "reload" * - "no-cache" * - "force-cache" * - "only-if-cached" */ set cache(cache: string | null); /** * Controls what browsers do with credentials (i.e. cookies, HTTP authentication entries, and TLS client certificates). * Default value is "same-origin". * Must be one of the following strings: * - "omit": Tells browsers to exclude credentials from the request, and ignore any credentials sent back in the response (e.g., any Set-Cookie header). * - "same-origin": Tells browsers to include credentials with requests to same-origin URLs, and use any credentials sent back in responses from same-origin URLs. * - "include": Tells browsers to include credentials in both same- and cross-origin requests, and always use any credentials sent back in responses. */ get credentials(): string | null; /** * Controls what browsers do with credentials (i.e. cookies, HTTP authentication entries, and TLS client certificates). * Default value is "same-origin". * Must be one of the following strings: * - "omit": Tells browsers to exclude credentials from the request, and ignore any credentials sent back in the response (e.g., any Set-Cookie header). * - "same-origin": Tells browsers to include credentials with requests to same-origin URLs, and use any credentials sent back in responses from same-origin URLs. * - "include": Tells browsers to include credentials in both same- and cross-origin requests, and always use any credentials sent back in responses. */ set credentials(credentials: string | null); /** * Specify how to handle the response. * Default value is "follow". * Possible values are: * - "follow": Automatically follow redirects. * - "error": Abort with an error if a redirect occurs. * - "manual": Caller intends to process the response in another context. */ get redirect(): string | null; /** * Specify how to handle the response. * Default value is "follow". * Possible values are: * - "follow": Automatically follow redirects. * - "error": Abort with an error if a redirect occurs. * - "manual": Caller intends to process the response in another context. */ set redirect(redirect: string | null); /** * Specifies the referrer policy to use for the request. * Possible values are: * - "no-referrer" * - "no-referrer-when-downgrade" * - "same-origin" * - "origin" * - "strict-origin" * - "origin-when-cross-origin" * - "strict-origin-when-cross-origin" * - "unsafe-url" */ get referrerPolicy(): string | null; /** * Specifies the referrer policy to use for the request. * Possible values are: * - "no-referrer" * - "no-referrer-when-downgrade" * - "same-origin" * - "origin" * - "strict-origin" * - "origin-when-cross-origin" * - "strict-origin-when-cross-origin" * - "unsafe-url" */ set referrerPolicy(referrerPolicy: string | null); /** * Headers to be added to the request. */ get headers(): PdfViewing.StringMap; } /** * * Contains options for merging two PDF documents into one. */ class MergeOptions extends Internal.NativeObject { /** * */ constructor(); /** * Copy links (document internal and external links). */ get copyLinks(): boolean; /** * Copy links (document internal and external links). */ set copyLinks(copyLinks: boolean); /** * Copy interactive annotations such as sticky notes or highlight annotations. */ get copyAnnotations(): boolean; /** * Copy interactive annotations such as sticky notes or highlight annotations. */ set copyAnnotations(copyAnnotations: boolean); /** * Copy interactive form fields. */ get copyFormFields(): boolean; /** * Copy interactive form fields. */ set copyFormFields(copyFormFields: boolean); /** * Copy outlines (also called bookmarks). */ get copyOutlines(): boolean; /** * Copy outlines (also called bookmarks). */ set copyOutlines(copyOutlines: boolean); /** * Copy logical structure and tagging information. */ get copyLogicalStructure(): boolean; /** * Copy logical structure and tagging information. */ set copyLogicalStructure(copyLogicalStructure: boolean); /** * Copy named destinations. */ get copyNamedDestinations(): boolean; /** * Copy named destinations. */ set copyNamedDestinations(copyNamedDestinations: boolean); /** * Copy unsigned signature fields. */ get copyUnsignedSignatures(): boolean; /** * Copy unsigned signature fields. */ set copyUnsignedSignatures(copyUnsignedSignatures: boolean); } } export namespace Pdf { /** * * Declares which kind of changes were done in the document since opening or last save action. */ enum DocumentChange { /** * * Nothing has been changed. */ NoChange = 0, /** * * Some annotations have been created, edited or deleted and the containing files need to be saved. */ Annotation = 1, /** * * Some content has been edited and the PDF needs to be saved. */ Content = 2 } /** * * The claimed standard compliance of the PDF document. */ enum Compliance { /** * * Unkown claimed compliance */ Unknown = 0, /** * * PDF 1.0 */ Pdf10 = 1, /** * * PDF 1.1 */ Pdf11 = 2, /** * * PDF 1.2 */ Pdf12 = 3, /** * * PDF 1.3 */ Pdf13 = 4, /** * * PDF 1.4 */ Pdf14 = 5, /** * * PDF 1.5 */ Pdf15 = 6, /** * * PDF 1.6 */ Pdf16 = 7, /** * * PDF 1.7 */ Pdf17 = 8, /** * * PDF 2.0 */ Pdf20 = 9, /** * * PDF/A-1 */ PdfA1b = 10, /** * * PDF/A-1a */ PdfA1a = 11, /** * * PDF/A-2b */ PdfA2b = 12, /** * * PDF/A-2u */ PdfA2u = 13, /** * * PDF/A-2a */ PdfA2a = 14, /** * * PDF/A-3b */ PdfA3b = 15, /** * * PDF/A-3u */ PdfA3u = 16, /** * * PDF/A-3a */ PdfA3a = 17 } /** * * The intended target for rendering. */ enum OutputMedium { /** * * Show rendered output on a display. */ Display = 0, /** * * Print rendered output onto paper. */ Print = 1 } /** * * Options used for rendering pages. */ class RenderOptions extends Internal.NativeObject { /** * */ constructor(); /** * Color of form field highlights. * By default a light blue color is used. * Use a fully transparent color to disable highlighting. */ get formFieldHighlightColor(): PdfViewing.Pdf.Annotations.Color; /** * Color of form field highlights. * By default a light blue color is used. * Use a fully transparent color to disable highlighting. */ set formFieldHighlightColor(formFieldHighlightColor: PdfViewing.Pdf.Annotations.Color); /** * Color of form field highlights for required fields. * By default a red color is used. * Use a fully transparent color to disable highlighting of required fields. */ get formFieldRequiredHighlightColor(): PdfViewing.Pdf.Annotations.Color; /** * Color of form field highlights for required fields. * By default a red color is used. * Use a fully transparent color to disable highlighting of required fields. */ set formFieldRequiredHighlightColor(formFieldRequiredHighlightColor: PdfViewing.Pdf.Annotations.Color); /** * Filter that decides which annotations get rendered. * Set `null` to render all Annotations. * Default value is `null`. */ set annotationFilter(annotationFilter: PdfViewing.Pdf.Annotations.AnnotationFilter | null); /** * Set what ouput medium you want to use the rendered images for. * Default is "display". */ get outputMedium(): PdfViewing.Pdf.OutputMedium; /** * Set what ouput medium you want to use the rendered images for. * Default is "display". */ set outputMedium(outputMedium: PdfViewing.Pdf.OutputMedium); } /** * * Additional settings to configure the initial view */ class ViewOptions extends Internal.NativeObject { /** * */ constructor(); /** * Destination that the view should initially navigate to. */ get initialDestination(): PdfViewing.Pdf.Navigation.Destination | null; /** * Destination that the view should initially navigate to. */ set initialDestination(initialDestination: PdfViewing.Pdf.Navigation.Destination | null); /** * This will override any fitting operation in the given {@link PdfViewing.Pdf.ViewOptions.initialDestination }, * but preserve the navigation to the target of said destination. */ get initialFitMode(): PdfViewing.Pdf.Navigation.FitMode | null; /** * This will override any fitting operation in the given {@link PdfViewing.Pdf.ViewOptions.initialDestination }, * but preserve the navigation to the target of said destination. */ set initialFitMode(initialFitMode: PdfViewing.Pdf.Navigation.FitMode | null); /** * Set a initial page-layout mode. */ get initialPageLayoutMode(): PdfViewing.Pdf.Navigation.PageLayoutMode | null; /** * Set a initial page-layout mode. */ set initialPageLayoutMode(initialPageLayoutMode: PdfViewing.Pdf.Navigation.PageLayoutMode | null); /** * Set an initial viewport size in pixel. * Default: 720 (height) and 480 (width). */ get viewportSize(): PdfViewing.Pdf.Geometry.Integer.Size; /** * Set an initial viewport size in pixel. * Default: 720 (height) and 480 (width). */ set viewportSize(viewportSize: PdfViewing.Pdf.Geometry.Integer.Size); /** * Set an initial resolution in DPI (dots per inch) for this view. * Default: 96.0. */ get viewDPI(): number; /** * Set an initial resolution in DPI (dots per inch) for this view. * Default: 96.0. */ set viewDPI(viewDPI: number); } /** * * Options used for saving {@link PdfViewing.Pdf.Document }s. */ class SaveOptions extends Internal.NativeObject { /** * */ constructor(); /** * Choose whether the outputfile should be a PDF or an FDF document. * Default is {@link PdfViewing.IO.FileType.Pdf }. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get fileType(): PdfViewing.IO.FileType; /** * Choose whether the outputfile should be a PDF or an FDF document. * Default is {@link PdfViewing.IO.FileType.Pdf }. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set fileType(fileType: PdfViewing.IO.FileType); /** * A callback to be called for each annotation in the document when saving. * The result of the callback determines whether the annotation is included in the output. * Pass `null` to save all annotations. * Default is `null`. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set annotationFilter(annotationFilter: PdfViewing.Pdf.Annotations.AnnotationFilter | null); } /** * */ class Page extends Internal.NativeObject { /** * Close the object * * Release all native resources associated with the object. */ close(): void; /** * * Rotate this page by the specified number of degrees. * @param rotateBy * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * @throws {@link PdfViewing.LicenseError} The license is not valid for the editing feature. */ rotatePage(rotateBy: PdfViewing.Pdf.Geometry.Rotation): void; } /** * */ class PageList extends Internal.NativeObject implements List { /** * Close the object * * Release all native resources associated with the object. */ close(): void; remove(element: PdfViewing.Pdf.Page): boolean; add(element: PdfViewing.Pdf.Page): boolean; addRange(inputList: PageList): boolean; set(index: number, element: PdfViewing.Pdf.Page): void; clear(): void; get(index: number): PdfViewing.Pdf.Page; getRange(index: number, count: number): PageList; get size(): number; [Symbol.iterator](): Iterator; } /** * * Allows Interacting with an opened document */ class Document extends Internal.NativeObject { /** * Close the object * * Release all native resources associated with the object. */ close(): void; /** * * Return the opened PDF as binary data, * to be used, e.g., to save the file to disk. * @param asFdf * @returns * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * @throws {@link PdfViewing.LicenseError} The license is not valid for this feature. * * @deprecated Deprecated in Version 3.10. Use method Save instead. */ saveFile(asFdf: boolean): Promise; private saveFileCallback; /** * * Return the opened PDF or FDF as binary data, * to be used, e.g., to save the file to disk. * @param saveOptions * Options used for saving the document. * @returns * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * @throws {@link PdfViewing.NotSupportedError} if trying to save an annotation type to FDF which is currently not supported. * Unsupported are: {@link PdfViewing.Pdf.Annotations.FileAttachment } * and all derivatives of {@link PdfViewing.Pdf.Annotations.Link } and {@link PdfViewing.Pdf.Forms.Widget }. * @throws {@link PdfViewing.LicenseError} The license is not valid for the editing feature. */ save(saveOptions?: PdfViewing.Pdf.SaveOptions | null): Promise; private saveCallback; /** * * Start a new textsearch. * All results for the same textsearch can be iterated over using the returned {@link PdfViewing.Pdf.Content.TextSearchIterator }. * @param text * The text to look for. * @param startPage * The page on which to start the search. * @param isCaseSensitive * Set to `true` to ignore whether a letter is uppercase or lowercase. * @param isWrappingEnabled * Enable continuing search at the other end of the document if one end is reached. * @param isRegex * Interpret {@link PdfViewing.Pdf.Document.searchText text} as a regular expression according to ECMAScript Regular Expression grammar. * @returns * The returned {@link PdfViewing.Pdf.Content.TextSearchIterator } is starting the search at the top of the given page. * * @throws {@link PdfViewing.ArgumentError} if an empty string is given as a search term * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ searchText(text: string, startPage: number, isCaseSensitive: boolean, isWrappingEnabled: boolean, isRegex: boolean): PdfViewing.Pdf.Content.TextSearchIterator; /** * * Create a new {@link PdfViewing.Pdf.Annotations.Annotation } and add it to the page * specified in the given {@link PdfViewing.Pdf.Document.createAnnotation annotation}. * @param annotation * @returns newly created promise for further asynchronous processing. * * @throws {@link PdfViewing.UpdateFailedError} The PDF file could not be updated. * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * @throws {@link PdfViewing.LicenseError} The license is not valid for the editing feature. * @throws {@link PdfViewing.ArgumentError} if the {@link PdfViewing.Pdf.Document.createAnnotation annotation} argument is `null` * @throws {@link PdfViewing.ArgumentError} if the {@link PdfViewing.Pdf.Document.createAnnotation annotation} is not placed on a page * @throws {@link PdfViewing.ArgumentError} if the {@link PdfViewing.Pdf.Document.createAnnotation annotation} is added twice to the document */ createAnnotation(annotation: PdfViewing.Pdf.Annotations.Annotation): Promise; private createAnnotationCallback; /** * * Delete an existing {@link PdfViewing.Pdf.Annotations.Annotation } from the document. * @param annotation * @returns newly created promise for further asynchronous processing. * * @throws {@link PdfViewing.UpdateFailedError} The PDF file could not be updated * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * @throws {@link PdfViewing.LicenseError} The license is not valid for the editing feature. * @throws {@link PdfViewing.ArgumentError} if the {@link PdfViewing.Pdf.Document.deleteAnnotation annotation} argument is `null` * @throws {@link PdfViewing.ArgumentError} if the {@link PdfViewing.Pdf.Document.deleteAnnotation annotation} had already been deleted */ deleteAnnotation(annotation: PdfViewing.Pdf.Annotations.Annotation): Promise; private deleteAnnotationCallback; /** * * Edit an existing {@link PdfViewing.Pdf.Annotations.Annotation } that is attached to the document. * @param annotation * @returns newly created promise for further asynchronous processing. * * @throws {@link PdfViewing.UpdateFailedError} The PDF file could not be updated * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * @throws {@link PdfViewing.LicenseError} The license is not valid for the editing feature. * @throws {@link PdfViewing.ArgumentError} if the {@link PdfViewing.Pdf.Document.editAnnotation annotation} argument is `null` * @throws {@link PdfViewing.ArgumentError} if the {@link PdfViewing.Pdf.Document.editAnnotation annotation} was moved to illegal page * @throws {@link PdfViewing.ArgumentError} if the {@link PdfViewing.Pdf.Document.editAnnotation annotation} has been deleted from page */ editAnnotation(annotation: PdfViewing.Pdf.Annotations.Annotation): Promise; private editAnnotationCallback; /** * * Get a list of {@link PdfViewing.Pdf.Annotations.Annotation }s associated with the document * and placed on page {@link PdfViewing.Pdf.Document.getAnnotations pageNumber}. * This list is only updated after the asynchronous operations that modify annotations * ({@link PdfViewing.Pdf.Document.createAnnotation }, {@link PdfViewing.Pdf.Document.deleteAnnotation } and {@link PdfViewing.Pdf.Document.editAnnotation }) * have finished. * @param pageNumber * @returns * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ getAnnotations(pageNumber: number): Promise; private getAnnotationsCallback; /** * * Get a list of {@link PdfViewing.Pdf.Content.TextFragment }s that are placed on page {@link PdfViewing.Pdf.Document.getTextFragments pageNumber}. * @param pageNumber * @returns * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ getTextFragments(pageNumber: number): Promise; private getTextFragmentsCallback; /** * * Copy the page of another {@link PdfViewing.Pdf.Document } to this document. * This copy is not yet visible anywhere but can be used to create a {@link PdfViewing.Pdf.Annotations.CustomImageStamp } using {@link PdfViewing.Pdf.Annotations.CustomImageStamp.create } , which will add said page as an annotation. * @param otherDocument * The document where the page is copied from * @param pageNumber * The number of the page to be copied * @returns * An identifier which can be used to create annotations on this document using {@link PdfViewing.Pdf.Annotations.CustomImageStamp.create } * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ registerPdfPage(otherDocument: PdfViewing.Pdf.Document, pageNumber: number): Promise; private registerPdfPageCallback; /** * * Get a List of {@link PdfViewing.Pdf.Navigation.OutlineItem }s attached to the document. * @param parentOutline * Insert `null` to get top level outline item of document. * @returns * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ getOutlines(parentOutline: PdfViewing.Pdf.Navigation.OutlineItem | null): Promise; private getOutlinesCallback; /** * * Render page {@link PdfViewing.Pdf.Document.renderPage pageNumber} with a specific rotation into a rectangle of a specific size. * The returned image will always use the exact dimensions passed by parameters {@link PdfViewing.Pdf.Document.renderPage width} and {@link PdfViewing.Pdf.Document.renderPage height} even if the aspect ratio differs from the rendred page. * @param pageNumber * @param width * @param height * @param rotate * Rotate page in degrees. * @param renderOptions * Options used for rendering the page, set `null` to use default options * @returns * * @throws {@link PdfViewing.ArgumentError} if the provided page does not exist * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ renderPage(pageNumber: number, width: number, height: number, rotate: PdfViewing.Pdf.Geometry.Rotation, renderOptions?: PdfViewing.Pdf.RenderOptions | null): Promise; private renderPageCallback; /** * * Get Size of a pdf page. * If the page is not loaded yet the returned value is just a guess based on the already loaded pages * or `null` depending on the value of {@link PdfViewing.Pdf.Document.getPageSize guess}. * @param page * @param guess * Configure to get a best guess if the size has not been loaded yet * @returns */ getPageSize(page: number, guess: boolean): PdfViewing.Pdf.Geometry.Real.Size | null; /** * * Get the size in Pdf Coordinates of page {@link PdfViewing.Pdf.Document.getPagePdfSize pageNumber} * @param pageNumber * @returns * * @throws {@link PdfViewing.ArgumentError} if the provided page does not exist * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ getPagePdfSize(pageNumber: number): Promise; private getPagePdfSizeCallback; /** * * Get the aspect ratio (width divided by height) of a given {@link PdfViewing.Pdf.Document.getTextStampAspectRatio stampText}. * This value can be used as preparation step to compute the exact bounding box * for creating a {@link PdfViewing.Pdf.Annotations.CustomTextStamp }. * @param stampText * The text that will be used for creating a {@link PdfViewing.Pdf.Annotations.CustomTextStamp } * @returns * The ratio of height divided by width of the given text. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ getTextStampAspectRatio(stampText: string): Promise; private getTextStampAspectRatioCallback; /** * * Register an image in the document as a resource. This resource can then later be used to add e.g. an {@link PdfViewing.Pdf.Annotations.CustomImageStamp }. * @param image * @returns * ID of the registered image. * This ID is needed by {@link PdfViewing.Pdf.Annotations.CustomImageStamp.create } to link the image resource to the stamp annotation. * * @throws {@link PdfViewing.ArgumentError} if the provided {@link PdfViewing.Pdf.Document.registerImage image} is invalid or the format is not supported * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ registerImage(image: Uint8Array): Promise; private registerImageCallback; /** * * Register an image in the document as a resource. * This resource can then later be used, * e.g. to add an {@link PdfViewing.Pdf.Annotations.CustomImageStamp }. * @param imageUri * @param authorization * @returns * ID of the registered image. * This ID is needed by {@link PdfViewing.Pdf.Annotations.CustomImageStamp.create } to link the image resource to the stamp annotation. * * @throws {@link PdfViewing.ArgumentError} if the provided {@link PdfViewing.Pdf.Document.registerImageUri imageUri} is invalid or the format is not supported * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ registerImageUri(imageUri: string, authorization: string | null): Promise; private registerImageUriCallback; /** * * Create a new document by merging this document to the input document. * Pages, optional content, embedded files, and outlines are appended. * Viewing options and metadata from the current document are used. * @param other * Other document. * @param mergeOptions * Document merge options. * @returns * A binary buffer containing the new document. * * @throws {@link PdfViewing.ArgumentError} if the provided document {@link PdfViewing.Pdf.Document.mergeWith other} is invalid * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ mergeWith(other: PdfViewing.Pdf.Document, mergeOptions?: PdfViewing.IO.MergeOptions | null): Promise; private mergeWithCallback; /** * The destination that the creator of the PDF recommends to use when opening a view of the PDF. * This destination can be passed in a {@link PdfViewing.Pdf.ViewOptions } object to {@link PdfViewing.Pdf.View.create } for initializing the view, * thus respecting the creator's recommendation. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get initialDestination(): PdfViewing.Pdf.Navigation.Destination | null; /** * Tells whether any modifications have been made that would be lost without saving, such as editing annotations or rotating pages. * Value is 0 after opening and will reset to 0 when saving the document. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get hasChanges(): PdfViewing.Pdf.DocumentChange; /** * Return the number of pages in the document. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get pageCount(): number; /** * The pagelayoutmode that the creator of the PDF has suggested to use when opening a view of the PDF. * Can be passed in a {@link PdfViewing.Pdf.ViewOptions } object to method {@link PdfViewing.Pdf.View.create } for initializing the view. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get initialPageLayoutMode(): PdfViewing.Pdf.Navigation.PageLayoutMode | null; /** * * Return the claimed document compliance. * * Note: Claimed compliance does not guarantee conformance to the standard. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get compliance(): PdfViewing.Pdf.Compliance; /** * */ get pages(): PdfViewing.Pdf.PageList; } interface ViewingPdfViewEventMap { /** * * This event is triggered if there are any visual updates to the viewport, this can be due to newly rendered content or direct user interaction. * The event passes additional parameters to show what all has changed in this update. * This event can be used to get the newly available information from {@link PdfViewing.Pdf.View.getRenderedResults } and render the viewport. */ viewUpdated: ViewUpdatedArgs; /** * * This event is triggered whenever an image has been rendered that will be passed as a result of {@link PdfViewing.Pdf.View.getRenderedResults }. * The same image may be reused for multiple viewupdates, so this event allows to do any expensive preparation work only once. * If any memory was allocated in this step, it can be freed using event {@link PdfViewing.Pdf.ViewingPdfViewEventMap.imageRemovedFromCache }, which returns the identifier of the image being removed. * */ imageCreated: PdfViewing.Pdf.Content.Image; /** * * This event is triggered when an image is being removed from the internal cache * due to either being replaced or being too far away from the current viewport. * If any memory was allocated in the {@link PdfViewing.Pdf.ViewingPdfViewEventMap.imageCreated } event, then the associated memory should be released. * * The unique identifier of the image that is being deleted from the internal cache. */ imageRemovedFromCache: number; } interface ViewUpdatedArgs { /** * * Either {@link PdfViewing.Pdf.View.firstVisiblePage } or {@link PdfViewing.Pdf.View.lastVisiblePage } or both have changed. */ visisblePageRangeChanged: boolean; /** * * {@link PdfViewing.Pdf.View.pageNumber } has changed. */ pageNumberChanged: boolean; /** * * {@link PdfViewing.Pdf.View.zoom } has changed. */ zoomChanged: boolean; /** * * {@link PdfViewing.Pdf.View.fitMode } has changed. */ fitmodeChanged: boolean; /** * * {@link PdfViewing.Pdf.View.pageLayoutMode } has changed. */ pageLayoutModeChanged: boolean; /** * * {@link PdfViewing.Pdf.View.viewRotation } has changed. */ viewRotationChanged: boolean; /** * * {@link PdfViewing.Pdf.View.scrollMaxPosition } has changed. */ scrollMaxPositionChanged: boolean; /** * * A list of pages, that had their size updated. */ pageSizeUpdated: number[]; /** * * At least one image has changed. */ bitmapsUpdated: boolean; } type ViewingPdfViewEventListener = (e: ViewingPdfViewEventMap[K]) => void; type ViewingPdfViewEventTypes = keyof ViewingPdfViewEventMap; /** * * Describes the current view of the viewport on part of the document. * All properties and methods are consistent with what is actually visible, i.e. text fragments on a point can only be detected if said text is currently visible. */ class View extends Internal.NativeObject { private eventListeners; /** * @event */ addEventListener(type: K, listener: (e: ViewingPdfViewEventMap[K]) => void): void; removeEventListener(type: K, listener: (e: ViewingPdfViewEventMap[K]) => void): void; /** * * @param document * The document this view is displaying. * @param ignoreEmbeddedPreferences * When set ignore any opening preferences or actions that are embedded in the PDF. * * @deprecated Deprecated in Version 3.10. Use static method View.Create instead. */ constructor(document: PdfViewing.Pdf.Document, ignoreEmbeddedPreferences: boolean); /** * Close the object * * Release all native resources associated with the object. */ close(): void; /** * * @param document * The document this view is displaying. * @param renderOptions * Options used for rendering the page, set `null` to use default options. * @param viewOptions * Options used for the view, set `null` to use default options. * @returns */ static create(document: PdfViewing.Pdf.Document, renderOptions: PdfViewing.Pdf.RenderOptions | null, viewOptions: PdfViewing.Pdf.ViewOptions | null): PdfViewing.Pdf.View; /** * * Stops sending `ViewUpdated` events. * Internally user interactions and rendering is still performed normally. * Resume using {@link PdfViewing.Pdf.View.resumeDrawing }. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ suspendDrawing(): void; /** * * Resume sending `ViewUpdated` events. * Will always trigger a single `ViewUpdated` event, containing all updates since suspending. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ resumeDrawing(): void; /** * * Navigate the viewport to the given destination. * @param destination * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * @throws {@link PdfViewing.ArgumentError} if the provided {@link PdfViewing.Pdf.View.goToDestination destination} is invalid */ goToDestination(destination: PdfViewing.Pdf.Navigation.Destination): void; /** * * Navigate the viewport to show the given rectangle by scrolling and zooming as little as possible. * @param rectangle * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * @throws {@link PdfViewing.ArgumentError} if the provided {@link PdfViewing.Pdf.View.goToRectangle rectangle} is invalid */ goToRectangle(rectangle: PdfViewing.Pdf.Geometry.Real.RectangleOnPage): void; /** * * Returns a list of {@link PdfViewing.Pdf.Content.TextFragment } at point. * @param point * @returns * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * @throws {@link PdfViewing.NotFoundError} The given {@link PdfViewing.Pdf.View.getTextFragmentsOnPoint point} is on no page. * @throws {@link PdfViewing.FatalError} The page is not in cache. */ getTextFragmentsOnPoint(point: PdfViewing.Pdf.Geometry.Integer.Point): PdfViewing.Pdf.Content.TextFragmentList; /** * * Returns a list of all {@link PdfViewing.Pdf.Content.TextFragment }s on a given page. * @param pageNumber * @returns * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * @throws {@link PdfViewing.FatalError} The page is not in cache. */ getTextFragments(pageNumber: number): PdfViewing.Pdf.Content.TextFragmentList; /** * * Returns a textselection of all text within a rectangle. * Only text that is already loaded (and thus rendered) is selected. * Only the text on the rectangle's `PageNumber` field page is selected, even if extending the rectangle beyond the page boundaries. * The rectangle is defined by two corner points which may be on different pages. * @param startPoint * @param endPoint * @returns * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ getRectangularTextSelection(startPoint: PdfViewing.Pdf.Geometry.Real.PointOnPage, endPoint: PdfViewing.Pdf.Geometry.Real.PointOnPage): PdfViewing.Pdf.Content.TextSelection; /** * * Returns a textselection in between `startPoint` and `endPoint`. * Only text that is already loaded (and thus rendered) is selected. * @param startPoint * @param endPoint * @returns * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ getTextSelection(startPoint: PdfViewing.Pdf.Geometry.Real.PointOnPage, endPoint: PdfViewing.Pdf.Geometry.Real.PointOnPage): PdfViewing.Pdf.Content.TextSelection | null; /** * * Returns a {@link PdfViewing.Pdf.Content.TextSelection? } of the word at the given location. * If multiple word are at this location, the smallest one is returned. * @param point * @returns * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * @throws {@link PdfViewing.NotFoundError} if there are no words at {@link PdfViewing.Pdf.View.getWordOnPoint point} */ getWordOnPoint(point: PdfViewing.Pdf.Geometry.Real.PointOnPage): PdfViewing.Pdf.Content.TextSelection | null; /** * * Returns a list of {@link PdfViewing.Pdf.Annotations.Annotation }s at point. * Returns annotations in ascending z-order, thus the most visible annotation is the last element of the returned list. * @param point * @param onlySelectable * @returns * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ getAnnotationsOnPoint(point: PdfViewing.Pdf.Geometry.Integer.Point, onlySelectable: boolean): PdfViewing.Pdf.Annotations.AnnotationList; /** * * Get the rendering information to display the currently visible viewport. * @returns * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ getRenderedResults(): PdfViewing.Pdf.Content.RenderResults; /** * * Transform a point from viewport coordinates (top-left origin in pixels on viewport) to on-page coordinates (bottom-left origin in dots on a page). * If the given point is not on any page, then the closest page will be used as a reference for the returned point. * @param pointOnViewport * @param snapToPage * If the transformed point is not on any page, snap it to the border of the closest page. * @returns * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ transformPointFromViewportToPage(pointOnViewport: PdfViewing.Pdf.Geometry.Integer.Point, snapToPage: boolean): PdfViewing.Pdf.Geometry.Real.PointOnPage; /** * * Transform a point from viewport coordinates (top-left origin in pixels on viewport) to on-page coordinates (bottom-left origin in dots on a page). * If the given point is not on any page, then the closest page will be used as a reference for the returned point. * @param pointOnViewport * @param pageNumber * @param snapToPage * If the transformed point is not on any page, snap it to the border of the closest page. * @returns * Return the point in relation to the specified page. * * @throws {@link PdfViewing.ArgumentError} if the provided {@link PdfViewing.Pdf.View.transformPointFromViewportToSpecificPage pageNumber} does not exist * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ transformPointFromViewportToSpecificPage(pointOnViewport: PdfViewing.Pdf.Geometry.Integer.Point, pageNumber: number, snapToPage: boolean): PdfViewing.Pdf.Geometry.Real.PointOnPage; /** * * Transform a rectangle from viewport coordinates (top-left origin in pixels on viewport) to on-page coordinates (bottom-left origin in dots on a page) on a specific page. * @param rectangleOnViewport * @param pageNumber * @returns * * @throws {@link PdfViewing.ArgumentError} if the provided {@link PdfViewing.Pdf.View.transformRectangleFromViewportToSpecificPage pageNumber} does not exist * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ transformRectangleFromViewportToSpecificPage(rectangleOnViewport: PdfViewing.Pdf.Geometry.Integer.Rectangle, pageNumber: number): PdfViewing.Pdf.Geometry.Real.RectangleOnPage; /** * * Transform a point from on-page coordinates (bottom-left origin in dots on a page) to viewport coordinates (top-left origin in pixels on viewport). * @param pointOnPage * @returns * * @throws {@link PdfViewing.ArgumentError} if {@link PdfViewing.Pdf.View.transformPointFromPageToViewport pointOnPage} is not on any page * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ transformPointFromPageToViewport(pointOnPage: PdfViewing.Pdf.Geometry.Real.PointOnPage): PdfViewing.Pdf.Geometry.Integer.Point; /** * * Transform a rectangle from on-page coordinates (bottom-left origin in dots on a page) to viewport coordinates (top-left origin in pixels on viewport). * @param rectangleOnPage * @returns * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * @throws {@link PdfViewing.ArgumentError} if {@link PdfViewing.Pdf.View.transformRectangleFromPageToViewport rectangleOnPage} is not on any page */ transformRectangleFromPageToViewport(rectangleOnPage: PdfViewing.Pdf.Geometry.Real.RectangleOnPage): PdfViewing.Pdf.Geometry.Integer.Rectangle; /** * * Get the rectangle of a page in viewport coordinates (top-left origin in pixels on viewport). * If the document is newly opened this rectangle might be a guess, any updates to the loaded pagerectangles is reported in the `ViewUpdated` event with parameter `pageSizeUpdated`. * @param pageNumber * @returns * * @throws {@link PdfViewing.ArgumentError} if page with {@link PdfViewing.Pdf.View.getPageRectangleOnViewport pageNumber} is not on viewport * @throws {@link PdfViewing.ArgumentError} if the provided {@link PdfViewing.Pdf.View.getPageRectangleOnViewport pageNumber} does not exist * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ getPageRectangleOnViewport(pageNumber: number): PdfViewing.Pdf.Geometry.Integer.Rectangle; /** * * Transform a length from on-page coordinates (dots) to viewport coordinates (pixels). * @param pdfLength * @returns * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ transformPdfLengthToViewportLength(pdfLength: number): number; /** * * Transform a length from viewport coordinates (pixels) to on-page coordinates (dots). * @param screenLength * @returns * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ transformViewportLengthToPdfLength(screenLength: number): number; /** * * Set a new zoomfactor, keeping point {@link PdfViewing.Pdf.View.zoomOnLocation location} at a constant location on viewport. * @param zoom * @param location * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ zoomOnLocation(zoom: number, location: PdfViewing.Pdf.Geometry.Integer.Point): void; /** * * The currently most visible page. * * When getting, returns the page which covers most area on the view port. * If multiple pages cover the same amount of space, * the one with smaller page number is returned. * * When setting this property, * the view port moves to make this page the most visible page, * trying to align it to the top of the view port. * * Note: There are some cases in which a page cannot be made most visible. * Therefore setting this property to a certain value does not guarantee that the same value is returned when getting. * (Most notable cases are PageLayoutModes * {@link PdfViewing.Pdf.Navigation.PageLayoutMode.TwoColumnLeft }, * {@link PdfViewing.Pdf.Navigation.PageLayoutMode.TwoColumnRight }, * {@link PdfViewing.Pdf.Navigation.PageLayoutMode.TwoPageLeft }, * {@link PdfViewing.Pdf.Navigation.PageLayoutMode.TwoPageRight }, * and whenever viewing the end of a document with low {@link PdfViewing.Pdf.View.zoom }). * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get pageNumber(): number; /** * * The currently most visible page. * * When getting, returns the page which covers most area on the view port. * If multiple pages cover the same amount of space, * the one with smaller page number is returned. * * When setting this property, * the view port moves to make this page the most visible page, * trying to align it to the top of the view port. * * Note: There are some cases in which a page cannot be made most visible. * Therefore setting this property to a certain value does not guarantee that the same value is returned when getting. * (Most notable cases are PageLayoutModes * {@link PdfViewing.Pdf.Navigation.PageLayoutMode.TwoColumnLeft }, * {@link PdfViewing.Pdf.Navigation.PageLayoutMode.TwoColumnRight }, * {@link PdfViewing.Pdf.Navigation.PageLayoutMode.TwoPageLeft }, * {@link PdfViewing.Pdf.Navigation.PageLayoutMode.TwoPageRight }, * and whenever viewing the end of a document with low {@link PdfViewing.Pdf.View.zoom }). * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * @throws {@link PdfViewing.ArgumentError} if the provided page number does not exist */ set pageNumber(pageNumber: number); /** * The first currently visible page. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get firstVisiblePage(): number; /** * The last currently visible page. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get lastVisiblePage(): number; /** * The current zoom factor. * Default is 1.0. * Excessive zoom factors (below 0.1 or above 10.0) are not recommended. * Using {@link PdfViewing.Pdf.View.zoomOnLocation } can be used to get finer control on what the viewport is focused on during zooming. * If setting zoom directly, top-left of the viewport is used as a focus point. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get zoom(): number; /** * The current zoom factor. * Default is 1.0. * Excessive zoom factors (below 0.1 or above 10.0) are not recommended. * Using {@link PdfViewing.Pdf.View.zoomOnLocation } can be used to get finer control on what the viewport is focused on during zooming. * If setting zoom directly, top-left of the viewport is used as a focus point. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set zoom(zoom: number); /** * The current x/y coordinates at which the viewport is located. * Determines scrollbar location in relation to scrollbar length, * which is given by {@link PdfViewing.Pdf.View.scrollMaxPosition }. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get scrollPosition(): PdfViewing.Pdf.Geometry.Integer.ScrollPosition; /** * The current x/y coordinates at which the viewport is located. * Determines scrollbar location in relation to scrollbar length, * which is given by {@link PdfViewing.Pdf.View.scrollMaxPosition }. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set scrollPosition(scrollPosition: PdfViewing.Pdf.Geometry.Integer.ScrollPosition); /** * The maximum x/y coordinates that can be scrolled to. * Determines scrollbar ranges. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get scrollMaxPosition(): PdfViewing.Pdf.Geometry.Integer.ScrollPosition; /** * Rotate all pages to a specific orientation. * Default is {@link PdfViewing.Pdf.Geometry.Rotation.NoRotation } * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get viewRotation(): PdfViewing.Pdf.Geometry.Rotation; /** * Rotate all pages to a specific orientation. * Default is {@link PdfViewing.Pdf.Geometry.Rotation.NoRotation } * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set viewRotation(viewRotation: PdfViewing.Pdf.Geometry.Rotation); /** * The {@link PdfViewing.Pdf.Navigation.FitMode } used to fit the viewport onto the document. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get fitMode(): PdfViewing.Pdf.Navigation.FitMode; /** * The {@link PdfViewing.Pdf.Navigation.FitMode } used to fit the viewport onto the document. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set fitMode(fitMode: PdfViewing.Pdf.Navigation.FitMode); /** * The {@link PdfViewing.Pdf.Navigation.PageLayoutMode } used to arrange pages on the viewport. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get pageLayoutMode(): PdfViewing.Pdf.Navigation.PageLayoutMode; /** * The {@link PdfViewing.Pdf.Navigation.PageLayoutMode } used to arrange pages on the viewport. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set pageLayoutMode(pageLayoutMode: PdfViewing.Pdf.Navigation.PageLayoutMode); /** * The size of the border in pixels in between pages when rendered on viewport. Default: 10px. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get borderSize(): number; /** * The size of the border in pixels in between pages when rendered on viewport. Default: 10px. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * @throws {@link PdfViewing.ArgumentError} If the given value was smaller than 0 */ set borderSize(borderSize: number); /** * The size of the margin in pixels around the canvas. Default: 5px in all directions. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get canvasMargin(): PdfViewing.Pdf.Geometry.Integer.Padding; /** * The size of the margin in pixels around the canvas. Default: 5px in all directions. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * @throws {@link PdfViewing.ArgumentError} If the given value was smaller than 0 */ set canvasMargin(canvasMargin: PdfViewing.Pdf.Geometry.Integer.Padding); /** * The Dots Per Inch of the used screen. Default `96.0`. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get screenDPI(): number; /** * The Dots Per Inch of the used screen. Default `96.0`. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set screenDPI(screenDPI: number); /** * The {@link PdfViewing.Pdf.Content.Byteorder } used for rendered images. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get byteorder(): PdfViewing.Pdf.Content.Byteorder; /** * The {@link PdfViewing.Pdf.Content.Byteorder } used for rendered images. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set byteorder(byteorder: PdfViewing.Pdf.Content.Byteorder); /** * The size of the viewport for this view. * Default: 720 x 480 pixels. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get viewportSize(): PdfViewing.Pdf.Geometry.Integer.Size; /** * The size of the viewport for this view. * Default: 720 x 480 pixels. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set viewportSize(viewportSize: PdfViewing.Pdf.Geometry.Integer.Size); } namespace Annotations { /** * */ class Color extends Internal.NativeBase { /** * * The intensity of red in the described color as a value 0-255. */ red: number; /** * * The intensity of green in the described color as a value 0-255. */ green: number; /** * * The intensity of blue in the described color as a value 0-255. */ blue: number; /** * * The opaqueness in the described color as a value 0-255. */ alpha: number; constructor(red: number, green: number, blue: number, alpha: number); equals(obj: Color | null): boolean; } /** * * Specifies the text displayed for predefined {@link PdfViewing.Pdf.Annotations.TextStamp }s. */ enum TextStampType { /** * */ Approved = 0, /** * */ Experimental = 1, /** * */ NotApproved = 2, /** * */ AsIs = 3, /** * */ Expired = 4, /** * */ NotForPublicRelease = 5, /** * */ Confidential = 6, /** * */ Final = 7, /** * */ Sold = 8, /** * */ Departmental = 9, /** * */ ForComment = 10, /** * */ TopSecret = 11, /** * */ Draft = 12, /** * */ ForPublicRelease = 13 } /** * * Stamp color used for the appearance generation of {@link PdfViewing.Pdf.Annotations.CustomTextStamp }. */ enum StampColor { /** * */ Green = 0, /** * */ Red = 1, /** * */ Blue = 2 } /** * * Specifies the type of icon displayed on a page for a {@link PdfViewing.Pdf.Annotations.FileAttachment }. */ enum FileAttachmentIcon { /** * */ Graph = 0, /** * */ PushPin = 1, /** * */ Paperclip = 2, /** * */ Tag = 3, /** * */ CustomIcon = 127 } /** * * Specifies the type of styling used for the border of the annotation. */ enum BorderStyleType { /** * */ Lined = 0, /** * */ Beveled = 1, /** * */ Inset = 2, /** * */ Underline = 3 } /** * * Specifies the type of line termination for line and poly-line annotations. */ enum LineEnding { /** * */ None = 0, /** * */ OpenArrow = 1, /** * */ ClosedArrow = 2, /** * */ rectangle = 3, /** * */ Circle = 4, /** * */ Diamond = 5, /** * */ Butt = 6, /** * */ ReversedOpenArrow = 7, /** * */ ReversedClosedArrow = 8, /** * */ Slash = 9 } /** * Annotation filter * * Decides whether an annotation is filtered out or not. * This callback is used for saving a subset of annotations to PDF, FDF or XFDF or to selectively render annotations. * @param annotation * Annotation for which it must be decided whether it will be filtered out. * @returns * Returns `false` in case the annotation is filtered out else `true`. */ type AnnotationFilter = (annotation: PdfViewing.Pdf.Annotations.Annotation) => boolean; /** * A page annotation * */ class Annotation extends Internal.NativeObject { /** * Close the object * * Release all native resources associated with the object. */ close(): void; /** * The location on the page (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get boundingBox(): PdfViewing.Pdf.Geometry.Real.RectangleOnPage; /** * The location on the page (Setter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set boundingBox(boundingBox: PdfViewing.Pdf.Geometry.Real.RectangleOnPage); /** * The annotation's visibility (Getter) * * If `true` then the annotation is present, but is invisible and not available for user interaction. * Depending on the {@link PdfViewing.Pdf.Annotations.Annotation.noPrint } property it will, however, still be visible when printing. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get hidden(): boolean; /** * The annotation's visibility (Setter) * * If `true` then the annotation is present, but is invisible and not available for user interaction. * Depending on the {@link PdfViewing.Pdf.Annotations.Annotation.noPrint } property it will, however, still be visible when printing. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set hidden(hidden: boolean); /** * The annotation's visibility when printing (Getter) * * If `true` then the annotation is not present in a print output of the document. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get noPrint(): boolean; /** * The annotation's visibility when printing (Setter) * * If `true` then the annotation is not present in a print output of the document. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set noPrint(noPrint: boolean); /** * The annotation's scaling behavior (Getter) * * If `true` then the annotation's visual appearance does not scale with the zoom factor of a PDF viewer. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get noZoom(): boolean; /** * The annotation's rotation behavior (Getter) * * If `true` then the annotation's visual appearance does not rotate with the rotation set in a PDF viewer. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get noRotate(): boolean; /** * The annotation's rotation behavior (Setter) * * If `true` then the annotation's visual appearance does not rotate with the rotation set in a PDF viewer. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set noRotate(noRotate: boolean); /** * The name by which the annotation is referred to. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get name(): string; /** * Private, do not use. */ get privateData(): string; /** * Private, do not use. */ set privateData(privateData: string); /** * Tag that identifies the source the annotation is coming from. * If the source is an input PDF or an input FDF, the tag comes from {@link PdfViewing.IO.InputDocument.sourceTag }. * Newly created annotations always return `null`. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get sourceTag(): string | null; } /** * Information for a markup annotation * * Holds information contained in a markup annotation or in a reply to a markup annotation. */ class MarkupInfo extends Internal.NativeObject { /** * Close the object * * Release all native resources associated with the object. */ close(): void; /** * The date of creation (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get creationDate(): Date | null; /** * The date of last modification (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get modificationDate(): Date | null; /** * Whether the content can be modified (Getter) * * This does not restrict the modification of other aspects of the annotation or its deletion. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get locked(): boolean; /** * Whether the content can be modified (Setter) * * This does not restrict the modification of other aspects of the annotation or its deletion. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set locked(locked: boolean); /** * The author (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get author(): string; /** * The author (Setter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set author(author: string); /** * The subject (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get subject(): string; /** * The subject (Setter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set subject(subject: string); /** * The information content (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get content(): string; /** * The information content (Setter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set content(content: string); } /** * */ class MarkupInfoList extends Internal.NativeObject implements List { /** * Close the object * * Release all native resources associated with the object. */ close(): void; remove(element: PdfViewing.Pdf.Annotations.MarkupInfo): boolean; add(element: PdfViewing.Pdf.Annotations.MarkupInfo): boolean; addRange(inputList: MarkupInfoList): boolean; set(index: number, element: PdfViewing.Pdf.Annotations.MarkupInfo): void; clear(): void; get(index: number): PdfViewing.Pdf.Annotations.MarkupInfo; getRange(index: number, count: number): MarkupInfoList; get size(): number; [Symbol.iterator](): Iterator; } /** * A pop-up for a markup annotation * */ class Popup extends Internal.NativeObject { /** * Close the object * * Release all native resources associated with the object. */ close(): void; /** * The pop-up's visibility state (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get isOpen(): boolean; /** * The pop-up's visibility state (Setter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set isOpen(isOpen: boolean); /** * The pop-up location (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get boundingBox(): PdfViewing.Pdf.Geometry.Real.RectangleOnPage; /** * The pop-up location (Setter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set boundingBox(boundingBox: PdfViewing.Pdf.Geometry.Real.RectangleOnPage); } /** * A markup annotation * */ class MarkupAnnotation extends PdfViewing.Pdf.Annotations.Annotation { /** * Whether the markup annotation can be modified (Getter) * * This does not restrict modification of the markup annotation's content. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get locked(): boolean; /** * The information content of this markup (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get info(): PdfViewing.Pdf.Annotations.MarkupInfo; /** * The replies to this markup (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get replies(): PdfViewing.Pdf.Annotations.MarkupInfoList; } /** * A sticky note annotation * */ class StickyNote extends PdfViewing.Pdf.Annotations.MarkupAnnotation { /** * Create a sticky note annotation. * * The returned sticky note annotation is not yet part of any page. * It can be added to a page's list of annotations. * @param topLeft * The location of the annotation's upper left corner on the page. * @param content * The text content * @param color * The paint for the sticky note icon and popup. * If `null` then a default paint is used. * @returns * The newly created sticky note annotation */ static create(topLeft: PdfViewing.Pdf.Geometry.Real.PointOnPage, content: string, color: PdfViewing.Pdf.Annotations.Color): PdfViewing.Pdf.Annotations.StickyNote; /** * The paint for the sticky note icon and the popup (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get color(): PdfViewing.Pdf.Annotations.Color; /** * The paint for the sticky note icon and the popup (Setter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set color(color: PdfViewing.Pdf.Annotations.Color); /** * The pop-up (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get popup(): PdfViewing.Pdf.Annotations.Popup | null; } /** * A file attachment annotation * */ class FileAttachment extends PdfViewing.Pdf.Annotations.MarkupAnnotation { /** * The displayed icon (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get icon(): PdfViewing.Pdf.Annotations.FileAttachmentIcon; /** * The paint for the icon and the popup (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get color(): PdfViewing.Pdf.Annotations.Color; /** * The paint for the icon and the popup (Setter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set color(color: PdfViewing.Pdf.Annotations.Color); /** * The pop-up (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get popup(): PdfViewing.Pdf.Annotations.Popup | null; } /** * A stamp annotation * */ class Stamp extends PdfViewing.Pdf.Annotations.MarkupAnnotation { /** * The pop-up (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get popup(): PdfViewing.Pdf.Annotations.Popup | null; /** * The paint for the popup (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get color(): PdfViewing.Pdf.Annotations.Color; /** * The paint for the popup (Setter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set color(color: PdfViewing.Pdf.Annotations.Color); /** * Rotation in relation to the page. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get rotation(): PdfViewing.Pdf.Geometry.Rotation; /** * Rotation in relation to the page. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set rotation(rotation: PdfViewing.Pdf.Geometry.Rotation); } /** * A text stamp annotation * */ class TextStamp extends PdfViewing.Pdf.Annotations.Stamp { /** * Create a text stamp annotation. * * The width of the annotation is computed from the given stamp text. * The returned text stamp annotation is not yet part of any page. * It can be added to a page's list of annotations. * @param topLeft * The location of the annotation's upper left corner on the page. * @param height * The height of the annotation. * @param textType * The text stamp type. * @param text * The text to be shown in this stamp. * @param rotation * The rotation of the annotation in relation to the unrotated view. * The annotation is created with a compensating (and hence opposite) {@link PdfViewing.Pdf.Annotations.Stamp.rotation }, * such that it is upright and readable when viewing the document with said view rotation. * @returns * The newly created text stamp annotation. */ static createRaw(topLeft: PdfViewing.Pdf.Geometry.Real.PointOnPage, height: number | null, textType: PdfViewing.Pdf.Annotations.TextStampType, text: string, rotation: PdfViewing.Pdf.Geometry.Rotation): PdfViewing.Pdf.Annotations.TextStamp; /** * The displayed text (Getter) * * This defines a predefined text for this text stamp. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * @throws {@link PdfViewing.UnsupportedFeatureError} The text stamp's type is not supported. */ get textType(): PdfViewing.Pdf.Annotations.TextStampType; } /** * A stamp annotation with user defined stamp text * */ class CustomTextStamp extends PdfViewing.Pdf.Annotations.Stamp { /** * Create a custom stamp annotation. * * The returned custom Textstamp annotation is not yet part of any page. * It can be added to a page's list of annotations. * The custom stamp annotation's appearance is generated after it was added to a page. * @param boundingBox * The location of the annotation on the page. * Use {@link PdfViewing.Pdf.Document.getTextStampAspectRatio } to obtain the correct aspect ratio of width divided by height of the {@link PdfViewing.Pdf.Annotations.CustomTextStamp.create boundingBox} * @param stampText * The custom stamp text * @param stampColor * The color of the stamp appearance * @param rotation * The rotation of the annotation in relation to the unrotated view. * The annotation is created with a compensating (and hence opposite) {@link PdfViewing.Pdf.Annotations.Stamp.rotation }, * such that it is upright and readable when viewing the document with said view rotation. * @returns * The newly created custom text stamp annotation. */ static create(boundingBox: PdfViewing.Pdf.Geometry.Real.RectangleOnPage, stampText: string, stampColor: PdfViewing.Pdf.Annotations.StampColor, rotation: PdfViewing.Pdf.Geometry.Rotation): PdfViewing.Pdf.Annotations.CustomTextStamp; } /** * A stamp annotatation based on an image * */ class CustomImageStamp extends PdfViewing.Pdf.Annotations.Stamp { /** * Create a custom stamp annotation. * * The returned custom Imagestamp annotation is not yet part of any page. * It can be added to a page's list of annotations. * The custom stamp annotation's appearance is generated after it was added to a page. * @param boundingBox * The location of the annotation on the page. * For registered images the correct aspect ratio can be derived from the given image. * When creating the stamp from a PDF Page, the aspect ratio can be derived from the size of the page that was copied using {@link PdfViewing.Pdf.Document.getPagePdfSize } * @param imageId * The ID of an image that is already registered in the Document. * Image ID's can be generated from images using {@link PdfViewing.Pdf.Document.registerImage } or from a PDF Page using {@link PdfViewing.Pdf.Document.registerPdfPage } * @param rotation * The rotation of the annotation in relation to the unrotated view. * The annotation is created with a compensating (and hence opposite) {@link PdfViewing.Pdf.Annotations.Stamp.rotation }, * such that it is upright and readable when viewing the document with said view rotation. * @returns * The newly created custom text stamp annotation. * * @throws {@link PdfViewing.ArgumentError} if the {@link PdfViewing.Pdf.Annotations.CustomImageStamp.create imageId} argument is invalid */ static create(boundingBox: PdfViewing.Pdf.Geometry.Real.RectangleOnPage, imageId: number, rotation: PdfViewing.Pdf.Geometry.Rotation): PdfViewing.Pdf.Annotations.CustomImageStamp; } /** * An annotation that displays text * * For a free-text annotation, the annotation's content is used as text to be displayed as the annotation's visual manifestation on the page. */ class FreeText extends PdfViewing.Pdf.Annotations.MarkupAnnotation { /** * Create a free-text annotation. * * The returned free-text annotation is not yet part of any page. * It can be added to a page's list of annotations. * @param boundingBox * The location on the page. * @param richText * The Richtextstring describing content, color and font. * @param backgroundColor * The background color of the freetext annotation. Passing null results in a transparent background. * @param annotationStroke * The stroking style for all lines * @param viewRotation * The rotation of the view, see {@link PdfViewing.Pdf.View.viewRotation }. * The annotation is created with a compensating (and hence opposite) {@link PdfViewing.Pdf.Annotations.FreeText.rotation }, * such that it is upright and readable when viewing the document with said view rotation. * @returns * The newly created free text annotation. */ static create(boundingBox: PdfViewing.Pdf.Geometry.Real.RectangleOnPage, richText: string, backgroundColor: PdfViewing.Pdf.Annotations.Color | null, annotationStroke: PdfViewing.Pdf.Annotations.AnnotationStroke, viewRotation: PdfViewing.Pdf.Geometry.Rotation): PdfViewing.Pdf.Annotations.FreeText; /** * The stroking style for all lines. (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get annotationStroke(): PdfViewing.Pdf.Annotations.AnnotationStroke; /** * The stroking style for all lines. (Setter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set annotationStroke(annotationStroke: PdfViewing.Pdf.Annotations.AnnotationStroke); /** * The information content (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get richText(): string; /** * The information content (Setter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set richText(richText: string); /** * The background color (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get backgroundColor(): PdfViewing.Pdf.Annotations.Color | null; /** * The background color (Setter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set backgroundColor(backgroundColor: PdfViewing.Pdf.Annotations.Color | null); /** * Rotation in relation to the page. * When creating the annotation with a non-zero view rotation in {@link PdfViewing.Pdf.Annotations.FreeText.create }, * then this property will initially be the opposite of the given view rotation. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get rotation(): PdfViewing.Pdf.Geometry.Rotation; /** * Rotation in relation to the page. * When creating the annotation with a non-zero view rotation in {@link PdfViewing.Pdf.Annotations.FreeText.create }, * then this property will initially be the opposite of the given view rotation. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set rotation(rotation: PdfViewing.Pdf.Geometry.Rotation); } /** * A drawing annotation * * An annotation used to draws something on a page. */ class DrawingAnnotation extends PdfViewing.Pdf.Annotations.MarkupAnnotation { /** * The color used for any stroking and the popup. * The value `null` renders the color completely transparent. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get strokeColor(): PdfViewing.Pdf.Annotations.Color | null; /** * The color used for any stroking and the popup. * The value `null` renders the color completely transparent. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set strokeColor(strokeColor: PdfViewing.Pdf.Annotations.Color | null); /** * The stroking style for all lines. (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get annotationStroke(): PdfViewing.Pdf.Annotations.AnnotationStroke | null; /** * The stroking style for all lines. (Setter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set annotationStroke(annotationStroke: PdfViewing.Pdf.Annotations.AnnotationStroke | null); /** * The pop-up (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get popup(): PdfViewing.Pdf.Annotations.Popup | null; /** * The drawing path (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get path(): PdfViewing.Pdf.Geometry.Real.Path; } /** * A line annotation * * An annotation that draws a line on a page. */ class LineAnnotation extends PdfViewing.Pdf.Annotations.DrawingAnnotation { /** * Create a line annotation. * * The returned line annotation is not yet part of any page. * It can be added to a page's list of annotations. * @param start * The line's start point. * @param end * The line's end point. * @param strokeColor * The color used for stroking and the popup. Pass `null` to set default grey color. * @param annotationStroke * The stroking style for all lines * @returns * The newly created line annotation. * * @throws {@link PdfViewing.ArgumentError} if points {@link PdfViewing.Pdf.Annotations.LineAnnotation.create start} and {@link PdfViewing.Pdf.Annotations.LineAnnotation.create end} are not on the same page */ static create(start: PdfViewing.Pdf.Geometry.Real.PointOnPage, end: PdfViewing.Pdf.Geometry.Real.PointOnPage, strokeColor: PdfViewing.Pdf.Annotations.Color | null, annotationStroke: PdfViewing.Pdf.Annotations.AnnotationStroke): PdfViewing.Pdf.Annotations.LineAnnotation; /** * The line's starting point (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get start(): PdfViewing.Pdf.Geometry.Real.PointOnPage; /** * The line's ending point (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get end(): PdfViewing.Pdf.Geometry.Real.PointOnPage; /** * The starting point's style (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get startStyle(): PdfViewing.Pdf.Annotations.LineEnding; /** * The ending point's style (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get endStyle(): PdfViewing.Pdf.Annotations.LineEnding; /** * The line ending filling paint (Getter) * * This paint applies to both the starting end the ending point. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get lineEndingFill(): PdfViewing.Pdf.Annotations.Color; } /** * A free-hand drawing annotation * */ class InkAnnotation extends PdfViewing.Pdf.Annotations.DrawingAnnotation { /** * Create a ink annotation. * * The returned ink annotation is not yet part of any page. * It can be added to a page's list of annotations. * @param pageNumber * @param path * The path of the free-hand drawing. * @param strokeColor * The color used for stroking and the popup * @param annotationStroke * The stroking style for all lines * @returns * The newly created ink annotation. * * @throws {@link PdfViewing.ArgumentError} if the {@link PdfViewing.Pdf.Annotations.InkAnnotation.create path} argument is `null` * @throws {@link PdfViewing.NotSupportedError} if the {@link PdfViewing.Pdf.Annotations.InkAnnotation.create path} is not valid for this operation */ static create(pageNumber: number, path: PdfViewing.Pdf.Geometry.Real.Path, strokeColor: PdfViewing.Pdf.Annotations.Color, annotationStroke: PdfViewing.Pdf.Annotations.AnnotationStroke): PdfViewing.Pdf.Annotations.InkAnnotation; /** * Set the path * * Supported {@link PdfViewing.Pdf.Geometry.Real.PathOperation }s are * {@link PdfViewing.Pdf.Geometry.Real.PathOperation.MoveTo } and {@link PdfViewing.Pdf.Geometry.Real.PathOperation.LineTo }. * @param path * The new path to be set for the annotation. * * @throws {@link PdfViewing.ArgumentError} if the {@link PdfViewing.Pdf.Annotations.InkAnnotation.setPath path} argument is `null` * @throws {@link PdfViewing.NotSupportedError} if the {@link PdfViewing.Pdf.Annotations.InkAnnotation.setPath path} contains unsupported {@link PdfViewing.Pdf.Geometry.Real.PathOperation }s */ setPath(path: PdfViewing.Pdf.Geometry.Real.Path): void; } /** * A drawing annotation that consists of several line segments * */ class PolyLineAnnotation extends PdfViewing.Pdf.Annotations.DrawingAnnotation { /** * Create a poly-line annotation. * * The returned poly-line annotation is not yet part of any page. * It can be added to a page's list of annotations. * @param pageNumber * @param path * The path of the poly line. * @param strokeColor * The color used for stroking and the popup * @param annotationStroke * The stroking style for all lines * @returns * The newly created poly-line annotation. * * @throws {@link PdfViewing.ArgumentError} if the {@link PdfViewing.Pdf.Annotations.PolyLineAnnotation.create path} argument is `null` * @throws {@link PdfViewing.NotSupportedError} if the {@link PdfViewing.Pdf.Annotations.PolyLineAnnotation.create path} is not valid for this operation */ static create(pageNumber: number, path: PdfViewing.Pdf.Geometry.Real.Path, strokeColor: PdfViewing.Pdf.Annotations.Color, annotationStroke: PdfViewing.Pdf.Annotations.AnnotationStroke): PdfViewing.Pdf.Annotations.PolyLineAnnotation; /** * The starting point's style (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get startStyle(): PdfViewing.Pdf.Annotations.LineEnding; /** * The ending point's style (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get endStyle(): PdfViewing.Pdf.Annotations.LineEnding; /** * The line ending filling paint for both start and end (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get lineEndingFill(): PdfViewing.Pdf.Annotations.Color; } /** * A polygon annotation * */ class PolygonAnnotation extends PdfViewing.Pdf.Annotations.DrawingAnnotation { /** * Create a polygon annotation. * * The returned polygon annotation is not yet part of any page. * It can be added to a page's list of annotations. * @param pageNumber * @param path * The path of the polygon. * @param strokeColor * The color used for stroking and the popup. * The alpha value of this color is used for stroking and filling. * Set `null` or a color with alpha = 0 to make stroke transparent. * @param annotationStroke * The stroking style for all lines * @param borderStyleType * The style of the stroked lines * @param fillColor * The paint used for filling the polygon. * If `null` then the polygon is not filled. * The alpha value of this color only takes effect if {@link PdfViewing.Pdf.Annotations.PolygonAnnotation.create strokeColor} is `null` or its alpha value is 0. * @returns * The newly created polygon annotation. * * @throws {@link PdfViewing.ArgumentError} if the {@link PdfViewing.Pdf.Annotations.PolygonAnnotation.create path} argument is `null` * @throws {@link PdfViewing.NotSupportedError} if the {@link PdfViewing.Pdf.Annotations.PolygonAnnotation.create path} is not valid for this operation */ static create(pageNumber: number, path: PdfViewing.Pdf.Geometry.Real.Path, strokeColor: PdfViewing.Pdf.Annotations.Color | null, annotationStroke: PdfViewing.Pdf.Annotations.AnnotationStroke, borderStyleType: PdfViewing.Pdf.Annotations.BorderStyleType, fillColor: PdfViewing.Pdf.Annotations.Color | null): PdfViewing.Pdf.Annotations.PolygonAnnotation; /** * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get borderStyleType(): PdfViewing.Pdf.Annotations.BorderStyleType; /** * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set borderStyleType(borderStyleType: PdfViewing.Pdf.Annotations.BorderStyleType); /** * The filling paint (Getter) * * If `null` then the polygon is not filled. * The alpha value of this color only takes effect if {@link PdfViewing.Pdf.Annotations.DrawingAnnotation.strokeColor } is `null` or its alpha value is 0. * Otherwise alpha of {@link PdfViewing.Pdf.Annotations.DrawingAnnotation.strokeColor } is used. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get fillColor(): PdfViewing.Pdf.Annotations.Color | null; /** * The filling paint (Setter) * * If `null` then the polygon is not filled. * The alpha value of this color only takes effect if {@link PdfViewing.Pdf.Annotations.DrawingAnnotation.strokeColor } is `null` or its alpha value is 0. * Otherwise alpha of {@link PdfViewing.Pdf.Annotations.DrawingAnnotation.strokeColor } is used. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set fillColor(fillColor: PdfViewing.Pdf.Annotations.Color | null); } /** * A rectangle drawing annotation * */ class RectangleAnnotation extends PdfViewing.Pdf.Annotations.DrawingAnnotation { /** * Create a rectangle annotation. * * The returned rectangle annotation is not yet part of any page. * It can be added to a page's list of annotations. * @param boundingBox * The location on the page. * @param strokeColor * The color used for stroking and the popup. * The alpha value of this color is used for stroking and filling. * Set `null` or a color with alpha = 0 to make stroke transparent. * @param annotationStroke * The stroking style for all lines. * @param borderStyleType * The style of the stroked lines * @param fillColor * The paint used for filling the rectangle. * If `null` then the rectangle is not filled. * The alpha value of this color only takes effect if {@link PdfViewing.Pdf.Annotations.RectangleAnnotation.create strokeColor} is `null` or its alpha value is 0. * @returns * The newly created rectangle annotation. */ static create(boundingBox: PdfViewing.Pdf.Geometry.Real.RectangleOnPage, strokeColor: PdfViewing.Pdf.Annotations.Color | null, annotationStroke: PdfViewing.Pdf.Annotations.AnnotationStroke, borderStyleType: PdfViewing.Pdf.Annotations.BorderStyleType, fillColor: PdfViewing.Pdf.Annotations.Color | null): PdfViewing.Pdf.Annotations.RectangleAnnotation; /** * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get borderStyleType(): PdfViewing.Pdf.Annotations.BorderStyleType; /** * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set borderStyleType(borderStyleType: PdfViewing.Pdf.Annotations.BorderStyleType); /** * The filling paint (Getter) * * If `null` then the rectangle is not filled. * The alpha value of this color only takes effect if {@link PdfViewing.Pdf.Annotations.DrawingAnnotation.strokeColor } is `null` or its alpha value is 0. * Otherwise alpha of {@link PdfViewing.Pdf.Annotations.DrawingAnnotation.strokeColor } is used. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get fillColor(): PdfViewing.Pdf.Annotations.Color | null; /** * The filling paint (Setter) * * If `null` then the rectangle is not filled. * The alpha value of this color only takes effect if {@link PdfViewing.Pdf.Annotations.DrawingAnnotation.strokeColor } is `null` or its alpha value is 0. * Otherwise alpha of {@link PdfViewing.Pdf.Annotations.DrawingAnnotation.strokeColor } is used. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set fillColor(fillColor: PdfViewing.Pdf.Annotations.Color | null); } /** * An ellipse drawing annotation * */ class EllipseAnnotation extends PdfViewing.Pdf.Annotations.DrawingAnnotation { /** * Create an ellipse annotation. * * The returned ellipse annotation is not yet part of any page. * It can be added to a page's list of annotations. * @param boundingBox * The location on the page. * @param strokeColor * The color used for stroking and the popup. * The alpha value of this color is used for stroking and filling. * Set `null` or a color with alpha = 0 to make stroke transparent. * @param annotationStroke * The stroking style for all lines. The color is also used for the popup. * @param borderStyleType * The style of the stroked border * @param fillColor * The paint used for filling the rectangle. * If `null` then the rectangle is not filled. * The alpha value of this color only takes effect if {@link PdfViewing.Pdf.Annotations.EllipseAnnotation.create strokeColor} is `null` or its alpha value is 0. * @returns * The newly created ellipse annotation. */ static create(boundingBox: PdfViewing.Pdf.Geometry.Real.RectangleOnPage, strokeColor: PdfViewing.Pdf.Annotations.Color | null, annotationStroke: PdfViewing.Pdf.Annotations.AnnotationStroke, borderStyleType: PdfViewing.Pdf.Annotations.BorderStyleType, fillColor: PdfViewing.Pdf.Annotations.Color | null): PdfViewing.Pdf.Annotations.EllipseAnnotation; /** * */ get borderStyleType(): PdfViewing.Pdf.Annotations.BorderStyleType; /** * */ set borderStyleType(borderStyleType: PdfViewing.Pdf.Annotations.BorderStyleType); /** * The filling paint (Getter) * * If `null` then the ellipse is not filled. * The alpha value of this color only takes effect if {@link PdfViewing.Pdf.Annotations.DrawingAnnotation.strokeColor } is `null` or its alpha value is 0. * Otherwise alpha of {@link PdfViewing.Pdf.Annotations.DrawingAnnotation.strokeColor } is used. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get fillColor(): PdfViewing.Pdf.Annotations.Color | null; /** * The filling paint (Setter) * * If `null` then the ellipse is not filled. * The alpha value of this color only takes effect if {@link PdfViewing.Pdf.Annotations.DrawingAnnotation.strokeColor } is `null` or its alpha value is 0. * Otherwise alpha of {@link PdfViewing.Pdf.Annotations.DrawingAnnotation.strokeColor } is used. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set fillColor(fillColor: PdfViewing.Pdf.Annotations.Color | null); } /** * An annotation that marks up part(s) of a text * */ class TextMarkup extends PdfViewing.Pdf.Annotations.MarkupAnnotation { /** * The Color of the annotation and the popup (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get color(): PdfViewing.Pdf.Annotations.Color; /** * The Color of the annotation and the popup (Setter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set color(color: PdfViewing.Pdf.Annotations.Color); /** * The pop-up (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get popup(): PdfViewing.Pdf.Annotations.Popup | null; /** * Area of all marked text. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get markupArea(): PdfViewing.Pdf.Geometry.Real.QuadrilateralList; /** * Area of all marked text. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * @throws {@link PdfViewing.ArgumentError} if the list is `null` * @throws {@link PdfViewing.ArgumentError} if the list contains no quadrilaterals */ set markupArea(markupArea: PdfViewing.Pdf.Geometry.Real.QuadrilateralList); /** * Text which is highlighted * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get markedText(): string; } /** * An text highlighting annotation * */ class Highlight extends PdfViewing.Pdf.Annotations.TextMarkup { /** * Create a Highlight annotation. * * The returned rectangle annotation is not yet part of any page. * It can be added to a page's list of annotations. * @param markupArea * List of areas to be highlighted. * @param color * The color used for the highlighted area and the popup. * @returns * The newly created highlight annotation. * * @throws {@link PdfViewing.ArgumentError} if the {@link PdfViewing.Pdf.Annotations.Highlight.create markupArea} argument is `null` * @throws {@link PdfViewing.ArgumentError} if the {@link PdfViewing.Pdf.Annotations.Highlight.create markupArea} list contains no quadrilaterals */ static create(markupArea: PdfViewing.Pdf.Geometry.Real.QuadrilateralList, color: PdfViewing.Pdf.Annotations.Color): PdfViewing.Pdf.Annotations.Highlight; } /** * An text underlining annotation * */ class Underline extends PdfViewing.Pdf.Annotations.TextMarkup { /** * Create a Highlight annotation. * * The returned rectangle annotation is not yet part of any page. * It can be added to a page's list of annotations. * @param markupArea * List of areas to be underlined. The underline is drawn on the baseline of each quadpoint. * @param color * The color used for the line and the popup. * @returns * The newly created Underline annotation. * * @throws {@link PdfViewing.ArgumentError} if the {@link PdfViewing.Pdf.Annotations.Underline.create markupArea} argument is `null` * @throws {@link PdfViewing.ArgumentError} if the {@link PdfViewing.Pdf.Annotations.Underline.create markupArea} list contains no quadrilaterals */ static create(markupArea: PdfViewing.Pdf.Geometry.Real.QuadrilateralList, color: PdfViewing.Pdf.Annotations.Color): PdfViewing.Pdf.Annotations.Underline; } /** * An annotation for striking through text * */ class StrikeThrough extends PdfViewing.Pdf.Annotations.TextMarkup { /** * Create a Highlight annotation. * * The returned rectangle annotation is not yet part of any page. * It can be added to a page's list of annotations. * @param markupArea * List of areas to be striked through. The line is drawn in the middle of each quadpoints, parallel to its baseline. * @param color * The color used for the line and the popup. * @returns * The newly created strikethrough annotation. * * @throws {@link PdfViewing.ArgumentError} if the {@link PdfViewing.Pdf.Annotations.StrikeThrough.create markupArea} argument is `null` * @throws {@link PdfViewing.ArgumentError} if the {@link PdfViewing.Pdf.Annotations.StrikeThrough.create markupArea} list contains no quadrilaterals */ static create(markupArea: PdfViewing.Pdf.Geometry.Real.QuadrilateralList, color: PdfViewing.Pdf.Annotations.Color): PdfViewing.Pdf.Annotations.StrikeThrough; } /** * A squiggly text underlining annotation * */ class Squiggly extends PdfViewing.Pdf.Annotations.TextMarkup { /** * Create a Highlight annotation. * * The returned rectangle annotation is not yet part of any page. * It can be added to a page's list of annotations. * @param markupArea * List of areas to be underlined with a squiggly line. The squiggly line is drawn on the baseline of each quadpoint. * @param color * The color used for the line and the popup. * @returns * The newly created Squiggly annotation. * * @throws {@link PdfViewing.ArgumentError} if the {@link PdfViewing.Pdf.Annotations.Squiggly.create markupArea} argument is `null` * @throws {@link PdfViewing.ArgumentError} if the {@link PdfViewing.Pdf.Annotations.Squiggly.create markupArea} list contains no quadrilaterals */ static create(markupArea: PdfViewing.Pdf.Geometry.Real.QuadrilateralList, color: PdfViewing.Pdf.Annotations.Color): PdfViewing.Pdf.Annotations.Squiggly; } /** * An annotation that marks a point to insert text * */ class TextInsert extends PdfViewing.Pdf.Annotations.MarkupAnnotation { /** * The Color for the annotation and the popup (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get color(): PdfViewing.Pdf.Annotations.Color; /** * The Color for the annotation and the popup (Setter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set color(color: PdfViewing.Pdf.Annotations.Color); /** * The pop-up (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get popup(): PdfViewing.Pdf.Annotations.Popup | null; } /** * A link * */ class Link extends PdfViewing.Pdf.Annotations.Annotation { /** * The link's border stroke (Setter) * * This property defines if and how a rectangular border is drawn for the link. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * @throws {@link PdfViewing.ArgumentError} the given {@link PdfViewing.Pdf.Annotations.AnnotationStroke } object is `null` */ set annotationStroke(annotationStroke: PdfViewing.Pdf.Annotations.AnnotationStroke); /** * The Color for the annotation (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get color(): PdfViewing.Pdf.Annotations.Color; /** * The Color for the annotation (Setter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set color(color: PdfViewing.Pdf.Annotations.Color); /** * The link area (Getter) * * This list of {@link PdfViewing.Pdf.Geometry.Real.QuadrilateralOnPage }s defines the active link area on the page. * A PDF viewer executes the appropriate action, * such as navigating to a destination or opening a web browser, * when a mouse click falls inside of this area. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get activeArea(): PdfViewing.Pdf.Geometry.Real.QuadrilateralList; /** * The link area (Setter) * * This list of {@link PdfViewing.Pdf.Geometry.Real.QuadrilateralOnPage }s defines the active link area on the page. * A PDF viewer executes the appropriate action, * such as navigating to a destination or opening a web browser, * when a mouse click falls inside of this area. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * @throws {@link PdfViewing.ArgumentError} if the list is `null`. * @throws {@link PdfViewing.ArgumentError} if the list contains no quadrilaterals. */ set activeArea(activeArea: PdfViewing.Pdf.Geometry.Real.QuadrilateralList); } /** * A document-wide link * */ class InternalLink extends PdfViewing.Pdf.Annotations.Link { /** * The link target (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * @throws {@link PdfViewing.InvalidOperationError} if the link has no destination */ get destination(): PdfViewing.Pdf.Navigation.Destination | null; } /** * An external link * */ class WebLink extends PdfViewing.Pdf.Annotations.Link { /** * Create a new external link * * The returned WebLink annotation is not yet part of any page. * It can be added to a page's list of annotations. * @param boundingBox * The location on the page. * @param annotationStroke * The given AnnotationStroke defines if and how a rectangular border is drawn for the link. * @param uri * The link target * @returns * The newly created object */ static create(boundingBox: PdfViewing.Pdf.Geometry.Real.RectangleOnPage, annotationStroke: PdfViewing.Pdf.Annotations.AnnotationStroke, uri: string): PdfViewing.Pdf.Annotations.WebLink; /** * The link target (Getter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get uri(): string; /** * The link target (Setter) * * * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set uri(uri: string); } /** * A link to an embedded PDF document * */ class EmbeddedPdfLink extends PdfViewing.Pdf.Annotations.Link { /** * The opening behavior (Getter) * * This defines the viewer's behavior when opening the target PDF document. * - `null`: The viewer uses its default behavior. * - `true`: Open the document in an additional window. * - `false`: Replace the parent document with the embedded document. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get newWindow(): boolean | null; /** * The opening behavior (Setter) * * This defines the viewer's behavior when opening the target PDF document. * - `null`: The viewer uses its default behavior. * - `true`: Open the document in an additional window. * - `false`: Replace the parent document with the embedded document. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set newWindow(newWindow: boolean | null); } /** * */ class AnnotationStroke extends Internal.NativeObject { /** * */ constructor(); /** * Close the object * * Release all native resources associated with the object. */ close(): void; /** * Width of the line in points * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get lineWidth(): number; /** * Width of the line in points * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set lineWidth(lineWidth: number); /** * Describes the sequence of dashlength and gaplength of the dashing pattern, starting with a dash in points. The pattern is repeated. * Leaving the {@link PdfViewing.Pdf.Annotations.AnnotationStroke.dashArray } empty results in a solid line. * The {@link PdfViewing.Pdf.Annotations.AnnotationStroke.dashArray } is ignored if the Annotation has a {@link PdfViewing.Pdf.Annotations.BorderStyleType } property that is not set to {@link PdfViewing.Pdf.Annotations.BorderStyleType.Lined }. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get dashArray(): number[]; /** * Describes the sequence of dashlength and gaplength of the dashing pattern, starting with a dash in points. The pattern is repeated. * Leaving the {@link PdfViewing.Pdf.Annotations.AnnotationStroke.dashArray } empty results in a solid line. * The {@link PdfViewing.Pdf.Annotations.AnnotationStroke.dashArray } is ignored if the Annotation has a {@link PdfViewing.Pdf.Annotations.BorderStyleType } property that is not set to {@link PdfViewing.Pdf.Annotations.BorderStyleType.Lined }. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set dashArray(dashArray: number[]); } /** * */ class AnnotationList extends Internal.NativeObject implements List { /** * Close the object * * Release all native resources associated with the object. */ close(): void; remove(element: PdfViewing.Pdf.Annotations.Annotation): boolean; add(element: PdfViewing.Pdf.Annotations.Annotation): boolean; addRange(inputList: AnnotationList): boolean; set(index: number, element: PdfViewing.Pdf.Annotations.Annotation): void; clear(): void; get(index: number): PdfViewing.Pdf.Annotations.Annotation; getRange(index: number, count: number): AnnotationList; get size(): number; [Symbol.iterator](): Iterator; } } namespace Forms { /** * A form field widget * */ class Widget extends PdfViewing.Pdf.Annotations.Annotation { /** * Editing this widget is not allowed. */ get readOnly(): boolean; /** * When filling out form this field is not optional. */ get required(): boolean; } /** * * An empty box which can be marked with a checkmark. */ class CheckBox extends PdfViewing.Pdf.Forms.Widget { /** * * Toggle whether the given box is checked. */ push(): void; /** * Whether the box is checked * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get isChecked(): boolean; } /** * * A radio button allows to choose one of multiple choices by selecting one of the buttons in a radio button group. */ class RadioButton extends PdfViewing.Pdf.Forms.Widget { /** * * Toggle whether the given box is checked. * If the radio button is not selected, then select it. * If the radio button is selected and the radio button has {@link PdfViewing.Pdf.Forms.RadioButton.noSelectionAllowed } set to `true`, then deselect the radio button. */ push(): void; /** * Whether this radiobutton may be deselected, resulting in no radiobuttons of this group being selected. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get noSelectionAllowed(): boolean; /** * Whether this button is selected. * Note that selecting one radio button might deselect other radio buttons. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get selected(): boolean; } /** * * A text box allows the entry of arbitrary text. */ class TextBox extends PdfViewing.Pdf.Forms.Widget { /** * Whether horizontal scrolling of text is allowed in the text box * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get scrollAllowed(): boolean; /** * Whether the text is may be shown on multiple lines in the text box * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get multilineAllowed(): boolean; /** * Interpret the given string as rich-text * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get textIsRichText(): boolean; /** * Whether text should be monospaced * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get comb(): boolean; /** * The maximum amount of characters that {@link PdfViewing.Pdf.Forms.TextBox.text } may contain * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get maxLength(): number; /** * The text currently set in the text box * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get text(): string; /** * The text currently set in the text box * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * @throws {@link PdfViewing.ArgumentError} if the given {@link PdfViewing.Pdf.Forms.TextBox.maxLength } was exceeded */ set text(text: string); } /** * * A list box shows a scrollable list of choices in a box. */ class ListBox extends PdfViewing.Pdf.Forms.Widget { /** * Whether multiple options may be selected. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get multiSelectAllowed(): boolean; /** * List of strings which can be chosen for this box. */ get options(): PdfViewing.StringList; /** * This is a set of indices indicating which of the {@link PdfViewing.Pdf.Forms.ListBox.options } are currently chosen. * Index values may range from 0 up to size of {@link PdfViewing.Pdf.Forms.ListBox.options } - 1. */ get chosen(): PdfViewing.IntegerSet; /** * This is a set of indices indicating which of the {@link PdfViewing.Pdf.Forms.ListBox.options } are currently chosen. * Index values may range from 0 up to size of {@link PdfViewing.Pdf.Forms.ListBox.options } - 1. * * @throws {@link PdfViewing.ArgumentError} An index is not in the allowed range. */ set chosen(chosen: PdfViewing.IntegerSet); } /** * * A combo box shows a scrollable list of choices in a drop-down menu potentially combined with an editable custom entry. */ class ComboBox extends PdfViewing.Pdf.Forms.Widget { /** * Whether the combo box supports an editable custom entry instead of one of the {@link PdfViewing.Pdf.Forms.ComboBox.options } * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get customEntryAllowed(): boolean; /** * If {@link PdfViewing.Pdf.Forms.ComboBox.customEntryAllowed } is set a custom entry can be used instead of the entries in {@link PdfViewing.Pdf.Forms.ComboBox.options }. * Setting {@link PdfViewing.Pdf.Forms.ComboBox.customEntry } to any value other than `null` automatically sets {@link PdfViewing.Pdf.Forms.ComboBox.chosen } to `null`. * Conversely, setting {@link PdfViewing.Pdf.Forms.ComboBox.chosen } to any value other than `null` automatically sets {@link PdfViewing.Pdf.Forms.ComboBox.customEntry } to `null`. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get customEntry(): string | null; /** * If {@link PdfViewing.Pdf.Forms.ComboBox.customEntryAllowed } is set a custom entry can be used instead of the entries in {@link PdfViewing.Pdf.Forms.ComboBox.options }. * Setting {@link PdfViewing.Pdf.Forms.ComboBox.customEntry } to any value other than `null` automatically sets {@link PdfViewing.Pdf.Forms.ComboBox.chosen } to `null`. * Conversely, setting {@link PdfViewing.Pdf.Forms.ComboBox.chosen } to any value other than `null` automatically sets {@link PdfViewing.Pdf.Forms.ComboBox.customEntry } to `null`. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * @throws {@link PdfViewing.NotSupportedError} Setting a Custom Entry is only allowed if {@link PdfViewing.Pdf.Forms.ComboBox.customEntryAllowed } is set to `true`. * @throws {@link PdfViewing.ArgumentError} {@link PdfViewing.Pdf.Forms.ComboBox.customEntry } may not be set to `null`. */ set customEntry(customEntry: string | null); /** * List of strings which can be chosen for this box. */ get options(): PdfViewing.StringList; /** * The index of the currently chosen Option from {@link PdfViewing.Pdf.Forms.ComboBox.options }. * Setting {@link PdfViewing.Pdf.Forms.ComboBox.chosen } to any value other than `null` automatically sets {@link PdfViewing.Pdf.Forms.ComboBox.customEntry } to `null`. * Conversely, setting {@link PdfViewing.Pdf.Forms.ComboBox.customEntry } to any value other than `null` automatically sets {@link PdfViewing.Pdf.Forms.ComboBox.chosen } to `null`. */ get chosen(): number | null; /** * The index of the currently chosen Option from {@link PdfViewing.Pdf.Forms.ComboBox.options }. * Setting {@link PdfViewing.Pdf.Forms.ComboBox.chosen } to any value other than `null` automatically sets {@link PdfViewing.Pdf.Forms.ComboBox.customEntry } to `null`. * Conversely, setting {@link PdfViewing.Pdf.Forms.ComboBox.customEntry } to any value other than `null` automatically sets {@link PdfViewing.Pdf.Forms.ComboBox.chosen } to `null`. * * @throws {@link PdfViewing.ArgumentError} Index is not in the allowed range. * @throws {@link PdfViewing.ArgumentError} {@link PdfViewing.Pdf.Forms.ComboBox.chosen } may not be set to `null`. */ set chosen(chosen: number | null); } } namespace Geometry { /** * * Values represent the Rotation in degrees clockwise. */ enum Rotation { /** * */ NoRotation = 0, /** * */ Clockwise = 90, /** * */ UpsideDown = 180, /** * */ CounterClockwise = 270 } namespace Real { /** * */ class Size extends Internal.NativeBase { /** * The width (horizontal size). * */ width: number; /** * The height (vertical size). * */ height: number; constructor(width: number, height: number); equals(obj: Size | null): boolean; } /** * */ class Point extends Internal.NativeBase { /** * The X value (horizontal coordinate). * */ x: number; /** * The Y value (vertical coordinate). * */ y: number; constructor(x: number, y: number); equals(obj: Point | null): boolean; } /** * * A point relative to a PDF Page in PDF coordinates (double), the origin is at the bottom-left of the page, x increasing to the right and y increasing upwards. */ class PointOnPage extends Internal.NativeBase { /** * */ pageNumber: number; /** * */ x: number; /** * */ y: number; constructor(pageNumber: number, x: number, y: number); equals(obj: PointOnPage | null): boolean; } /** * * A quadrilateral is a polygon with four sides and four corners. * When associated with text, the horizontal text writing direction goes from {@link PdfViewing.Pdf.Geometry.Real.QuadrilateralOnPage.pageNumber } to {@link PdfViewing.Pdf.Geometry.Real.QuadrilateralOnPage.pageNumber }. */ class QuadrilateralOnPage extends Internal.NativeBase { /** * */ pageNumber: number; /** * */ bottomLeft: PdfViewing.Pdf.Geometry.Real.Point; /** * */ bottomRight: PdfViewing.Pdf.Geometry.Real.Point; /** * */ topRight: PdfViewing.Pdf.Geometry.Real.Point; /** * */ topLeft: PdfViewing.Pdf.Geometry.Real.Point; constructor(pageNumber: number, bottomLeft: PdfViewing.Pdf.Geometry.Real.Point, bottomRight: PdfViewing.Pdf.Geometry.Real.Point, topRight: PdfViewing.Pdf.Geometry.Real.Point, topLeft: PdfViewing.Pdf.Geometry.Real.Point); equals(obj: QuadrilateralOnPage | null): boolean; } /** * * A rectangle relative to a PDF Page in PDF coordinates (double), the origin is at the bottom-left of the page , x increasing to the right and y increasing upwards */ class RectangleOnPage extends Internal.NativeBase { /** * */ pageNumber: number; /** * */ x: number; /** * */ y: number; /** * */ width: number; /** * */ height: number; constructor(pageNumber: number, x: number, y: number, width: number, height: number); equals(obj: RectangleOnPage | null): boolean; } /** * * A point relative to a PDF Page in PDF coordinates (double), the origin is at the bottom-left of the page, x increasing to the right and y increasing upwards. * This point will join 2 lines. */ class Vertex extends Internal.NativeBase { /** * */ pageNumber: number; /** * */ x: number; /** * */ y: number; /** * * Operation on the vertex. */ operator: PdfViewing.Pdf.Geometry.Real.PathOperation; constructor(pageNumber: number, x: number, y: number, operator: PdfViewing.Pdf.Geometry.Real.PathOperation); equals(obj: Vertex | null): boolean; } /** * * Values represent the type of path operation on the vertex. */ enum PathOperation { /** * */ MoveTo = 0, /** * */ LineTo = 1 } /** * * A List of {@link PdfViewing.Pdf.Geometry.Real.RectangleOnPage }s */ class RectangleOnPageList extends Internal.NativeObject implements List { /** * Close the object * * Release all native resources associated with the object. */ close(): void; remove(element: PdfViewing.Pdf.Geometry.Real.RectangleOnPage): boolean; add(element: PdfViewing.Pdf.Geometry.Real.RectangleOnPage): boolean; addRange(inputList: RectangleOnPageList): boolean; set(index: number, element: PdfViewing.Pdf.Geometry.Real.RectangleOnPage): void; clear(): void; get(index: number): PdfViewing.Pdf.Geometry.Real.RectangleOnPage; getRange(index: number, count: number): RectangleOnPageList; get size(): number; [Symbol.iterator](): Iterator; } /** * * A path described by a series of vertices. */ class Path extends Internal.NativeObject { /** * */ constructor(); /** * List of vertices joined as a path. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get vertices(): PdfViewing.Pdf.Geometry.Real.VertexList; /** * List of vertices joined as a path. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * @throws {@link PdfViewing.ArgumentError} The vertex list starts with a {@link PdfViewing.Pdf.Geometry.Real.PathOperation.LineTo } * or contains two successive {@link PdfViewing.Pdf.Geometry.Real.PathOperation.MoveTo }s */ set vertices(vertices: PdfViewing.Pdf.Geometry.Real.VertexList); } /** * * A List of {@link PdfViewing.Pdf.Geometry.Real.RectangleOnPage }s */ class PathGenerator extends Internal.NativeObject { /** * Create a new path generator for appending to a path. * * @param path * the path object * * @throws {@link PdfViewing.ArgumentError} if the {@link PdfViewing.Pdf.Geometry.Real.PathGenerator. path} argument is `null` * @throws {@link PdfViewing.ArgumentError} if the {@link PdfViewing.Pdf.Geometry.Real.PathGenerator. path} object has already been closed */ constructor(path: PdfViewing.Pdf.Geometry.Real.Path); /** * Close the object * * Release all native resources associated with the object. */ close(): void; /** * Move the current position. * * Begin a new subpath by moving the current point to the specified coordinates, * omitting any connecting line segment. * If the previous path construction operator in the current path was also MoveTo, * the new MoveTo overrides it; * no vestige of the previous MoveTo operation remains in the path. * @param target * the target coordinates * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * @throws {@link PdfViewing.InvalidOperationError} if the path object has already been closed */ moveTo(target: PdfViewing.Pdf.Geometry.Real.Point): void; /** * Draw a line. * * Append a straight line segment from the current point to the target coordinates. * The current position is changed to the target position. * @param target * the target coordinates * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * @throws {@link PdfViewing.InvalidOperationError} if the path object has already been closed */ lineTo(target: PdfViewing.Pdf.Geometry.Real.Point): void; /** * Draw a bezier curve. * * Append a cubic Bézier curve to the current path. * The curve extends from the current point to the {@link PdfViewing.Pdf.Geometry.Real.PathGenerator.bezierTo target} position, * using {@link PdfViewing.Pdf.Geometry.Real.PathGenerator.bezierTo ctrl1} and {@link PdfViewing.Pdf.Geometry.Real.PathGenerator.bezierTo ctrl2} as the Bézier control points. * The current position is changed to the target position. * @param ctrl1 * the first bezier control point * @param ctrl2 * the second bezier control point * @param target * the target coordinates * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * @throws {@link PdfViewing.InvalidOperationError} if the path object has already been closed */ bezierTo(ctrl1: PdfViewing.Pdf.Geometry.Real.Point, ctrl2: PdfViewing.Pdf.Geometry.Real.Point, target: PdfViewing.Pdf.Geometry.Real.Point): void; /** * Close the current subpath. * * Close the current subpath by appending a straight line segment from the * current point to the starting point of the subpath. * This operator terminates the current subpath; * appending another segment to the current path will begin a new subpath, * even if the new segment begins at the endpoint reached by the closeSubpath() operation. * If the current subpath is already closed, CloseSubpath() does nothing. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * @throws {@link PdfViewing.InvalidOperationError} if the path object has already been closed */ closeSubpath(): void; /** * Append a rectangle to the current path as a complete subpath. * * @param rect * the rectangle to be added to the path * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed * @throws {@link PdfViewing.InvalidOperationError} if the path object has already been closed */ addRectangle(rect: PdfViewing.Pdf.Geometry.Real.RectangleOnPage): void; } /** * */ class QuadrilateralList extends Internal.NativeObject implements List { /** * */ constructor(); /** * Close the object * * Release all native resources associated with the object. */ close(): void; /** * * @param pointOnPage * @returns * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ contains(pointOnPage: PdfViewing.Pdf.Geometry.Real.PointOnPage): boolean; /** * The smallest rectangle which contains all quadrilaterals of this list. * * @throws {@link PdfViewing.ArgumentError} Property may not be read if the list is empty. */ get boundingBox(): PdfViewing.Pdf.Geometry.Real.RectangleOnPage; remove(element: PdfViewing.Pdf.Geometry.Real.QuadrilateralOnPage): boolean; add(element: PdfViewing.Pdf.Geometry.Real.QuadrilateralOnPage): boolean; addRange(inputList: QuadrilateralList): boolean; set(index: number, element: PdfViewing.Pdf.Geometry.Real.QuadrilateralOnPage): void; clear(): void; get(index: number): PdfViewing.Pdf.Geometry.Real.QuadrilateralOnPage; getRange(index: number, count: number): QuadrilateralList; get size(): number; [Symbol.iterator](): Iterator; } /** * */ class VertexList extends Internal.NativeObject implements List { /** * */ constructor(); remove(element: PdfViewing.Pdf.Geometry.Real.Vertex): boolean; add(element: PdfViewing.Pdf.Geometry.Real.Vertex): boolean; addRange(inputList: VertexList): boolean; set(index: number, element: PdfViewing.Pdf.Geometry.Real.Vertex): void; clear(): void; get(index: number): PdfViewing.Pdf.Geometry.Real.Vertex; getRange(index: number, count: number): VertexList; get size(): number; [Symbol.iterator](): Iterator; } } namespace Integer { /** * */ class Size extends Internal.NativeBase { /** * The Width value (horizontal size). * */ width: number; /** * The Height value (vertical size). * */ height: number; constructor(width: number, height: number); equals(obj: Size | null): boolean; } /** * * Describes the current position of the viewport on the document. Origin top left. */ class ScrollPosition extends Internal.NativeBase { /** * */ x: number; /** * */ y: number; constructor(x: number, y: number); equals(obj: ScrollPosition | null): boolean; } /** * * A point relative to the viewport in viewport coordinates (integer), the origin is at the top-left of the viewport, x increasing to the right and y increasing downwards */ class Point extends Internal.NativeBase { /** * */ x: number; /** * */ y: number; constructor(x: number, y: number); equals(obj: Point | null): boolean; } /** * * A Rectangle relative to the viewport in viewport coordinates (integer), the origin is at the top-left of the viewport, x increasing to the right and y increasing downwards */ class Rectangle extends Internal.NativeBase { /** * */ x: number; /** * */ y: number; /** * */ width: number; /** * */ height: number; constructor(x: number, y: number, width: number, height: number); equals(obj: Rectangle | null): boolean; } /** * * A set of paddings to be added at the respective sides of a rectangular object. */ class Padding extends Internal.NativeBase { /** * */ left: number; /** * */ right: number; /** * */ top: number; /** * */ bottom: number; constructor(left: number, right: number, top: number, bottom: number); equals(obj: Padding | null): boolean; } } } namespace Content { /** * */ enum Byteorder { /** * */ Invalid = 0 } /** * * A List of {@link PdfViewing.Pdf.Content.TextFragment }s */ class TextFragmentList extends Internal.NativeObject implements List { /** * Close the object * * Release all native resources associated with the object. */ close(): void; remove(element: PdfViewing.Pdf.Content.TextFragment): boolean; add(element: PdfViewing.Pdf.Content.TextFragment): boolean; addRange(inputList: TextFragmentList): boolean; set(index: number, element: PdfViewing.Pdf.Content.TextFragment): void; clear(): void; get(index: number): PdfViewing.Pdf.Content.TextFragment; getRange(index: number, count: number): TextFragmentList; get size(): number; [Symbol.iterator](): Iterator; } interface ViewingPdfContentTextSearchIteratorEventMap { /** * * {@link PdfViewing.Pdf.Content.TextSearchIterator.match } has been updated with a new result. * * The found Match. */ matchChanged: PdfViewing.Pdf.Content.TextSelection; /** * * {@link PdfViewing.Pdf.Content.TextSearchIterator.totalMatches } has been updated with a new result. */ totalMatchesChanged: void; } type ViewingPdfContentTextSearchIteratorEventListener = (e: ViewingPdfContentTextSearchIteratorEventMap[K]) => void; type ViewingPdfContentTextSearchIteratorEventTypes = keyof ViewingPdfContentTextSearchIteratorEventMap; /** * * Calling `SearchText` returns a `TextSearchIterator` starting the search at the beginning of the specified page. * `GetNext` and `GetPrevious` starts the search in the respective direction and subsequent calls iterate further starting from the result of the previous call. * `null` is returned if no more results are found. */ class TextSearchIterator extends Internal.NativeObject { private eventListeners; /** * @event */ addEventListener(type: K, listener: (e: ViewingPdfContentTextSearchIteratorEventMap[K]) => void): void; removeEventListener(type: K, listener: (e: ViewingPdfContentTextSearchIteratorEventMap[K]) => void): void; /** * Close the object * * Release all native resources associated with the object. */ close(): void; /** * * Update {@link PdfViewing.Pdf.Content.TextSearchIterator.match } to the next match in the document. * If no further rersult can be found `false` is returned and {@link PdfViewing.Pdf.Content.TextSearchIterator.match } is not updated. * @returns * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ getNext(): Promise; private getNextCallback; /** * * Update {@link PdfViewing.Pdf.Content.TextSearchIterator.match } to the next match in the document in backwards direction. * If no further rersult can be found `false` is returned and {@link PdfViewing.Pdf.Content.TextSearchIterator.match } is not updated. * @returns * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ getPrevious(): Promise; private getPreviousCallback; /** * * Start searching the entire document asynchronously. * The property {@link PdfViewing.Pdf.Content.TextSearchIterator.totalMatches } will be updated continuously until the entire document has been searched. * This is aborted if this {@link PdfViewing.Pdf.Content.TextSearchIterator } is closed. * @returns newly created promise for further asynchronous processing. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ loadAllMatches(): Promise; private loadAllMatchesCallback; /** * The last text that was found with this search. * Initial value is `null`, call {@link PdfViewing.Pdf.Content.TextSearchIterator.getNext } or {@link PdfViewing.Pdf.Content.TextSearchIterator.getPrevious } * to get the next matching textselection in the respective direction. * Property remains unchanged if call to {@link PdfViewing.Pdf.Content.TextSearchIterator.getNext } or {@link PdfViewing.Pdf.Content.TextSearchIterator.getPrevious } returns `false`. * Matches can occur on different kind of content, being represented as different subtypes of {@link PdfViewing.Pdf.Content.Selection }. * To get positional information aboutselected text cast to the respective type. e.g. {@link PdfViewing.Pdf.Content.TextSelection } for any results in flowing text. */ get match(): PdfViewing.Pdf.Content.Selection; /** * Index of the current match since start of textsearchIterator. * First Match has index 1. */ get matchIndex(): number; /** * Total known matches in document. * This number might not be correct if not all text is loaded. */ get totalMatches(): number; /** * Whether when reaching beginning or end of document (depending on search direction) * search should be continued at other end. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get wrapping(): boolean; /** * Whether when reaching beginning or end of document (depending on search direction) * search should be continued at other end. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ set wrapping(wrapping: boolean); } /** * * A rendered image of a page. * With high zoom only part of a page is rendered. */ class Image extends Internal.NativeObject { /** * Close the object * * Release all native resources associated with the object. */ close(): void; /** * * Removes image data from this image in order to reduce memory usage. * This operation invalidates {@link PdfViewing.Pdf.Content.Image.samples } and {@link PdfViewing.Pdf.Content.Image.bufferView }. * This functionality should only be used when image data has already been prepared in event `ImageCreated`. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ removeImageData(): void; /** * Indicates whether Image data has been removed using {@link PdfViewing.Pdf.Content.Image.removeImageData }. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get hasImageData(): boolean; /** * A unique identifier for this image. * Note that the method {@link PdfViewing.Pdf.View.getRenderedResults } * returns the same image with the same ID multiple times to conserve memory. * Whenever an image is added to the internal cache {@link PdfViewing.Pdf.ViewingPdfViewEventMap.imageCreated } is triggered * and when removed from the cache the same ID is returned in event {@link PdfViewing.Pdf.ViewingPdfViewEventMap.imageRemovedFromCache }. * An identifier is only unique in the context of the associated {@link PdfViewing.ViewerController }. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get id(): number; /** * Width of the image in pixels * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get width(): number; /** * Height of the image in pixels * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get height(): number; /** * Number of bytes used per pixel of the image * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get bytePerPixel(): number; /** * Raw byte array of the image. * This operation returns a copy of the internal buffer. * If image data has been removed using {@link PdfViewing.Pdf.Content.Image.removeImageData } this array will be empty. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get samples(): Uint8Array; /** * A buffer view of the raw byte array of the image. * This operation returns a direct view on the internal buffer. * If image data has been removed using {@link PdfViewing.Pdf.Content.Image.removeImageData } this array will be empty. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get bufferView(): Uint8Array | null; } /** * * An image that has a specific position on the viewport. */ class PlacedImage extends PdfViewing.Pdf.Content.Image { /** * Rectangle in relation to the page where the image should be rendered to. * Note, that the image might be in different resolution to the size of this rectangle. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get imageRectangle(): PdfViewing.Pdf.Geometry.Integer.Rectangle; } /** * * A text fragment describes part of the text on a page. * Usually one text fragment is one line of text, but this may vary. */ class TextFragment extends Internal.NativeObject { /** * Close the object * * Release all native resources associated with the object. */ close(): void; /** * A rectangle where on the page the text is * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get rectangleOnPage(): PdfViewing.Pdf.Geometry.Real.RectangleOnPage; /** * A more accurate description where the text is on the page * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get textArea(): PdfViewing.Pdf.Geometry.Real.QuadrilateralOnPage; /** * The content of the text * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get text(): string; /** * A list of offsets of the separate glyphs of the text. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get glyphOffsets(): number[]; } /** * * A selection of text. */ class Selection extends Internal.NativeObject { /** * Close the object * * Release all native resources associated with the object. */ close(): void; /** * Actual content of text * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get text(): string | null; } /** * * A selection of text in the pdf with an associated area on a page. */ class TextSelection extends PdfViewing.Pdf.Content.Selection { /** * Area of all selected text. Used for highlighting. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get textArea(): PdfViewing.Pdf.Geometry.Real.QuadrilateralList; } /** * * Buffer of binary data */ class BinaryBuffer extends Internal.NativeObject { /** * Close the object * * Release all native resources associated with the object. */ close(): void; /** * Copy of raw buffer * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get bufferData(): Uint8Array; /** * View on raw buffer * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get bufferView(): Uint8Array | null; } /** * * All information concerning a rendered page */ class RenderedPage extends Internal.NativeObject { /** * Close the object * * Release all native resources associated with the object. */ close(): void; /** * Describes where a page is located on the viewport. * Conventionally a viewer should render this area as a white rectangle. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get pageRect(): PdfViewing.Pdf.Geometry.Integer.Rectangle; /** * Describes a rendered image of this page. * Depending on the zoom level and resolution this image may not contain the entire page. * The image's location and size are relative to the top-left corner of {@link PdfViewing.Pdf.Content.RenderedPage.pageRect } * Returns `null` if the page has not yet been rendered. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get image(): PdfViewing.Pdf.Content.PlacedImage | null; /** * The pagenumber within the document of this page. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get pageNumber(): number; } /** * * A List of {@link PdfViewing.Pdf.Content.RenderedPage }s */ class RenderedPageList extends Internal.NativeObject implements List { /** * Close the object * * Release all native resources associated with the object. */ close(): void; remove(element: PdfViewing.Pdf.Content.RenderedPage): boolean; add(element: PdfViewing.Pdf.Content.RenderedPage): boolean; addRange(inputList: RenderedPageList): boolean; set(index: number, element: PdfViewing.Pdf.Content.RenderedPage): void; clear(): void; get(index: number): PdfViewing.Pdf.Content.RenderedPage; getRange(index: number, count: number): RenderedPageList; get size(): number; [Symbol.iterator](): Iterator; } /** * * Rendered results concerning the current view. */ class RenderResults extends Internal.NativeObject { /** * Close the object * * Release all native resources associated with the object. */ close(): void; /** * A list of all pages currently visible on the viewport. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get visiblePages(): PdfViewing.Pdf.Content.RenderedPageList; } } namespace Navigation { /** * * Setting how the viewport will be fitted to the visible content */ enum FitMode { /** * * Do not fit */ None = 0, /** * * Fit viewport to width of widest visible page */ FitWidth = 1, /** * * Fit viewport to be able to show largest visible page in its entirety */ FitPage = 2 } /** * * Setting how the pages will be arranged on the viewport */ enum PageLayoutMode { /** * * Display a single page at a time. */ SinglePage = 0, /** * * Display a Column of pages. */ OneColumn = 1, /** * * Display two columns of pages next to each other. The first page will be on the left. */ TwoColumnLeft = 2, /** * * Display two columns of pages next to each other. The first page will be on the right. */ TwoColumnRight = 3, /** * * Display two pages next to each other. The first page will be on the left */ TwoPageLeft = 4, /** * * Display two pages next to each other. The first page will be on the right */ TwoPageRight = 5 } /** * * A List of {@link PdfViewing.Pdf.Navigation.OutlineItem }s */ class OutlineItemList extends Internal.NativeObject implements List { /** * Close the object * * Release all native resources associated with the object. */ close(): void; remove(element: PdfViewing.Pdf.Navigation.OutlineItem): boolean; add(element: PdfViewing.Pdf.Navigation.OutlineItem): boolean; addRange(inputList: OutlineItemList): boolean; set(index: number, element: PdfViewing.Pdf.Navigation.OutlineItem): void; clear(): void; get(index: number): PdfViewing.Pdf.Navigation.OutlineItem; getRange(index: number, count: number): OutlineItemList; get size(): number; [Symbol.iterator](): Iterator; } /** * * A destination is a location in the document that * can be used as a jump target, * e.g. for outline items (bookmarks) or link annotations. */ class Destination extends Internal.NativeObject { /** * Close the object * * Release all native resources associated with the object. */ close(): void; /** * The target destination (Getter) * * For direct destinations, * this is just the destination itself. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get target(): PdfViewing.Pdf.Navigation.DirectDestination; } /** * * A named destination that can be referred by name. * Named destinations have two advantages compared to direct destinations: * - The name can be used in web links, * e.g. http://www.example.com/document.pdf#destinationname * - If the target destination of a named destination is changed, * all occurrences automatically point ot the new target. */ class NamedDestination extends PdfViewing.Pdf.Navigation.Destination { /** * The name by which the destination is referred to. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get name(): string; } /** * * * A destination that directly points to a specific location in the document. * * Note: Many PDF viewers support different viewing modes like "fit page" or * "fit width". * Most destination types will change the current viewing mode in those viewers. * * Changing the viewing mode is usually not very well received by users * and thus a {@link PdfViewing.Pdf.Navigation.LocationZoomDestination } should be preferred in most cases. */ class DirectDestination extends PdfViewing.Pdf.Navigation.Destination { /** * The page in the document that this destination is pointing to. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get pageNumber(): number; } /** * * A destination that points to a specific location on the target page, * using a specified zoom factor. * The location is displayed in the top left corner of the viewport (if possible). */ class LocationZoomDestination extends PdfViewing.Pdf.Navigation.DirectDestination { /** * * Create a new {@link PdfViewing.Pdf.Navigation.LocationZoomDestination } object. * @param pageNumber * The page in the document that this destination is pointing to. * @param left * * The location of the page that is displayed at the left border * of the viewport or `null`. * * See property {@link PdfViewing.Pdf.Navigation.LocationZoomDestination.left } for more information. * @param top * * The location of the page that is displayed at the top * of the viewport or `null`. * * See property {@link PdfViewing.Pdf.Navigation.LocationZoomDestination.top } for more information. * @param zoom * * The zoom factor that is applied when jumping to the destination * or `null`. * * See property {@link PdfViewing.Pdf.Navigation.LocationZoomDestination.zoom } for more information. */ constructor(pageNumber: number, left: number | null, top: number | null, zoom: number | null); /** * * The location of the page that is displayed at the left border of the viewport (if possible). * * If the property is `null`, the value from before the jump is retained. * * Note: Due to the current zoom factor, * it is usually not possible for viewers to scroll as far to the right side, * as would be necessary to place the location at the left corner of the viewport. * However, viewers will ensure, that the location is at least visible. * * In practice this means, that this value is mostly irrelevant. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get left(): number | null; /** * * The location of the page that is displayed at the top of the viewport (if possible). * * If the property is `null`, the value from before the jump is retained. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get top(): number | null; /** * * The zoom factor that is applied when jumping to the destination. * * A value of `null` means that the current zoom level is retained. * * Note: Many PDF viewers support different viewing modes like "fit page" or "fit width". * * A {@link PdfViewing.Pdf.Navigation.LocationZoomDestination } with a {@link PdfViewing.Pdf.Navigation.LocationZoomDestination.zoom } value of `null` * will usually not change the current viewing mode in most viewers. * * For other {@link PdfViewing.Pdf.Navigation.LocationZoomDestination.zoom } values however, * the viewer must switch to the standard mode, * i.e. deactivate special modes like "fit page" or "fit width". * * Because of this, * using a {@link PdfViewing.Pdf.Navigation.LocationZoomDestination.zoom } value other than `null` is discouraged. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get zoom(): number | null; } /** * * * A destination fits an entire page into the viewport. * * Note: Many PDF viewers support different viewing modes like "fit page" or * "fit width". * A {@link PdfViewing.Pdf.Navigation.FitPageDestination } will change the current viewing mode to * "fit page" in those viewers. * * Changing the viewing mode is usually not very well received by users * and thus a {@link PdfViewing.Pdf.Navigation.LocationZoomDestination } should be preferred in most cases. */ class FitPageDestination extends PdfViewing.Pdf.Navigation.DirectDestination { /** * * @param pageNumber * The page in the document that this destination is pointing to. * @param fitActualContent * * If `true`, the viewport is fitted to the actual content of the page, * instead of the size of the page. * * See property {@link PdfViewing.Pdf.Navigation.FitPageDestination.fitActualContent } for more information. */ constructor(pageNumber: number, fitActualContent: boolean); /** * * If `true`, the viewport is fitted to the actual content of the page, * instead of the size of the page. * * Note: Many PDF viewers simply ignore this property and always treat it * as `false`, i.e. switching to "fit page" mode anyway. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get fitActualContent(): boolean; } /** * * * A destination fits the width of a page into the viewport. * * Note: Many PDF viewers support different viewing modes like "fit page" or * "fit width". * A {@link PdfViewing.Pdf.Navigation.FitWidthDestination } will change the current viewing mode to * "fit width" in those viewers. * * Changing the viewing mode is usually not very well received by users * and thus a {@link PdfViewing.Pdf.Navigation.LocationZoomDestination } should be preferred in most cases. */ class FitWidthDestination extends PdfViewing.Pdf.Navigation.DirectDestination { /** * * @param pageNumber * The page in the document that this destination is pointing to. * @param top * * The location of the page that is displayed at the top of the viewport (if possible). * * Set `null` to use top edge of the page. * @param fitActualContent * * If `true`, the viewport is fitted to the actual content of the page, * instead of the size of the page. * * See property {@link PdfViewing.Pdf.Navigation.FitWidthDestination.fitActualContent } for more information. */ constructor(pageNumber: number, top: number | null, fitActualContent: boolean); /** * * If `true`, the viewport is fitted to the width of the actual content of the page, * instead of the width of the page. * * Note: Many PDF viewers simply ignore this property and always treat it * as `false`, i.e. switching to "fit page" mode anyway. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get fitActualContent(): boolean; /** * * The location of the page that is displayed at the top of the viewport (if possible). * * If the property is `null`, then the top of the page will be used. * * This value is ignored by viewers if the view is rotated. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get top(): number | null; } /** * * * A destination fits the height of a page into the viewport. * * Note: Many PDF viewers support different viewing modes like "fit page" or * "fit width". * A {@link PdfViewing.Pdf.Navigation.FitHeightDestination } will change the current viewing mode to * "fit height" in those viewers. * * Changing the viewing mode is usually not very well received by users * and thus a {@link PdfViewing.Pdf.Navigation.LocationZoomDestination } should be preferred in most cases. */ class FitHeightDestination extends PdfViewing.Pdf.Navigation.DirectDestination { /** * * @param pageNumber * The page in the document that this destination is pointing to. * @param left * * The location of the page that is displayed at the left edge of the viewport (if possible). * * Set `null` to use left edge of the page. * @param fitActualContent * * If `true`, the viewport is fitted to the actual content of the page, * instead of the size of the page. * * See property {@link PdfViewing.Pdf.Navigation.FitHeightDestination.fitActualContent } for more information. */ constructor(pageNumber: number, left: number | null, fitActualContent: boolean); /** * * If `true`, the viewport is fitted to the width of the actual content of the page, * instead of the width of the page. * * Note: Many PDF viewers simply ignore this property and always treat it * as `false`, i.e. switching to "fit page" mode anyway. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get fitActualContent(): boolean; /** * * The location of the page that is displayed as the left edge of the viewport (if possible). * * If the property is `null`, then the left edge of the page will be used. * * This value is ignored by viewers if the view is rotated. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get left(): number | null; } /** * * * A destination that fits a specified area of a page into the viewport. * * Note: Many PDF viewers support different viewing modes like "fit page" or * "fit width". * A {@link PdfViewing.Pdf.Navigation.FitRectangleDestination } will change the current viewing mode to * standard mode in those viewers, * i.e. deactivate any special mode like "fit page" or "fit width". * * Changing the viewing mode is usually not very well received by users * and thus a {@link PdfViewing.Pdf.Navigation.LocationZoomDestination } should be preferred in most cases. */ class FitRectangleDestination extends PdfViewing.Pdf.Navigation.DirectDestination { /** * * @param rectangleOnPage * The rectangle that is displayed in the viewport. */ constructor(rectangleOnPage: PdfViewing.Pdf.Geometry.Real.RectangleOnPage); /** * The rectangle that is displayed in the viewport. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get rectangle(): PdfViewing.Pdf.Geometry.Real.RectangleOnPage; } /** * * An outline item represents an entry in the outline tree of the document. * It is also known as "Bookmark". */ class OutlineItem extends Internal.NativeObject { /** * Close the object * * Release all native resources associated with the object. */ close(): void; /** * The title of the outline item. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get title(): string; /** * If `true`, the outline item is displayed in bold font. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get bold(): boolean; /** * If `true`, the outline item is displayed in italic font. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get italic(): boolean; /** * The destination of the outline item. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get destination(): PdfViewing.Pdf.Navigation.Destination | null; /** * - If `true`, the item is expanded. * - If `false`, the item is collapsed. * This is property is only meaningful if the item has child items. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get isOpen(): boolean; /** * If `true`, this outline item has further children outline items. * * @throws {@link PdfViewing.InvalidOperationError} if the object has already been closed */ get hasChildren(): boolean; } } } /** * A generic error occurred. * */ export class GenericError extends PdfViewingError { constructor(message?: string); } /** * A fatal error occurred. * */ export class FatalError extends PdfViewingError { constructor(message?: string); } /** * The license is not valid. * */ export class LicenseError extends PdfViewingError { constructor(message?: string); } /** * The format is not known. * */ export class UnknownFormatError extends PdfViewingError { constructor(message?: string); } /** * The file is corrupt and cannot be opened. * */ export class CorruptError extends PdfViewingError { constructor(message?: string); } /** * Invalid password specified. * */ export class PasswordError extends PdfViewingError { constructor(message?: string); } /** * The document has an invalid conformance level. * */ export class ConformanceError extends PdfViewingError { constructor(message?: string); } /** * The document contains an unsupported feature. * */ export class UnsupportedFeatureError extends PdfViewingError { constructor(message?: string); } /** * Infrastructure error occurred. * */ export class InfrastructureError extends PdfViewingError { constructor(message?: string); } /** * The file cannot be processed. * */ export class ProcessingError extends PdfViewingError { constructor(message?: string); } /** * The specified item already exists. * */ export class ExistsError extends PdfViewingError { constructor(message?: string); } /** * The update failed. * */ export class UpdateFailedError extends PdfViewingError { constructor(message?: string); } /** * */ export class NotSupportedError extends PdfViewingError { constructor(message?: string); } /** * */ export class InvalidOperationError extends PdfViewingError { constructor(message?: string); } /** * */ export class ArgumentError extends PdfViewingError { constructor(message?: string); } /** * */ export class NotFoundError extends PdfViewingError { constructor(message?: string); } /** * */ export class IOError extends PdfViewingError { constructor(message?: string); } export namespace Sys { class StreamObject { /** * @returns Underlying Uint8Array. */ get parameter(): any; /** * @param value Allowed types are Uint8Array and Blob. */ set parameter(value: any); } } interface List extends Iterable { remove(element: T): boolean; add(element: T): boolean; addRange(inputList: List): boolean; set(index: number, element: T): void; clear(): void; get(index: number): T; getRange(startIndex: number, endIndex: number): List; readonly size: number; } export {}; }