@pdftools/four-heights-pdf-web-viewer 4.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +446 -0
- package/README.md +145 -0
- package/css/pdf-web-viewer.css +2407 -0
- package/doc/PdfWebViewer.pdf +0 -0
- package/es6/common/Checkbox.d.ts +9 -0
- package/es6/common/Checkbox.js +8 -0
- package/es6/common/Color.d.ts +23 -0
- package/es6/common/Color.js +118 -0
- package/es6/common/ColorPicker.d.ts +15 -0
- package/es6/common/ColorPicker.js +46 -0
- package/es6/common/Contextbar.d.ts +6 -0
- package/es6/common/Contextbar.js +19 -0
- package/es6/common/DragMoveHandler.d.ts +51 -0
- package/es6/common/DragMoveHandler.js +175 -0
- package/es6/common/Dropdown.d.ts +36 -0
- package/es6/common/Dropdown.js +76 -0
- package/es6/common/DropdownMenu.d.ts +9 -0
- package/es6/common/DropdownMenu.js +10 -0
- package/es6/common/DropdownSeparator.d.ts +3 -0
- package/es6/common/DropdownSeparator.js +6 -0
- package/es6/common/Icon.d.ts +13 -0
- package/es6/common/Icon.js +8 -0
- package/es6/common/Loader.d.ts +3 -0
- package/es6/common/Loader.js +6 -0
- package/es6/common/RangeSlider.d.ts +17 -0
- package/es6/common/RangeSlider.js +42 -0
- package/es6/common/StrokeStylePicker.d.ts +11 -0
- package/es6/common/StrokeStylePicker.js +20 -0
- package/es6/common/StrokeWidthPicker.d.ts +11 -0
- package/es6/common/StrokeWidthPicker.js +20 -0
- package/es6/common/Toolbar.d.ts +10 -0
- package/es6/common/Toolbar.js +6 -0
- package/es6/common/ToolbarButton.d.ts +14 -0
- package/es6/common/ToolbarButton.js +21 -0
- package/es6/common/ToolbarFileButton.d.ts +15 -0
- package/es6/common/ToolbarFileButton.js +27 -0
- package/es6/common/ToolbarItemGroup.d.ts +8 -0
- package/es6/common/ToolbarItemGroup.js +12 -0
- package/es6/common/ToolbarSeparator.d.ts +3 -0
- package/es6/common/ToolbarSeparator.js +6 -0
- package/es6/common/Tools.d.ts +10 -0
- package/es6/common/Tools.js +89 -0
- package/es6/common/TooltipManager.d.ts +12 -0
- package/es6/common/TooltipManager.js +54 -0
- package/es6/common/TranslationManager.d.ts +11 -0
- package/es6/common/TranslationManager.js +61 -0
- package/es6/common/classNames.d.ts +2 -0
- package/es6/common/classNames.js +18 -0
- package/es6/common/formatDate.d.ts +1 -0
- package/es6/common/formatDate.js +1 -0
- package/es6/common/icons.d.ts +13 -0
- package/es6/common/icons.js +412 -0
- package/es6/common/utils.d.ts +2 -0
- package/es6/common/utils.js +19 -0
- package/es6/custom/history.d.ts +2 -0
- package/es6/custom/history.js +59 -0
- package/es6/index.d.ts +5 -0
- package/es6/index.js +5 -0
- package/es6/lib/hyperapp/index.d.ts +108 -0
- package/es6/lib/hyperapp/index.js +327 -0
- package/es6/modules/CanvasLayer.d.ts +32 -0
- package/es6/modules/CanvasLayer.js +83 -0
- package/es6/modules/CanvasModule.d.ts +59 -0
- package/es6/modules/CanvasModule.js +98 -0
- package/es6/modules/eraser/EraserLayer.d.ts +13 -0
- package/es6/modules/eraser/EraserLayer.js +141 -0
- package/es6/modules/eraser/EraserModule.d.ts +19 -0
- package/es6/modules/eraser/EraserModule.js +34 -0
- package/es6/modules/eraser/EraserToolbar.d.ts +10 -0
- package/es6/modules/eraser/EraserToolbar.js +30 -0
- package/es6/modules/form-fields/CheckBoxWidget.d.ts +9 -0
- package/es6/modules/form-fields/CheckBoxWidget.js +45 -0
- package/es6/modules/form-fields/ComboBoxWidget.d.ts +22 -0
- package/es6/modules/form-fields/ComboBoxWidget.js +152 -0
- package/es6/modules/form-fields/EditFormFieldLayer.d.ts +17 -0
- package/es6/modules/form-fields/EditFormFieldLayer.js +238 -0
- package/es6/modules/form-fields/FormFieldModule.d.ts +15 -0
- package/es6/modules/form-fields/FormFieldModule.js +27 -0
- package/es6/modules/form-fields/ListBoxWidget.d.ts +9 -0
- package/es6/modules/form-fields/ListBoxWidget.js +73 -0
- package/es6/modules/form-fields/RadioButtonWidget.d.ts +9 -0
- package/es6/modules/form-fields/RadioButtonWidget.js +45 -0
- package/es6/modules/form-fields/SelectListWidget.d.ts +9 -0
- package/es6/modules/form-fields/SelectListWidget.js +45 -0
- package/es6/modules/form-fields/TextBoxWidget.d.ts +9 -0
- package/es6/modules/form-fields/TextBoxWidget.js +53 -0
- package/es6/modules/form-fields/WidgetBase.d.ts +23 -0
- package/es6/modules/form-fields/WidgetBase.js +29 -0
- package/es6/modules/freetext-annotation/AddFreetextAnnotationLayer.d.ts +19 -0
- package/es6/modules/freetext-annotation/AddFreetextAnnotationLayer.js +181 -0
- package/es6/modules/freetext-annotation/AddFreetextAnnotationToolbar.d.ts +21 -0
- package/es6/modules/freetext-annotation/AddFreetextAnnotationToolbar.js +37 -0
- package/es6/modules/freetext-annotation/EditFreetextAnnotationLayer.d.ts +20 -0
- package/es6/modules/freetext-annotation/EditFreetextAnnotationLayer.js +211 -0
- package/es6/modules/freetext-annotation/EditFreetextAnnotationToolbar.d.ts +50 -0
- package/es6/modules/freetext-annotation/EditFreetextAnnotationToolbar.js +118 -0
- package/es6/modules/freetext-annotation/FreetextAnnotationModule.d.ts +28 -0
- package/es6/modules/freetext-annotation/FreetextAnnotationModule.js +58 -0
- package/es6/modules/freetext-annotation/RichTextEditor.d.ts +31 -0
- package/es6/modules/freetext-annotation/RichTextEditor.js +223 -0
- package/es6/modules/highlight-annotation/AddHighlightAnnotationLayer.d.ts +31 -0
- package/es6/modules/highlight-annotation/AddHighlightAnnotationLayer.js +289 -0
- package/es6/modules/highlight-annotation/AddHighlightAnnotationToolbar.d.ts +20 -0
- package/es6/modules/highlight-annotation/AddHighlightAnnotationToolbar.js +52 -0
- package/es6/modules/highlight-annotation/EditHighlightAnnotationLayer.d.ts +15 -0
- package/es6/modules/highlight-annotation/EditHighlightAnnotationLayer.js +104 -0
- package/es6/modules/highlight-annotation/EditHighlightAnnotationToolbar.d.ts +15 -0
- package/es6/modules/highlight-annotation/EditHighlightAnnotationToolbar.js +28 -0
- package/es6/modules/highlight-annotation/HighlightAnnotationModule.d.ts +27 -0
- package/es6/modules/highlight-annotation/HighlightAnnotationModule.js +54 -0
- package/es6/modules/image-annotations/ImageAnnotationModule.d.ts +23 -0
- package/es6/modules/image-annotations/ImageAnnotationModule.js +169 -0
- package/es6/modules/index.d.ts +13 -0
- package/es6/modules/index.js +13 -0
- package/es6/modules/ink-annotation/AddInkAnnotationLayer.d.ts +40 -0
- package/es6/modules/ink-annotation/AddInkAnnotationLayer.js +503 -0
- package/es6/modules/ink-annotation/AddInkAnnotationToolbar.d.ts +30 -0
- package/es6/modules/ink-annotation/AddInkAnnotationToolbar.js +53 -0
- package/es6/modules/ink-annotation/EditInkAnnotationLayer.d.ts +20 -0
- package/es6/modules/ink-annotation/EditInkAnnotationLayer.js +137 -0
- package/es6/modules/ink-annotation/EditInkAnnotationToolbar.d.ts +25 -0
- package/es6/modules/ink-annotation/EditInkAnnotationToolbar.js +47 -0
- package/es6/modules/ink-annotation/InkAnnotationModule.d.ts +27 -0
- package/es6/modules/ink-annotation/InkAnnotationModule.js +50 -0
- package/es6/modules/popup/Popup.d.ts +64 -0
- package/es6/modules/popup/Popup.js +360 -0
- package/es6/modules/popup/PopupLayer.d.ts +31 -0
- package/es6/modules/popup/PopupLayer.js +509 -0
- package/es6/modules/popup/PopupModule.d.ts +16 -0
- package/es6/modules/popup/PopupModule.js +25 -0
- package/es6/modules/print-service/PrintServiceDialog.d.ts +30 -0
- package/es6/modules/print-service/PrintServiceDialog.js +134 -0
- package/es6/modules/print-service/PrintServiceLayer.d.ts +24 -0
- package/es6/modules/print-service/PrintServiceLayer.js +310 -0
- package/es6/modules/print-service/PrintServiceModule.d.ts +18 -0
- package/es6/modules/print-service/PrintServiceModule.js +30 -0
- package/es6/modules/shape-annotations/AddShapeAnnotationLayer.d.ts +24 -0
- package/es6/modules/shape-annotations/AddShapeAnnotationLayer.js +210 -0
- package/es6/modules/shape-annotations/AddShapeAnnotationToolbar.d.ts +26 -0
- package/es6/modules/shape-annotations/AddShapeAnnotationToolbar.js +69 -0
- package/es6/modules/shape-annotations/EditShapeAnnotationLayer.d.ts +19 -0
- package/es6/modules/shape-annotations/EditShapeAnnotationLayer.js +148 -0
- package/es6/modules/shape-annotations/EditShapeAnnotationToolbar.d.ts +24 -0
- package/es6/modules/shape-annotations/EditShapeAnnotationToolbar.js +57 -0
- package/es6/modules/shape-annotations/ShapeAnnotationModule.d.ts +28 -0
- package/es6/modules/shape-annotations/ShapeAnnotationModule.js +50 -0
- package/es6/modules/stamp-annotation/AddStampAnnotationLayer.d.ts +19 -0
- package/es6/modules/stamp-annotation/AddStampAnnotationLayer.js +257 -0
- package/es6/modules/stamp-annotation/AddStampAnnotationToolbar.d.ts +17 -0
- package/es6/modules/stamp-annotation/AddStampAnnotationToolbar.js +68 -0
- package/es6/modules/stamp-annotation/StampAnnotationModule.d.ts +20 -0
- package/es6/modules/stamp-annotation/StampAnnotationModule.js +35 -0
- package/es6/modules/text-annotation/AddTextAnnotationLayer.d.ts +14 -0
- package/es6/modules/text-annotation/AddTextAnnotationLayer.js +132 -0
- package/es6/modules/text-annotation/AddTextAnnotationToolbar.d.ts +15 -0
- package/es6/modules/text-annotation/AddTextAnnotationToolbar.js +27 -0
- package/es6/modules/text-annotation/TextAnnotationModule.d.ts +19 -0
- package/es6/modules/text-annotation/TextAnnotationModule.js +34 -0
- package/es6/pdf-viewer-api/ImageContainer.d.ts +10 -0
- package/es6/pdf-viewer-api/ImageContainer.js +43 -0
- package/es6/pdf-viewer-api/PdfViewerApi.d.ts +463 -0
- package/es6/pdf-viewer-api/PdfViewerApi.js +732 -0
- package/es6/pdf-viewer-api/PdfViewingWrapper.d.ts +178 -0
- package/es6/pdf-viewer-api/PdfViewingWrapper.js +2037 -0
- package/es6/pdf-viewer-api/annotationDefaultBehaviors.d.ts +3 -0
- package/es6/pdf-viewer-api/annotationDefaultBehaviors.js +30 -0
- package/es6/pdf-viewer-api/enums.d.ts +100 -0
- package/es6/pdf-viewer-api/enums.js +113 -0
- package/es6/pdf-viewer-api/index.d.ts +3 -0
- package/es6/pdf-viewer-api/index.js +3 -0
- package/es6/pdf-viewer-api/types.d.ts +284 -0
- package/es6/pdf-viewer-api/types.js +6 -0
- package/es6/pdf-viewer-canvas/CanvasEvents.d.ts +76 -0
- package/es6/pdf-viewer-canvas/CanvasEvents.js +345 -0
- package/es6/pdf-viewer-canvas/PdfViewerCanvas.d.ts +175 -0
- package/es6/pdf-viewer-canvas/PdfViewerCanvas.js +1226 -0
- package/es6/pdf-viewer-canvas/state/annotations.d.ts +36 -0
- package/es6/pdf-viewer-canvas/state/annotations.js +157 -0
- package/es6/pdf-viewer-canvas/state/appState.d.ts +10 -0
- package/es6/pdf-viewer-canvas/state/appState.js +60 -0
- package/es6/pdf-viewer-canvas/state/canvas.d.ts +31 -0
- package/es6/pdf-viewer-canvas/state/canvas.js +41 -0
- package/es6/pdf-viewer-canvas/state/document.d.ts +50 -0
- package/es6/pdf-viewer-canvas/state/document.js +99 -0
- package/es6/pdf-viewer-canvas/state/pointer.d.ts +31 -0
- package/es6/pdf-viewer-canvas/state/pointer.js +31 -0
- package/es6/pdf-viewer-canvas/state/scroll.d.ts +22 -0
- package/es6/pdf-viewer-canvas/state/scroll.js +25 -0
- package/es6/pdf-viewer-canvas/state/search.d.ts +36 -0
- package/es6/pdf-viewer-canvas/state/search.js +27 -0
- package/es6/pdf-viewer-canvas/state/store.d.ts +39 -0
- package/es6/pdf-viewer-canvas/state/store.js +52 -0
- package/es6/pdf-viewer-canvas/state/viewer.d.ts +91 -0
- package/es6/pdf-viewer-canvas/state/viewer.js +175 -0
- package/es6/pdf-viewer-canvas/view-layers/AnnotationSelectionLayer.d.ts +28 -0
- package/es6/pdf-viewer-canvas/view-layers/AnnotationSelectionLayer.js +452 -0
- package/es6/pdf-viewer-canvas/view-layers/BusyStateLayer.d.ts +9 -0
- package/es6/pdf-viewer-canvas/view-layers/BusyStateLayer.js +25 -0
- package/es6/pdf-viewer-canvas/view-layers/PdfDocumentLayer.d.ts +10 -0
- package/es6/pdf-viewer-canvas/view-layers/PdfDocumentLayer.js +149 -0
- package/es6/pdf-viewer-canvas/view-layers/ScrollLayer.d.ts +48 -0
- package/es6/pdf-viewer-canvas/view-layers/ScrollLayer.js +308 -0
- package/es6/pdf-viewer-canvas/view-layers/TextSelectionLayer.d.ts +19 -0
- package/es6/pdf-viewer-canvas/view-layers/TextSelectionLayer.js +289 -0
- package/es6/pdf-viewer-canvas/view-layers/ViewLayerBase.d.ts +31 -0
- package/es6/pdf-viewer-canvas/view-layers/ViewLayerBase.js +106 -0
- package/es6/pdf-viewer-canvas/view-layers/canvasShapes.d.ts +11 -0
- package/es6/pdf-viewer-canvas/view-layers/canvasShapes.js +149 -0
- package/es6/pdf-viewer-canvas/view-layers/canvasUtlis.d.ts +3 -0
- package/es6/pdf-viewer-canvas/view-layers/canvasUtlis.js +10 -0
- package/es6/pdf-viewer-canvas/view-layers/views/AnnotationBorder.d.ts +52 -0
- package/es6/pdf-viewer-canvas/view-layers/views/AnnotationBorder.js +377 -0
- package/es6/pdf-viewer-canvas/view-layers/views/AnnotationContextBar.d.ts +47 -0
- package/es6/pdf-viewer-canvas/view-layers/views/AnnotationContextBar.js +102 -0
- package/es6/pdf-viewer-canvas/view-layers/views/TextSelectionContextBar.d.ts +14 -0
- package/es6/pdf-viewer-canvas/view-layers/views/TextSelectionContextBar.js +36 -0
- package/es6/pdf-viewing/PdfViewing.d.ts +4865 -0
- package/es6/pdf-viewing/PdfViewing.js +9611 -0
- package/es6/pdf-web-viewer/PdfWebViewer.d.ts +372 -0
- package/es6/pdf-web-viewer/PdfWebViewer.js +1386 -0
- package/es6/pdf-web-viewer/UserSettings.d.ts +8 -0
- package/es6/pdf-web-viewer/UserSettings.js +40 -0
- package/es6/pdf-web-viewer/WebViewerOptions.d.ts +387 -0
- package/es6/pdf-web-viewer/WebViewerOptions.js +582 -0
- package/es6/pdf-web-viewer/state/index.d.ts +80 -0
- package/es6/pdf-web-viewer/state/index.js +98 -0
- package/es6/pdf-web-viewer/state/layout.d.ts +24 -0
- package/es6/pdf-web-viewer/state/layout.js +21 -0
- package/es6/pdf-web-viewer/state/mobile.d.ts +16 -0
- package/es6/pdf-web-viewer/state/mobile.js +11 -0
- package/es6/pdf-web-viewer/state/navigationPanel.d.ts +61 -0
- package/es6/pdf-web-viewer/state/navigationPanel.js +84 -0
- package/es6/pdf-web-viewer/state/passwordForm.d.ts +18 -0
- package/es6/pdf-web-viewer/state/passwordForm.js +21 -0
- package/es6/pdf-web-viewer/state/pdfDocument.d.ts +31 -0
- package/es6/pdf-web-viewer/state/pdfDocument.js +41 -0
- package/es6/pdf-web-viewer/state/search.d.ts +29 -0
- package/es6/pdf-web-viewer/state/search.js +23 -0
- package/es6/pdf-web-viewer/views/App.d.ts +4 -0
- package/es6/pdf-web-viewer/views/App.js +19 -0
- package/es6/pdf-web-viewer/views/CustomButtons.d.ts +9 -0
- package/es6/pdf-web-viewer/views/CustomButtons.js +18 -0
- package/es6/pdf-web-viewer/views/DropZone.d.ts +9 -0
- package/es6/pdf-web-viewer/views/DropZone.js +53 -0
- package/es6/pdf-web-viewer/views/Layout.d.ts +4 -0
- package/es6/pdf-web-viewer/views/Layout.js +22 -0
- package/es6/pdf-web-viewer/views/annotationbar/Annotationbar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/annotationbar/Annotationbar.js +21 -0
- package/es6/pdf-web-viewer/views/appbar/AddonsToolbar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/AddonsToolbar.js +35 -0
- package/es6/pdf-web-viewer/views/appbar/AnnotationsMenu.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/AnnotationsMenu.js +22 -0
- package/es6/pdf-web-viewer/views/appbar/AppBar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/AppBar.js +26 -0
- package/es6/pdf-web-viewer/views/appbar/DocumentBar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/DocumentBar.js +36 -0
- package/es6/pdf-web-viewer/views/appbar/Menu.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/Menu.js +80 -0
- package/es6/pdf-web-viewer/views/appbar/NavigationBar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/NavigationBar.js +74 -0
- package/es6/pdf-web-viewer/views/appbar/SearchBar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/SearchBar.js +83 -0
- package/es6/pdf-web-viewer/views/appbar/SearchOptions.d.ts +10 -0
- package/es6/pdf-web-viewer/views/appbar/SearchOptions.js +55 -0
- package/es6/pdf-web-viewer/views/appbar/ViewBar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/ViewBar.js +52 -0
- package/es6/pdf-web-viewer/views/appbar/ZoomBar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/ZoomBar.js +18 -0
- package/es6/pdf-web-viewer/views/modal/ApplicationError.d.ts +4 -0
- package/es6/pdf-web-viewer/views/modal/ApplicationError.js +25 -0
- package/es6/pdf-web-viewer/views/modal/LoadApplication.d.ts +3 -0
- package/es6/pdf-web-viewer/views/modal/LoadApplication.js +6 -0
- package/es6/pdf-web-viewer/views/modal/LoadFile.d.ts +3 -0
- package/es6/pdf-web-viewer/views/modal/LoadFile.js +10 -0
- package/es6/pdf-web-viewer/views/modal/Modal.d.ts +4 -0
- package/es6/pdf-web-viewer/views/modal/Modal.js +39 -0
- package/es6/pdf-web-viewer/views/modal/OpenFile.d.ts +4 -0
- package/es6/pdf-web-viewer/views/modal/OpenFile.js +30 -0
- package/es6/pdf-web-viewer/views/modal/OpenFileError.d.ts +4 -0
- package/es6/pdf-web-viewer/views/modal/OpenFileError.js +13 -0
- package/es6/pdf-web-viewer/views/modal/PasswordForm.d.ts +4 -0
- package/es6/pdf-web-viewer/views/modal/PasswordForm.js +54 -0
- package/es6/pdf-web-viewer/views/modal/SaveFile.d.ts +4 -0
- package/es6/pdf-web-viewer/views/modal/SaveFile.js +10 -0
- package/es6/pdf-web-viewer/views/modal/UnsavedChanges.d.ts +4 -0
- package/es6/pdf-web-viewer/views/modal/UnsavedChanges.js +32 -0
- package/es6/pdf-web-viewer/views/navigation/AnnotationList.d.ts +8 -0
- package/es6/pdf-web-viewer/views/navigation/AnnotationList.js +26 -0
- package/es6/pdf-web-viewer/views/navigation/AnnotationListItem.d.ts +8 -0
- package/es6/pdf-web-viewer/views/navigation/AnnotationListItem.js +158 -0
- package/es6/pdf-web-viewer/views/navigation/AnnotationNavigation.d.ts +4 -0
- package/es6/pdf-web-viewer/views/navigation/AnnotationNavigation.js +11 -0
- package/es6/pdf-web-viewer/views/navigation/NavigationPanel.d.ts +4 -0
- package/es6/pdf-web-viewer/views/navigation/NavigationPanel.js +50 -0
- package/es6/pdf-web-viewer/views/navigation/OutlineList.d.ts +12 -0
- package/es6/pdf-web-viewer/views/navigation/OutlineList.js +19 -0
- package/es6/pdf-web-viewer/views/navigation/OutlineNavigation.d.ts +4 -0
- package/es6/pdf-web-viewer/views/navigation/OutlineNavigation.js +10 -0
- package/es6/pdf-web-viewer/views/navigation/ThumbnailNavigation.d.ts +16 -0
- package/es6/pdf-web-viewer/views/navigation/ThumbnailNavigation.js +32 -0
- package/package.json +24 -0
- package/pdfwebviewer/PdfViewing.data +0 -0
- package/pdfwebviewer/PdfViewing_Main.js +1 -0
- package/pdfwebviewer/PdfViewing_Main.wasm +0 -0
- package/pdfwebviewer/PdfViewing_Worker.js +1 -0
- package/pdfwebviewer/PdfViewing_Worker.wasm +0 -0
- package/pdfwebviewer/pdf-web-viewer.css +2407 -0
- package/pdfwebviewer/pdf-web-viewer.development.js +25955 -0
- package/pdfwebviewer/pdf-web-viewer.min.js +1 -0
- package/pdfwebviewer/translations.de.json +151 -0
- package/pdfwebviewer/translations.en.json +151 -0
- package/pdfwebviewer/translations.fr.json +151 -0
- package/pdfwebviewer/translations.it.json +151 -0
- package/scss/common/_breakpoints.scss +44 -0
- package/scss/common/_buttons.scss +42 -0
- package/scss/common/_colorpicker.scss +89 -0
- package/scss/common/_common.scss +21 -0
- package/scss/common/_contextbar.scss +44 -0
- package/scss/common/_dropdown.scss +176 -0
- package/scss/common/_icon.scss +9 -0
- package/scss/common/_index.scss +19 -0
- package/scss/common/_loader.scss +30 -0
- package/scss/common/_rangeslider.scss +24 -0
- package/scss/common/_scrollbars.scss +64 -0
- package/scss/common/_stroke-style-picker.scss +64 -0
- package/scss/common/_stroke-width-picker.scss +23 -0
- package/scss/common/_toolbar.scss +117 -0
- package/scss/common/_tooltip.scss +39 -0
- package/scss/modules/_eraser.scss +28 -0
- package/scss/modules/_forms.scss +56 -0
- package/scss/modules/_highlightannotation.scss +12 -0
- package/scss/modules/_index.scss +5 -0
- package/scss/modules/_inkannotation.scss +41 -0
- package/scss/modules/_stampannotation.scss +19 -0
- package/scss/pdf-viewer-canvas/_annotationborder.scss +107 -0
- package/scss/pdf-viewer-canvas/_busy-loader.scss +53 -0
- package/scss/pdf-viewer-canvas/_freetexteditor.scss +28 -0
- package/scss/pdf-viewer-canvas/_index.scss +7 -0
- package/scss/pdf-viewer-canvas/_layout.scss +52 -0
- package/scss/pdf-viewer-canvas/_popup.scss +217 -0
- package/scss/pdf-viewer-canvas/_printservice.scss +171 -0
- package/scss/pdf-viewer-canvas/_textselection.scss +17 -0
- package/scss/pdf-web-viewer/_annotationbar.scss +47 -0
- package/scss/pdf-web-viewer/_index.scss +8 -0
- package/scss/pdf-web-viewer/_layout.scss +63 -0
- package/scss/pdf-web-viewer/_modal.scss +186 -0
- package/scss/pdf-web-viewer/_navigationpanel.scss +398 -0
- package/scss/pdf-web-viewer/_searchbar.scss +47 -0
- package/scss/pdf-web-viewer/_toolbar.scss +134 -0
- package/scss/pdf-web-viewer/_viewer.scss +54 -0
- package/scss/pdf-web-viewer.scss +1 -0
- package/scss/themes/default/_light.scss +32 -0
- package/scss/themes/default/_mixins.scss +129 -0
- package/scss/themes/default/_theme.scss +161 -0
- package/scss/themes/pdf-web-viewer.scss +1 -0
- package/umd/pdf-web-viewer.development.js +25955 -0
- package/umd/pdf-web-viewer.development.js.map +1 -0
- package/umd/pdf-web-viewer.min.js +1 -0
- package/wasm/PdfViewing.data +0 -0
- package/wasm/PdfViewing_Main.js +1 -0
- package/wasm/PdfViewing_Main.wasm +0 -0
- package/wasm/PdfViewing_Worker.js +1 -0
- package/wasm/PdfViewing_Worker.wasm +0 -0
- package/wasm/translations.de.json +151 -0
- package/wasm/translations.en.json +151 -0
- package/wasm/translations.fr.json +151 -0
- package/wasm/translations.it.json +151 -0
|
@@ -0,0 +1,732 @@
|
|
|
1
|
+
import { PdfViewing } from '../pdf-viewing/PdfViewing';
|
|
2
|
+
import { PdfItemCategory } from './enums';
|
|
3
|
+
import { PdfViewingWrapper } from './PdfViewingWrapper';
|
|
4
|
+
const checkType = (object, typeName, methodName, optional = false) => {
|
|
5
|
+
if (!optional && (object === null || typeof object !== typeName)) {
|
|
6
|
+
throw new TypeError(`Method ${methodName} requires argument of type '${typeName}' but is '${typeof object}'`);
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
const checkLicense = (instance) => {
|
|
10
|
+
if (!instance)
|
|
11
|
+
throw new Error('License is not set.');
|
|
12
|
+
};
|
|
13
|
+
export class PdfViewerApi {
|
|
14
|
+
constructor(pdfViewerApiOptions) {
|
|
15
|
+
this.eventListeners = new Map();
|
|
16
|
+
this.open = this.open.bind(this);
|
|
17
|
+
this.save = this.save.bind(this);
|
|
18
|
+
this.pdfViewerApiOptions = pdfViewerApiOptions;
|
|
19
|
+
/* iOS warns whenever an app uses resources too aggressively.
|
|
20
|
+
* For Cordova this plugin redirects this warning as an event to the document.
|
|
21
|
+
* When triggered flush the render cache.
|
|
22
|
+
* https://www.npmjs.com/package/cordova-plugin-memory-warning
|
|
23
|
+
*/
|
|
24
|
+
// document.addEventListener('memorywarning', this.instance.forceFlushCache, {passive: false})
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* Open a PDF and optionally one or more associated FDF's.
|
|
29
|
+
* @param pdfFile The PDF File that should be opened.
|
|
30
|
+
* @param fdfFiles A list of FDF or XFDF files associated with this PDF that should be opened.
|
|
31
|
+
* @param password The password used for opening this file.
|
|
32
|
+
* @param viewOptions ViewOptions.
|
|
33
|
+
*/
|
|
34
|
+
open(pdfFile, fdfFiles, password, viewOptions, renderOptions, viewportSize) {
|
|
35
|
+
checkLicense(this.instance);
|
|
36
|
+
return this.instance.open(pdfFile, fdfFiles, password, viewOptions, renderOptions, viewportSize);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Save the currently opened PDF file.
|
|
40
|
+
* @param fileType Whether the file should be saved as
|
|
41
|
+
* a PDF containing the document and annotations,
|
|
42
|
+
* or an FDF containing ONLY the annotations.
|
|
43
|
+
*
|
|
44
|
+
* @returns A promise returning a memory buffer containing the saved file if resolved or an error message if rejected.
|
|
45
|
+
*/
|
|
46
|
+
save(saveOptions) {
|
|
47
|
+
checkLicense(this.instance);
|
|
48
|
+
return this.instance.save(saveOptions);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Close the currently opened PDF file.
|
|
52
|
+
* @returns A promise returning nothing if resolved and an error message if rejected.
|
|
53
|
+
*/
|
|
54
|
+
close() {
|
|
55
|
+
checkLicense(this.instance);
|
|
56
|
+
return this.instance.close();
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* dispose the api.
|
|
60
|
+
*/
|
|
61
|
+
destroy() {
|
|
62
|
+
checkLicense(this.instance);
|
|
63
|
+
this.instance.destroy();
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Registers pdf documents to use as stamp
|
|
67
|
+
*
|
|
68
|
+
*/
|
|
69
|
+
registerPdfStampFile(pdfStampFileName, data, onStampCreated) {
|
|
70
|
+
checkLicense(this.instance);
|
|
71
|
+
this.instance.registerPdfStampFile(pdfStampFileName, data, onStampCreated);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Clear the rendered pages cache to free memory.
|
|
75
|
+
*/
|
|
76
|
+
forceFlushCache() {
|
|
77
|
+
checkLicense(this.instance);
|
|
78
|
+
this.instance.forceFlushCache();
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Get the current maximum size of the rendered pages cache.
|
|
82
|
+
* @returns The current maximum cache size in MB.
|
|
83
|
+
*/
|
|
84
|
+
getMaxCacheSize() {
|
|
85
|
+
checkLicense(this.instance);
|
|
86
|
+
return this.instance.getMaxCacheSize();
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Set the maximum size of the rendered pages cache.
|
|
90
|
+
* @param cacheSize The maximum cache size in MB. Default is 120 MB.
|
|
91
|
+
*/
|
|
92
|
+
setMaxCacheSize(cacheSize) {
|
|
93
|
+
checkLicense(this.instance);
|
|
94
|
+
this.instance.setMaxCacheSize(cacheSize);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Get the total page count of the opened document.
|
|
98
|
+
* @returns The total number of pages of the currently opened file.
|
|
99
|
+
* 0 if no document is open.
|
|
100
|
+
*/
|
|
101
|
+
getPageCount() {
|
|
102
|
+
checkLicense(this.instance);
|
|
103
|
+
return this.instance.getPageCount();
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Get the page number of the first visible page.
|
|
107
|
+
* @returns The number of the topmost page shown in the viewport at this moment.
|
|
108
|
+
*/
|
|
109
|
+
getPageNumber() {
|
|
110
|
+
checkLicense(this.instance);
|
|
111
|
+
return this.instance.getPageNumber();
|
|
112
|
+
}
|
|
113
|
+
getLastVisiblePage() {
|
|
114
|
+
checkLicense(this.instance);
|
|
115
|
+
return this.instance.getLastVisiblePage();
|
|
116
|
+
}
|
|
117
|
+
getFirstVisiblePage() {
|
|
118
|
+
checkLicense(this.instance);
|
|
119
|
+
return this.instance.getFirstVisiblePage();
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Go to a given page.
|
|
123
|
+
* @param pageNumber The number of the page to be shown in the viewport.
|
|
124
|
+
*/
|
|
125
|
+
setPageNumber(pageNumber) {
|
|
126
|
+
checkType(pageNumber, 'number', 'setPageNumber');
|
|
127
|
+
checkLicense(this.instance);
|
|
128
|
+
this.instance.setPageNumber(pageNumber);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Get the viewer rotation.
|
|
132
|
+
* @returns The currently used viewer rotation on all pages.
|
|
133
|
+
*/
|
|
134
|
+
getRotation() {
|
|
135
|
+
checkLicense(this.instance);
|
|
136
|
+
return this.instance.getRotation();
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Set the viewer rotation.
|
|
140
|
+
* NOTE: This only changes the view of the document and is not an operation on the document.
|
|
141
|
+
* @param rotation The rotation to be applied on all pages (cumulative with the embedded rotation per page).
|
|
142
|
+
*/
|
|
143
|
+
setRotation(rotation) {
|
|
144
|
+
checkType(rotation, 'number', 'setRotation');
|
|
145
|
+
checkLicense(this.instance);
|
|
146
|
+
this.instance.setRotation(rotation);
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Get the viewer zoom.
|
|
150
|
+
* @returns The currently used zoom factor.
|
|
151
|
+
*/
|
|
152
|
+
getZoom() {
|
|
153
|
+
checkLicense(this.instance);
|
|
154
|
+
return this.instance.getZoom();
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Set the viewer zoom.
|
|
158
|
+
* @param zoom The zoom factor as a percentage of the original size.
|
|
159
|
+
*/
|
|
160
|
+
setZoom(zoom, location) {
|
|
161
|
+
checkType(zoom, 'number', 'setZoom');
|
|
162
|
+
checkLicense(this.instance);
|
|
163
|
+
this.instance.setZoom(zoom, location);
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Get the maximum scroll position.
|
|
167
|
+
* @returns The maximum scroll position in device pixels.
|
|
168
|
+
*/
|
|
169
|
+
getScrollMaxPosition() {
|
|
170
|
+
checkLicense(this.instance);
|
|
171
|
+
return this.instance.getScrollMaxPosition();
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Get the current scroll position.
|
|
175
|
+
* @returns The current scroll position in device pixels.
|
|
176
|
+
*/
|
|
177
|
+
getScrollPosition() {
|
|
178
|
+
checkLicense(this.instance);
|
|
179
|
+
return this.instance.getScrollPosition();
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Set the scroll position.
|
|
183
|
+
* @param pos The scroll position to be shown in the viewer.
|
|
184
|
+
*/
|
|
185
|
+
setScrollPosition(pos) {
|
|
186
|
+
checkLicense(this.instance);
|
|
187
|
+
this.instance.setScrollPosition(pos);
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Jump to a given destination in the document.
|
|
191
|
+
* @param destination The target destination in PDF coordinates (page origin bottom left)
|
|
192
|
+
*/
|
|
193
|
+
goTo(destination) {
|
|
194
|
+
checkLicense(this.instance);
|
|
195
|
+
this.instance.goTo(destination);
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Jump ot a given viewer destination in the document
|
|
199
|
+
* @param destination The target destination in viewer coordinates (page origin top left)
|
|
200
|
+
*/
|
|
201
|
+
goToViewerDestination(destination) {
|
|
202
|
+
checkLicense(this.instance);
|
|
203
|
+
this.instance.goTo(destination);
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Navigate the viewport to show the given Rectangle by scrolling and zooming as little as possible.
|
|
207
|
+
* @param pdfRect The target destination in PDF coordinates (page origin bottom left)
|
|
208
|
+
*/
|
|
209
|
+
goToRectangle(rectangle) {
|
|
210
|
+
checkLicense(this.instance);
|
|
211
|
+
this.instance.goToRectangle(rectangle);
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Check if a document is opened
|
|
215
|
+
* @returns Whether a file is opened by the viewer.
|
|
216
|
+
* A file counts as open if opening it has completed successfully
|
|
217
|
+
* and closing it has not started yet.
|
|
218
|
+
*/
|
|
219
|
+
isOpen() {
|
|
220
|
+
checkLicense(this.instance);
|
|
221
|
+
return this.instance.getIsOpen();
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Set the page layout mode.
|
|
225
|
+
* @param mode The mode to be used for arranging pages on the canvas.
|
|
226
|
+
*/
|
|
227
|
+
setPageLayoutMode(mode) {
|
|
228
|
+
checkLicense(this.instance);
|
|
229
|
+
this.instance.setPageLayoutMode(mode);
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Get the current page layout mode.
|
|
233
|
+
* @returns The mode that is currently used for arranging pages on the canvas.
|
|
234
|
+
*/
|
|
235
|
+
getPageLayoutMode() {
|
|
236
|
+
checkLicense(this.instance);
|
|
237
|
+
return this.instance.getPageLayoutMode();
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Set the fit mode.
|
|
241
|
+
* @param fitMode The mode to be used for fitting the viewport to the visible pages.
|
|
242
|
+
*/
|
|
243
|
+
setFitMode(fitMode) {
|
|
244
|
+
checkLicense(this.instance);
|
|
245
|
+
this.instance.setFitMode(fitMode);
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Get the current fit mode.
|
|
249
|
+
* @returns The mode that is currently used for fitting the viewport to the visible pages.
|
|
250
|
+
*/
|
|
251
|
+
getFitMode() {
|
|
252
|
+
checkLicense(this.instance);
|
|
253
|
+
return this.instance.getFitMode();
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Get the size of the border shown in between pages.
|
|
257
|
+
* @returns The border size in pixels at 100% zoom.
|
|
258
|
+
*/
|
|
259
|
+
getBorderSize() {
|
|
260
|
+
checkLicense(this.instance);
|
|
261
|
+
return this.instance.getBorderSize();
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Set the size of the border shown in between pages.
|
|
265
|
+
* @param borderSize The border size in pixels at 100% zoom.
|
|
266
|
+
*/
|
|
267
|
+
setBorderSize(borderSize) {
|
|
268
|
+
checkLicense(this.instance);
|
|
269
|
+
const ret = this.instance.setBorderSize(borderSize);
|
|
270
|
+
if (!ret.ok) {
|
|
271
|
+
throw new Error(ret.message);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Get the sliding window size.
|
|
276
|
+
* @returns The number of pages the viewer renders before and after the visible pages.
|
|
277
|
+
*/
|
|
278
|
+
getSlidingWindowSize() {
|
|
279
|
+
checkLicense(this.instance);
|
|
280
|
+
return this.instance.getSlidingWindowSize();
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Set the sliding window size.
|
|
284
|
+
* NOTE: Changing this value will impact caching behavior, because the sliding
|
|
285
|
+
* window has priority over cache size. This means that the cache can grow beyond
|
|
286
|
+
* the set cache limit if the sliding window is very large.
|
|
287
|
+
* @param slidingWindowSize The number of pages the viewer renders before and after the visible pages.
|
|
288
|
+
*/
|
|
289
|
+
setSlidingWindowSize(slidingWindowSize) {
|
|
290
|
+
checkType(slidingWindowSize, 'number', 'setSlidingWindowSize');
|
|
291
|
+
checkLicense(this.instance);
|
|
292
|
+
const ret = this.instance.setSlidingWindowSize(slidingWindowSize);
|
|
293
|
+
if (!ret.ok) {
|
|
294
|
+
throw new Error(ret.message);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Suspend drawing for all actions until {@link PdfWebViewer#resumeDrawing|resumeDrawing} is called.
|
|
299
|
+
*/
|
|
300
|
+
suspendDrawing() {
|
|
301
|
+
checkLicense(this.instance);
|
|
302
|
+
this.instance.suspendDrawing();
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Resume drawing if currently suspended by {@link PdfWebViewer#suspendDrawing|suspendDrawing}.
|
|
306
|
+
* NOTE: previously given commands that have not yet been executed will not trigger separate render updates.
|
|
307
|
+
* However, a single render update will be made once all commands before the resumeDrawing call have been executed.
|
|
308
|
+
*/
|
|
309
|
+
resumeDrawing() {
|
|
310
|
+
checkLicense(this.instance);
|
|
311
|
+
this.instance.resumeDrawing();
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Draw into the canvas to update the viewport.
|
|
315
|
+
* This method has to be called whenever the canvas has been invalidated or after zoom/scroll.
|
|
316
|
+
* @param context The canvas context in which the viewer will render.
|
|
317
|
+
*/
|
|
318
|
+
renderCanvas(context, options) {
|
|
319
|
+
checkLicense(this.instance);
|
|
320
|
+
this.instance.renderCanvas(context, options);
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Explicitly render a page with the given dimensions.
|
|
324
|
+
* The width and height will be adjusted to the aspect ratio of the page, clamping it to the smaller of the two values.
|
|
325
|
+
* @param pageNumber The number of the page to be rendered.
|
|
326
|
+
* @param width The width of the output file.
|
|
327
|
+
* @param height The height of the output file.
|
|
328
|
+
* @param annotationFilter Optional callback function to filter annotations during rendering.
|
|
329
|
+
* The result of the callback determines whether the annotation is included in the output.
|
|
330
|
+
* @returns A promise returning PageImage if resolved or returning an error message if rejected.
|
|
331
|
+
*/
|
|
332
|
+
renderPage(pageNumber, width, height, annotationFilter) {
|
|
333
|
+
checkLicense(this.instance);
|
|
334
|
+
return this.instance.renderPage(pageNumber, width, height, annotationFilter);
|
|
335
|
+
}
|
|
336
|
+
rotatePage(pageNumber, direction) {
|
|
337
|
+
checkLicense(this.instance);
|
|
338
|
+
return this.instance.rotatePage(pageNumber, direction);
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Returns the size of a PDF page
|
|
342
|
+
* @param pageNumber The number of the page.
|
|
343
|
+
*/
|
|
344
|
+
getPagePdfSize(pageNumber) {
|
|
345
|
+
checkLicense(this.instance);
|
|
346
|
+
return this.instance.getPagePdfSize(pageNumber);
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Set whether embedded preferences for the startup viewport should be ignored
|
|
350
|
+
* when opening a PDF file (first shown page, fitmode etc.).
|
|
351
|
+
* @param ignore Whether the embedded preferences should be ignored.
|
|
352
|
+
*/
|
|
353
|
+
setIgnoringPreferences(ignore) {
|
|
354
|
+
checkLicense(this.instance);
|
|
355
|
+
this.instance.setIgnoringPreferences(ignore);
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Get whether embedded preferences are ignored when opening a PDF file.
|
|
359
|
+
* @returns Whether embedded preferences are ignored.
|
|
360
|
+
*/
|
|
361
|
+
getIgnoringPreferences() {
|
|
362
|
+
checkLicense(this.instance);
|
|
363
|
+
return this.instance.getIgnoringPreferences();
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Get the product version of the viewer.
|
|
367
|
+
* @returns The product version of the PDF Web Viewer.
|
|
368
|
+
*/
|
|
369
|
+
getProductVersion() {
|
|
370
|
+
return PdfViewing.Sdk.version;
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Load outlines for a given parent.
|
|
374
|
+
* Can be used to call recursively on children which have descendants.
|
|
375
|
+
* @param parent The parent outline item. If null then the root outline will be loaded.
|
|
376
|
+
* @returns A promise with the children of the parent outline.
|
|
377
|
+
*/
|
|
378
|
+
getOutlines(parent) {
|
|
379
|
+
checkLicense(this.instance);
|
|
380
|
+
return this.instance.getOutlines(parent);
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Get the text fragment located at a given position.
|
|
384
|
+
* @param point The point in PDF coordinates.
|
|
385
|
+
* @returns The text fragment or null if no text fragment can be found at the given point.
|
|
386
|
+
*/
|
|
387
|
+
getTextFragmentOnPoint(point) {
|
|
388
|
+
checkType(point, 'object', 'getTextFragmentOnPoint');
|
|
389
|
+
checkLicense(this.instance);
|
|
390
|
+
return this.instance.getTextFragmentOnPoint(point);
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Get the text selection for a word located at a given position.
|
|
394
|
+
* @param point The point in PDF coordinates.
|
|
395
|
+
* @returns The text selection or null if no word can be found at the given point.
|
|
396
|
+
*/
|
|
397
|
+
getWordOnPoint(point) {
|
|
398
|
+
checkType(point, 'object', 'getWordOnPoint');
|
|
399
|
+
checkLicense(this.instance);
|
|
400
|
+
return this.instance.getWordOnPoint(point);
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Get the text selection rectangles between the two points.
|
|
404
|
+
* @param startPoint The starting point of the selection in PDF coordinates.
|
|
405
|
+
* @param endPoint The end point of the selection in PDF coordinates.
|
|
406
|
+
* @returns The rectangles of the text fragments contained between the two points.
|
|
407
|
+
*/
|
|
408
|
+
getTextSelection(startPoint, endPoint) {
|
|
409
|
+
checkLicense(this.instance);
|
|
410
|
+
return this.instance.getTextSelection(startPoint, endPoint);
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Returns a text selection of all text within a rectangle.
|
|
414
|
+
* @param startPoint The starting point of the selection in PDF coordinates.
|
|
415
|
+
* @param endPoint The end point of the selection in PDF coordinates.
|
|
416
|
+
* @returns The rectangles of the text fragments contained between the two points.
|
|
417
|
+
*/
|
|
418
|
+
getRectangularTextSelection(startPoint, endPoint) {
|
|
419
|
+
checkLicense(this.instance);
|
|
420
|
+
return this.instance.getRectangularTextSelection(startPoint, endPoint);
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Get the text between the two points.
|
|
424
|
+
* @param startPoint The starting point of the selection in PDF coordinates.
|
|
425
|
+
* @param endPoint The end point of the selection in PDF coordinates.
|
|
426
|
+
* @returns The string of the selected text.
|
|
427
|
+
*/
|
|
428
|
+
getText(startPoint, endPoint) {
|
|
429
|
+
checkLicense(this.instance);
|
|
430
|
+
return this.instance.getText(startPoint, endPoint);
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Get the text within a rectangle.
|
|
434
|
+
* @param startPoint The starting point of the selection in PDF coordinates.
|
|
435
|
+
* @param endPoint The end point of the selection in PDF coordinates.
|
|
436
|
+
* @returns The string of the selected text.
|
|
437
|
+
*/
|
|
438
|
+
getTextForRectangularSelection(startPoint, endPoint) {
|
|
439
|
+
checkLicense(this.instance);
|
|
440
|
+
return this.instance.getTextForRectangularSelection(startPoint, endPoint);
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* Get the text contained in given rectangles.
|
|
444
|
+
* @param selection The rectangles in PDF coordinates.
|
|
445
|
+
* @returns The string of the selected text.
|
|
446
|
+
*/
|
|
447
|
+
// public getTextFromSelection(selection: PdfRect[]): string {
|
|
448
|
+
// checkLicense(this.instance)
|
|
449
|
+
// return this.instance.getTextFromSelection(selection)
|
|
450
|
+
// }
|
|
451
|
+
/**
|
|
452
|
+
* Get the annotation located at a given point.
|
|
453
|
+
* @param point The point in PDF coordinates.
|
|
454
|
+
* @returns The annotation or null.
|
|
455
|
+
*/
|
|
456
|
+
getAnnotationsOnPoint(point, onlySelectable = false) {
|
|
457
|
+
checkLicense(this.instance);
|
|
458
|
+
return this.instance.getAnnotationsOnPoint(point, onlySelectable);
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Get all open popups from <firstPage> to <lastPage>.
|
|
462
|
+
* @param firstPage The first page.
|
|
463
|
+
* @param lastPage The last page.
|
|
464
|
+
* @returns The list of annotations with an open popup in the given range.
|
|
465
|
+
*/
|
|
466
|
+
getOpenPopups(firstPage, lastPage) {
|
|
467
|
+
checkLicense(this.instance);
|
|
468
|
+
return this.instance.getOpenPopups(firstPage, lastPage);
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* Load items of type {@link PdfItemCategory} for a given page.
|
|
472
|
+
* @param page The page for which the items should be loaded.
|
|
473
|
+
* @param type The type of item to be loaded. See {@link PdfItemCategory}.
|
|
474
|
+
* @returns The list of items.
|
|
475
|
+
*/
|
|
476
|
+
getItemsFromPage(page, category) {
|
|
477
|
+
checkType(page, 'number', 'getItemsFromPage');
|
|
478
|
+
checkType(category, 'number', 'getItemsFromPage');
|
|
479
|
+
checkLicense(this.instance);
|
|
480
|
+
if (category === PdfItemCategory.ANNOTATION) {
|
|
481
|
+
return this.instance.getItemsFromPage(page, category);
|
|
482
|
+
}
|
|
483
|
+
else {
|
|
484
|
+
return new Promise((resolve, reject) => {
|
|
485
|
+
resolve({});
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* Create an annotation.
|
|
491
|
+
* Depending on the type of annotation the annotation args have to contain different arguments.
|
|
492
|
+
* See:
|
|
493
|
+
* {@link TextStampAnnotationArgs}
|
|
494
|
+
* {@link InkAnnotationArgs}
|
|
495
|
+
* {@link FreeTextAnnotationArgs}
|
|
496
|
+
* @param itemArgs The arguments specific to the type of item to be created.
|
|
497
|
+
* @returns The created item.
|
|
498
|
+
*/
|
|
499
|
+
createItem(itemArgs) {
|
|
500
|
+
checkType(itemArgs, 'object', 'createItem');
|
|
501
|
+
checkLicense(this.instance);
|
|
502
|
+
return this.instance.createItem(itemArgs);
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Get the item for a given id.
|
|
506
|
+
* @param id The id of the item.
|
|
507
|
+
* @returns A promise returning the item if resolved or returning an error message if rejected.
|
|
508
|
+
*/
|
|
509
|
+
getItem(id) {
|
|
510
|
+
checkLicense(this.instance);
|
|
511
|
+
return this.instance.getItem(id);
|
|
512
|
+
}
|
|
513
|
+
/**
|
|
514
|
+
* Get the objects for given ids.
|
|
515
|
+
* @param ids The ids of the items.
|
|
516
|
+
* @returns A promise returning a list of items if resolved or returning an error message if rejected.
|
|
517
|
+
*/
|
|
518
|
+
getItems(ids) {
|
|
519
|
+
checkLicense(this.instance);
|
|
520
|
+
return this.instance.getItems(ids);
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Update the editable fields of an item (e.g. an annotation).
|
|
524
|
+
* Please check the manual for more information about items and their fields.
|
|
525
|
+
* @param item The item to be updated.
|
|
526
|
+
* @returns A promise returning the updated item if resolved or returning an error message if rejected.
|
|
527
|
+
*/
|
|
528
|
+
updateItem(item) {
|
|
529
|
+
checkType(item, 'object', 'updateItem');
|
|
530
|
+
checkLicense(this.instance);
|
|
531
|
+
return this.instance.updateItem(item);
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* Delete an item (e.g. an annotation).
|
|
535
|
+
* Please check the manual for more information about items.
|
|
536
|
+
* @param item The item to be deleted.
|
|
537
|
+
* @returns A promise returning nothing if resolved or returning an error message if rejected.
|
|
538
|
+
*/
|
|
539
|
+
deleteItem(item) {
|
|
540
|
+
checkType(item, 'object', 'deleteItem');
|
|
541
|
+
checkLicense(this.instance);
|
|
542
|
+
return this.instance.deleteItem(item);
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* Get information about a particular stamp.
|
|
546
|
+
* Used for text stamps to retrieve the aspect ratio of the resulting stamp.
|
|
547
|
+
* @param args stampType should be TEXT - stampText is the text of the stamp that should be displayed on the stamp annotation.
|
|
548
|
+
* @returns A promise returning stamp information such as aspect ratio if resolved.
|
|
549
|
+
*/
|
|
550
|
+
getStampInfo(args) {
|
|
551
|
+
checkLicense(this.instance);
|
|
552
|
+
return this.instance.getStampInfo(args);
|
|
553
|
+
}
|
|
554
|
+
getTextStampAspectRatio(stampText) {
|
|
555
|
+
checkLicense(this.instance);
|
|
556
|
+
return this.instance.getTextStampAspectRatio(stampText);
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* Register an image stamp in the document. If the registration is successful the promise
|
|
560
|
+
* returns an ID > 0. This ID can then be used for the createItem method to create an image stamp
|
|
561
|
+
* with the given image ID
|
|
562
|
+
* @param image
|
|
563
|
+
* @returns A promise returning the ID
|
|
564
|
+
*/
|
|
565
|
+
registerStampImage(image) {
|
|
566
|
+
checkType(image, 'object', 'registerStampImage');
|
|
567
|
+
checkLicense(this.instance);
|
|
568
|
+
return this.instance.registerImage(image);
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* Register an pdf page as stamp in the document. If the registration is successful the promise
|
|
572
|
+
* returns an ID > 0. This ID can then be used for the createItem method to create an image stamp
|
|
573
|
+
* with the given ID
|
|
574
|
+
* @param image
|
|
575
|
+
* @returns A promise returning the ID
|
|
576
|
+
*/
|
|
577
|
+
registerPdfPage(fileName, pageNumber) {
|
|
578
|
+
checkType(fileName, 'string', 'registerPdfStamp');
|
|
579
|
+
checkType(pageNumber, 'number', 'registerPdfStamp');
|
|
580
|
+
checkLicense(this.instance);
|
|
581
|
+
return this.instance.registerPdfPage(fileName, pageNumber);
|
|
582
|
+
}
|
|
583
|
+
/**
|
|
584
|
+
* Check whether there are unsaved changes in the document.
|
|
585
|
+
* NOTE: When saving a document with unsaved changes
|
|
586
|
+
* - is successful: the promise resolves and the document is considered to be saved even if the array buffer with the saved document is discarded.
|
|
587
|
+
* - fails: the document is considered to contain unsaved changes.
|
|
588
|
+
* @returns True if there are unsaved changes, false otherwise.
|
|
589
|
+
*/
|
|
590
|
+
hasChanges() {
|
|
591
|
+
checkLicense(this.instance);
|
|
592
|
+
return this.instance.hasChanges();
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* @param searchString The string to be searched for.
|
|
596
|
+
* @param startPage The page on which the search is started.
|
|
597
|
+
* @param caseSensitive Whether the search should match case.
|
|
598
|
+
* @param wrapSearch Whether the search should wrap around to the beginning when the end of the document is reached.
|
|
599
|
+
* @param useRegex Whether the search should interpret the provided string as a regular expression.
|
|
600
|
+
* @returns A promise returning a {@link SearchResult} if resolved or returning an error message if rejected.
|
|
601
|
+
*/
|
|
602
|
+
getSearchIterator(searchString, startPage, caseSensitive, wrapSearch, useRegex) {
|
|
603
|
+
return this.instance.getSearchIterator(searchString, startPage, caseSensitive, wrapSearch, useRegex);
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* Set the license key for the viewer.
|
|
607
|
+
* @param license The license key.
|
|
608
|
+
* @returns True if license is correct else false
|
|
609
|
+
*/
|
|
610
|
+
setLicenseKey(license) {
|
|
611
|
+
try {
|
|
612
|
+
this.instance = new PdfViewingWrapper(license, this.pdfViewerApiOptions);
|
|
613
|
+
return true;
|
|
614
|
+
}
|
|
615
|
+
catch (error) {
|
|
616
|
+
return false;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
/** internal */
|
|
620
|
+
getSupportedFeatures() {
|
|
621
|
+
return this.instance.getSupportedFeatures();
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* Convert a point from device coordinates to PDF coordinates.
|
|
625
|
+
* @param point The point in device coordinates.
|
|
626
|
+
* @param page The page relative to which the PDF coordinates should be calculated.
|
|
627
|
+
* @param guaranteePointIsOnPage This parameter will fix the isOnPage boolean of the return value to true.
|
|
628
|
+
* Due to conversions back and forth from CSS to PDF and vice versa,
|
|
629
|
+
* a CSS coordinate could return isOnPage=False even if the mouse movement
|
|
630
|
+
* has been restricted to the page. Only set this to true if the
|
|
631
|
+
* device point is certainly on the page.
|
|
632
|
+
* @returns The point in PDF coordinates, including the number of the page where it is located.
|
|
633
|
+
*/
|
|
634
|
+
transformScreenPointToPdfPoint(point, page, guaranteePointIsOnPage) {
|
|
635
|
+
checkType(point.x, 'number', 'x');
|
|
636
|
+
checkType(point.y, 'number', 'y');
|
|
637
|
+
checkLicense(this.instance);
|
|
638
|
+
if (page !== undefined) {
|
|
639
|
+
checkType(page, 'number', 'page');
|
|
640
|
+
}
|
|
641
|
+
if (guaranteePointIsOnPage !== undefined) {
|
|
642
|
+
checkType(guaranteePointIsOnPage, 'boolean', 'transformScreenPointToPdf');
|
|
643
|
+
}
|
|
644
|
+
return this.instance.transformScreenPointToPdfPoint(point, page, guaranteePointIsOnPage);
|
|
645
|
+
}
|
|
646
|
+
getClosestPointOnPdfByScreenPoint(point, padding = 0, page) {
|
|
647
|
+
checkLicense(this.instance);
|
|
648
|
+
return this.instance.getClosestPointOnPdfByScreenPoint(point, page, padding);
|
|
649
|
+
}
|
|
650
|
+
transformPdfPointToScreenPoint(pdfPoint) {
|
|
651
|
+
checkType(pdfPoint.pdfX, 'number', 'pdfX');
|
|
652
|
+
checkType(pdfPoint.pdfY, 'number', 'pdfY');
|
|
653
|
+
checkType(pdfPoint.page, 'number', 'page');
|
|
654
|
+
checkLicense(this.instance);
|
|
655
|
+
return this.instance.transformPdfPointToScreenPoint(pdfPoint);
|
|
656
|
+
}
|
|
657
|
+
/**
|
|
658
|
+
* Convert a rectangle from device coordinates to PDF coordinates.
|
|
659
|
+
* @param rect The rectangle in device coordinates.
|
|
660
|
+
* @returns The rectangle in PDF coordinates, including the number of the page where it is located.
|
|
661
|
+
*/
|
|
662
|
+
transformScreenRectToPdfRect(rect, page) {
|
|
663
|
+
checkType(rect.x, 'number', 'x');
|
|
664
|
+
checkType(rect.y, 'number', 'y');
|
|
665
|
+
checkType(rect.w, 'number', 'w');
|
|
666
|
+
checkType(rect.h, 'number', 'h');
|
|
667
|
+
checkLicense(this.instance);
|
|
668
|
+
return this.instance.transformScreenRectToPdfRect(rect, page);
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
* Convert a rectangle from PDF coordinates to device coordinates.
|
|
672
|
+
* @param pdfRect The rectangle in PDF coordinates.
|
|
673
|
+
* @returns Rect The rectangle in device coordinates.
|
|
674
|
+
*/
|
|
675
|
+
transformPdfPageRectToScreenRect(pdfRect) {
|
|
676
|
+
checkType(pdfRect.pdfX, 'number', 'pdfX');
|
|
677
|
+
checkType(pdfRect.pdfY, 'number', 'pdfY');
|
|
678
|
+
checkType(pdfRect.pdfW, 'number', 'pdfW');
|
|
679
|
+
checkType(pdfRect.pdfH, 'number', 'pdfH');
|
|
680
|
+
checkType(pdfRect.page, 'number', 'page');
|
|
681
|
+
checkLicense(this.instance);
|
|
682
|
+
let ret = this.instance.transformPdfPageRectToScreenRect(pdfRect);
|
|
683
|
+
return ret;
|
|
684
|
+
}
|
|
685
|
+
/**
|
|
686
|
+
* Convert a length from PDF units to device pixels.
|
|
687
|
+
* @param pdfLength The length in PDF units.
|
|
688
|
+
* @returns number The length in device pixels.
|
|
689
|
+
*/
|
|
690
|
+
transformPdfLengthToScreenLength(pdfLength) {
|
|
691
|
+
checkType(pdfLength, 'number', 'transformPdfLengthToScreenLength');
|
|
692
|
+
checkLicense(this.instance);
|
|
693
|
+
return this.instance.transformPdfLengthToScreenLength(pdfLength);
|
|
694
|
+
}
|
|
695
|
+
/**
|
|
696
|
+
* Convert a length from device pixels to PDF units.
|
|
697
|
+
* @param screenLength The length in device pixels.
|
|
698
|
+
* @returns number The length in PDF units.
|
|
699
|
+
*/
|
|
700
|
+
transformScreenLengthToPdfLength(screenLength) {
|
|
701
|
+
checkType(screenLength, 'number', 'transformScreenLengthToPdfLength');
|
|
702
|
+
checkLicense(this.instance);
|
|
703
|
+
return this.instance.transformScreenLengthToPdfLength(screenLength);
|
|
704
|
+
}
|
|
705
|
+
/**
|
|
706
|
+
* Convert a length from PDF units to device pixels.
|
|
707
|
+
* @param pdfLength The length in PDF units.
|
|
708
|
+
* @returns number The length in device pixels.
|
|
709
|
+
*/
|
|
710
|
+
transformQuadrilateralToViewport(quadrilateral) {
|
|
711
|
+
checkLicense(this.instance);
|
|
712
|
+
return this.instance.transformQuadrilateralToViewport(quadrilateral);
|
|
713
|
+
}
|
|
714
|
+
/**
|
|
715
|
+
* Get the screen rectangle of a page to know its position inside the viewport.
|
|
716
|
+
* @param pageNumber The number of the page.
|
|
717
|
+
* @returns The rectangle with the page coordinates in device pixels.
|
|
718
|
+
* Null if no document is opened or the page is invalid.
|
|
719
|
+
*/
|
|
720
|
+
getPageScreenRect(pageNumber) {
|
|
721
|
+
checkLicense(this.instance);
|
|
722
|
+
return this.instance.getPageScreenRect(pageNumber);
|
|
723
|
+
}
|
|
724
|
+
addEventListener(type, listener) {
|
|
725
|
+
checkLicense(this.instance);
|
|
726
|
+
this.instance.addEventListener(type, listener);
|
|
727
|
+
}
|
|
728
|
+
removeEventListener(type, listener) {
|
|
729
|
+
checkLicense(this.instance);
|
|
730
|
+
this.instance.removeEventListener(type, listener);
|
|
731
|
+
}
|
|
732
|
+
}
|