UNPKG

@compdfkit_pdf_sdk/react_native

Version:

ComPDFKit for React Native is a comprehensive SDK that allows you to quickly add PDF functionality to Android, iOS, and React Native applications.

490 lines 12.9 kB
"use strict"; /** * Copyright © 2014-2026 PDF Technologies, Inc. All Rights Reserved. * * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT. * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES. * This notice may not be removed from this file. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.CPDFEvent = exports.CPDFStampType = exports.CPDFStandardStamp = exports.CPDFEditType = exports.CPDFPageCompression = exports.CPDFBotaTabs = exports.CPDFUiVisibilityMode = exports.CPDFSignatureType = exports.CPDFActionType = exports.CPDFBorderEffectType = exports.CPDFDocumentEncryptAlgo = exports.CPDFDocumentPermissions = exports.CPDFThemeMode = exports.CPDFThemes = exports.CPDFDisplayMode = exports.CPDFCheckStyle = exports.CPDFWidgetType = exports.CPDFContentEditorType = exports.CPDFAlignment = exports.CPDFLineType = exports.CPDFBorderStyle = exports.CPDFConfigTool = exports.CPDFAnnotationType = exports.CPDFToolbarAction = exports.CPDFViewMode = void 0; exports.CPDFViewMode = { /** * Viewer mode, allows viewing PDF only, cannot edit annotations, forms, etc. */ VIEWER: 'viewer', /** * Annotations mode, allows annotation editing */ ANNOTATIONS: 'annotations', /** * Content editor mode, allows editing text, images of PDF document */ CONTENT_EDITOR: 'contentEditor', /** * Forms mode, allows adding text fields, signature fields, list boxes, etc. */ FORMS: 'forms', /** * Signatures mode, allows adding signature fields for electronic signing, digital signing, verifying digital signatures */ SIGNATURES: 'signatures' }; /** * Toolbar actions supported in the displayed PDF view */ exports.CPDFToolbarAction = { /** * Back button. * * Exits the current PDF view when clicked. * - On Android: always displayed at the far left of the toolbar. * - On iOS: displayed based on the configured toolbar position. */ BACK: 'back', /** * Thumbnail list. * * Displays page thumbnails of the current document. */ THUMBNAIL: 'thumbnail', /** * Text search. * * Provides keyword search functionality within the PDF document. */ SEARCH: 'search', /** * BOTA panel. * * Displays related document navigation content: * - b: Bookmarks * - o: Outline * - t: Thumbnails * - a: Annotations */ BOTA: 'bota', /** * Menu button. * * Opens the main toolbar menu. */ MENU: 'menu', /** * View settings. * * Controls display-related options such as zoom mode, * page layout, and reading preferences. */ VIEW_SETTINGS: 'viewSettings', /** * Document editor. * * Opens document editing features such as content editing * or annotation editing. */ DOCUMENT_EDITOR: 'documentEditor', /** * Security settings. * * Opens security-related options such as password protection * and permission settings. */ SECURITY: 'security', /** * Watermark management. * * Used to add, edit, or remove watermarks in the document. */ WATERMARK: 'watermark', /** * Document information. * * Displays metadata and basic information of the PDF document. */ DOCUMENT_INFO: 'documentInfo', /** * Save document. * * Saves changes made to the current document. */ SAVE: 'save', /** * Share document. * * Opens the system share dialog to export or share the document. */ SHARE: 'share', /** * Open document. * * Opens another PDF document. */ OPEN_DOCUMENT: 'openDocument', /** * Flatten annotations. * * Merges annotations into the document content so they * can no longer be edited. */ FLATTENED: 'flattened', /** * Snip tool. * * Allows capturing a selected area of the document. */ SNIP: 'snip', /** * Custom toolbar action. * * Represents a user-defined toolbar action. */ CUSTOM: 'custom', }; /** * annotations type. * Please note that {@link PENCIL} is only available on ios platform. */ exports.CPDFAnnotationType = { UNKNOWN: 'unknown', NOTE: 'note', HIGHLIGHT: 'highlight', UNDERLINE: 'underline', SQUIGGLY: 'squiggly', STRIKEOUT: 'strikeout', INK: 'ink', INK_ERASER: 'ink_eraser', /** * only ios platform. */ PENCIL: "pencil", CIRCLE: 'circle', SQUARE: 'square', ARROW: 'arrow', LINE: 'line', FREETEXT: 'freetext', SIGNATURE: 'signature', STAMP: 'stamp', PICTURES: 'pictures', LINK: 'link', SOUND: 'sound' }; /** * {@link CPDFViewMode.ANNOTATIONS}, {@link CPDFViewMode.CONTENT_EDITOR},{@link CPDFViewMode.FORMS} function tools. * {@link CPDFConfigTool.SETTING} is not available in form functionality. * */ exports.CPDFConfigTool = { /** * Set button, corresponding to open the selected annotation, text or picture property panel. */ SETTING: 'setting', /** * Undo annotation, content editing, form operations */ UNDO: 'undo', /** * Redo an undone action */ REDO: 'redo' }; /** * Shape annotation border style, default {@link CPDFBorderStyle.SOLID}. * shape: * * {@link CPDFAnnotationType.SQUARE} * * {@link CPDFAnnotationType.CIRCLE} * * {@link CPDFAnnotationType.ARROW} * * {@link CPDFAnnotationType.LINE} */ exports.CPDFBorderStyle = { SOLID: 'solid', DASHED: 'dashed' }; /** * Arrow annotation, start and tail shapes */ exports.CPDFLineType = { NONE: 'none', UNKNOWN: 'unknown', OPEN_ARROW: 'openArrow', CLOSE_ARROW: 'closedArrow', SQUARE: 'square', CIRCLE: 'circle', DIAMOND: 'diamond' }; /** * text alignment */ exports.CPDFAlignment = { LEFT: 'left', CENTER: 'center', RIGHT: 'right' }; exports.CPDFContentEditorType = { EDITOR_TEXT: 'editorText', EDITOR_IMAGE: 'editorImage' }; /** * form types */ exports.CPDFWidgetType = { TEXT_FIELD: 'textField', CHECKBOX: 'checkBox', RADIO_BUTTON: 'radioButton', LISTBOX: 'listBox', COMBOBOX: 'comboBox', SIGNATURES_FIELDS: 'signaturesFields', PUSH_BUTTON: 'pushButton', UNKNOWN: 'unknown' }; exports.CPDFCheckStyle = { CHECK: 'check', CIRCLE: 'circle', CROSS: 'cross', DIAMOND: 'diamond', SQUARE: 'square', STAR: 'star' }; exports.CPDFDisplayMode = { SINGLE_PAGE: 'singlePage', DOUBLE_PAGE: 'doublePage', COVER_PAGE: 'coverPage' }; exports.CPDFThemes = { /** * Bright mode, readerview background is white */ LIGHT: 'light', /** * dark mode, readerview background is black */ DARK: 'dark', /** * brown paper color */ SEPIA: 'sepia', /** * Light green, eye protection mode */ RESEDA: 'reseda' }; /** * Set UI theme modes, including light, dark, and follow system modes * Default: Follow system */ exports.CPDFThemeMode = { /** * Light mode, with a primarily white UI */ LIGHT: 'light', /** * Dark night mode, with a primarily black UI */ DARK: 'dark', /** * Follow the current system setting */ SYSTEM: 'system' }; /** * Represents the permissions available for the currently opened document. */ exports.CPDFDocumentPermissions = { /** * No restrictions. The document does not have an open password or owner permission password. */ NONE: 'none', /** * User permissions. The document can only be viewed and has an owner password set. */ USER: 'user', /** * Owner permissions. The current viewer is identified as the owner of the document. */ OWNER: 'owner', }; /** * Specifies the encryption algorithms supported for a PDF document. */ exports.CPDFDocumentEncryptAlgo = { /** * RC4 encryption algorithm. */ RC4: 'rc4', /** * AES 128-bit encryption algorithm. */ AES128: 'aes128', /** * AES 256-bit encryption algorithm. */ AES256: 'aes256', /** * Indicates that no encryption algorithm is applied. */ NO_ENCRYPT_ALGO: 'noEncryptAlgo', }; exports.CPDFBorderEffectType = { SOLID: 'solid', CLOUDY: 'cloudy', }; exports.CPDFActionType = { UNKNOWN: 'unknown', GOTO: 'goTo', GOTOR: 'goToR', GOTOE: 'goToE', LAUNCH: 'launch', THREAD: 'thread', URI: 'uri', SOUND: 'sound', MOVIE: 'movie', HIDE: 'hide', NAMED: 'named', SUBMIT_FORM: 'submitForm', RESET_FORM: 'resetForm', IMPORT_DATA: 'importData', JAVASCRIPT: 'javaScript', SET_OCG_STATE: 'setOCGState', RENDITION: 'rendition', TRANS: 'trans', GOTO_3D_VIEW: 'goTo3DView', UOP: 'uop', ERROR: 'error', }; /** * Used to configure the default signing method when signing in the form field of CPDFReaderView, * including: digital signature, electronic signature, and manual selection */ exports.CPDFSignatureType = { /** * Manually select the signature method. * Configure this method. When you click the signature form field, * a pop-up window will pop up to select the signature method. */ MANUAL: 'manual', /** * Enter the digital signature process */ DIGITAL: 'digital', /** * Enter the electronic signature process */ ELECTRONIC: 'electronic', }; exports.CPDFUiVisibilityMode = { /** * Always show UI */ ALWAYS: 'always', /** * Auto hide UI, tap to show */ AUTOMATIC: 'automatic', /** * Always hide UI, use gestures to show */ NEVER: 'never' }; exports.CPDFBotaTabs = { BOOKMARKS: 'bookmark', OUTLINE: 'outline', ANNOTATIONS: 'annotations' }; exports.CPDFPageCompression = { JPEG: 'jpeg', PNG: 'png', }; exports.CPDFEditType = { NONE: 0, TEXT: 1, IMAGE: 2, PATH: 4 }; exports.CPDFStandardStamp = { NOTAPPROVED: 'NotApproved', APPROVED: 'Approved', COMPLETED: 'Completed', FINAL_: 'Final', DRAFT: 'Draft', CONFIDENTIAL: 'Confidential', NOTFORPUBLICRELEASE: 'NotForPublicRelease', FORPUBLICRELEASE: 'ForPublicRelease', FORCOMMENT: 'ForComment', VOID_: 'Void', PRELIMINARYRESULTS: 'PreliminaryResults', INFORMATIONONLY: 'InformationOnly', ACCEPTED: 'Accepted', REJECTED: 'Rejected', WITNESS: 'Witness', INITIALHERE: 'InitialHere', SIGNHERE: 'SignHere', REVISED: 'Revised', PRIVATEACCEPTED: 'PrivateMark#1', PRIVATEREJECTED: 'PrivateMark#2', PRIVATERADIOMARK: 'PrivateMark#3', UNKNOWN: 'Unknown', }; exports.CPDFStampType = { UNKNOWN: 'unknown', STANDARD: 'standard', TEXT: 'text', IMAGE: 'image', }; exports.CPDFEvent = { /** * Fired when an annotation is created. * Data type: CPDFAnnotation and its subclasses. */ ANNOTATIONS_CREATED: 'annotationsCreated', /** * Fired when a pencil drawing is saved. * Data type: { type: 'pencil'; pageIndex: number }. */ PENCIL_DRAWING_COMPLETED: 'pencilDrawingCompleted', /** * Fired when a pencil drawing is discarded. * Data type: { type: 'pencil'; pageIndex: number }. */ PENCIL_DRAWING_DISCARDED: 'pencilDrawingDiscarded', /** * Fired when an annotation is selected. * Data type: CPDFAnnotation and its subclasses. */ ANNOTATIONS_SELECTED: 'annotationsSelected', /** * Fired when an annotation is deselected. * Data type: CPDFAnnotation and its subclasses. * Data may be null. */ ANNOTATIONS_DESELECTED: 'annotationsDeselected', /** * Fired when a form field is created. * Data type: CPDFWidget and its subclasses. */ FORM_FIELDS_CREATED: 'formFieldsCreated', /** * Fired when a form field is selected. * Data type: CPDFWidget and its subclasses. */ FORM_FIELDS_SELECTED: 'formFieldsSelected', /** * Fired when a form field is deselected. * Data type: CPDFWidget and its subclasses. * Data may be null. */ FORM_FIELDS_DESELECTED: 'formFieldsDeselected', /** * Fired when a content editor element is selected. * Data type: CPDFEditArea and its subclasses. * image: CPDFEditImageArea * text: CPDFEditTextArea */ EDITOR_SELECTION_SELECTED: 'editorSelectionSelected', /** * Fired when a content editor element is deselected. * No data returned. */ EDITOR_SELECTION_DESELECTED: 'editorSelectionDeselected', }; //# sourceMappingURL=CPDFOptions.js.map