@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,52 @@
|
|
|
1
|
+
import { app, h } from '../../lib/hyperapp';
|
|
2
|
+
import { translationManager } from '../../common/TranslationManager';
|
|
3
|
+
import { Toolbar } from '../../common/Toolbar';
|
|
4
|
+
import { ToolbarItemGroup } from '../../common/ToolbarItemGroup';
|
|
5
|
+
import { ToolbarButton } from '../../common/ToolbarButton';
|
|
6
|
+
import { icons } from '../../common/icons';
|
|
7
|
+
import { ToolbarSeparator } from '../../common/ToolbarSeparator';
|
|
8
|
+
import { ColorPicker } from '../../common/ColorPicker';
|
|
9
|
+
import { HighlightTool } from './AddHighlightAnnotationLayer';
|
|
10
|
+
export const createAddHighlightAnnotationToolbar = (props, element) => {
|
|
11
|
+
const state = {
|
|
12
|
+
colors: props.colors,
|
|
13
|
+
selectedTool: props.selectedTool,
|
|
14
|
+
selectedColor: props.selectedColor,
|
|
15
|
+
};
|
|
16
|
+
const actions = {
|
|
17
|
+
setColor: (color) => ($state) => {
|
|
18
|
+
props.onColorChanged(color);
|
|
19
|
+
return Object.assign(Object.assign({}, $state), { selectedColor: color });
|
|
20
|
+
},
|
|
21
|
+
setTool: (tool) => ($state) => {
|
|
22
|
+
props.onToolChanged(tool);
|
|
23
|
+
return Object.assign(Object.assign({}, $state), { selectedTool: tool });
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
const App = () => h(AddHighlightAnnotationToolbar, null);
|
|
27
|
+
/* tslint:disable-next-line:max-line-length */
|
|
28
|
+
const AddHighlightAnnotationToolbar = ({}) => ($state, $actions) => (h(Toolbar, { allowWrap: true, alignCenter: true },
|
|
29
|
+
h(ToolbarItemGroup, null,
|
|
30
|
+
h(ColorPicker, { colors: $state.colors, color: $state.selectedColor, icon: icons.fillColor, mode: "buttons", onChange: $actions.setColor }),
|
|
31
|
+
h(ToolbarSeparator, null)),
|
|
32
|
+
h(ToolbarItemGroup, null,
|
|
33
|
+
h(ToolbarButton, { tooltip: translationManager.getText('annotHighlight.highlight'), icon: icons.highlighter, active: $state.selectedTool === HighlightTool.HIGHLIGHT, onClick: () => {
|
|
34
|
+
$actions.setTool(HighlightTool.HIGHLIGHT);
|
|
35
|
+
} }),
|
|
36
|
+
h(ToolbarButton, { tooltip: translationManager.getText('annotHighlight.underline'), icon: icons.underline, active: $state.selectedTool === HighlightTool.UNDERLINE, onClick: () => {
|
|
37
|
+
$actions.setTool(HighlightTool.UNDERLINE);
|
|
38
|
+
} }),
|
|
39
|
+
h(ToolbarButton, { tooltip: translationManager.getText('annotHighlight.squiggly'), icon: icons.squiggly, active: $state.selectedTool === HighlightTool.SQUIGGLY, onClick: () => {
|
|
40
|
+
$actions.setTool(HighlightTool.SQUIGGLY);
|
|
41
|
+
} }),
|
|
42
|
+
h(ToolbarButton, { tooltip: translationManager.getText('annotHighlight.strikeOut'), icon: icons.strikethrough, active: $state.selectedTool === HighlightTool.STRIKE_OUT, onClick: () => {
|
|
43
|
+
$actions.setTool(HighlightTool.STRIKE_OUT);
|
|
44
|
+
} }),
|
|
45
|
+
h(ToolbarButton, { tooltip: translationManager.getText('annotHighlight.rectangularHighlight'), icon: icons.rectangularHighlighter, active: $state.selectedTool === HighlightTool.RECTANGULAR_HIGHLIGHT, onClick: () => {
|
|
46
|
+
$actions.setTool(HighlightTool.RECTANGULAR_HIGHLIGHT);
|
|
47
|
+
} })),
|
|
48
|
+
h(ToolbarItemGroup, { pushRight: true },
|
|
49
|
+
h(ToolbarSeparator, null),
|
|
50
|
+
h(ToolbarButton, { icon: icons.close, onClick: props.onClose }))));
|
|
51
|
+
return app(state, actions, App, element);
|
|
52
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CanvasLayer } from '../CanvasLayer';
|
|
2
|
+
import { ViewerCanvasState } from '../../pdf-viewer-canvas/state/store';
|
|
3
|
+
export declare class EditHighlightAnnotationLayer extends CanvasLayer {
|
|
4
|
+
private highlightAnnotation;
|
|
5
|
+
private context;
|
|
6
|
+
private colors;
|
|
7
|
+
private selectedColor;
|
|
8
|
+
onCreate(annotationId: number): void;
|
|
9
|
+
onSave(): Promise<void>;
|
|
10
|
+
onRemove(): void;
|
|
11
|
+
render(timestamp: number, state: ViewerCanvasState): void;
|
|
12
|
+
private setColor;
|
|
13
|
+
private close;
|
|
14
|
+
private updateHighlightAnnotation;
|
|
15
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { CanvasLayer } from '../CanvasLayer';
|
|
2
|
+
import { Color } from '../../common/Color';
|
|
3
|
+
import { createEditHighlightAnnotationToolbar } from './EditHighlightAnnotationToolbar';
|
|
4
|
+
const moduleLayerName = 'EditHighlightAnnotation';
|
|
5
|
+
export class EditHighlightAnnotationLayer extends CanvasLayer {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.highlightAnnotation = null;
|
|
9
|
+
this.colors = [];
|
|
10
|
+
this.selectedColor = '';
|
|
11
|
+
}
|
|
12
|
+
onCreate(annotationId) {
|
|
13
|
+
this.highlightAnnotation = this.pdfApi.getItem(annotationId);
|
|
14
|
+
this.setColor = this.setColor.bind(this);
|
|
15
|
+
this.close = this.close.bind(this);
|
|
16
|
+
this.context = this.createCanvas();
|
|
17
|
+
const annotationOptions = this.options.annotation;
|
|
18
|
+
this.colors = annotationOptions.colors.highlightColors;
|
|
19
|
+
this.selectedColor = annotationOptions.colors.highlightAnnotationColor;
|
|
20
|
+
/* tslint:disable-next-line:align */
|
|
21
|
+
const toolbarElement = this.module.toolbarElement;
|
|
22
|
+
createEditHighlightAnnotationToolbar({
|
|
23
|
+
colors: this.colors,
|
|
24
|
+
selectedColor: this.selectedColor,
|
|
25
|
+
onColorChanged: this.setColor,
|
|
26
|
+
onClose: this.close,
|
|
27
|
+
}, toolbarElement);
|
|
28
|
+
this.store.viewer.beginModule(moduleLayerName);
|
|
29
|
+
}
|
|
30
|
+
onSave() {
|
|
31
|
+
const promise = new Promise((resolve, reject) => {
|
|
32
|
+
resolve();
|
|
33
|
+
});
|
|
34
|
+
return promise;
|
|
35
|
+
}
|
|
36
|
+
onRemove() {
|
|
37
|
+
this.removeCanvasElements();
|
|
38
|
+
this.context = null;
|
|
39
|
+
/* tslint:disable-next-line:align */
|
|
40
|
+
const toolbarElement = this.module.toolbarElement;
|
|
41
|
+
toolbarElement.innerHTML = '';
|
|
42
|
+
this.store.viewer.endModule(moduleLayerName);
|
|
43
|
+
}
|
|
44
|
+
render(timestamp, state) {
|
|
45
|
+
var _a;
|
|
46
|
+
if (state.viewer.modeChanged && state.viewer.selectedModuleName !== moduleLayerName) {
|
|
47
|
+
this.close();
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (state.pointer.action === 'click' || state.pointer.action === 'dblclick') {
|
|
51
|
+
const highlightAnnotation = (_a = this.pdfApi
|
|
52
|
+
.getAnnotationsOnPoint({
|
|
53
|
+
x: state.pointer.x.devicePixels,
|
|
54
|
+
y: state.pointer.y.devicePixels,
|
|
55
|
+
})) === null || _a === void 0 ? void 0 : _a.find((a) => this.highlightAnnotation && a.id === this.highlightAnnotation.id);
|
|
56
|
+
if (!highlightAnnotation) {
|
|
57
|
+
this.close();
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (this.context && this.highlightAnnotation) {
|
|
62
|
+
const ctx = this.context;
|
|
63
|
+
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
|
|
64
|
+
const rect = this.pdfApi.transformPdfPageRectToScreenRect(this.highlightAnnotation.pdfRect);
|
|
65
|
+
const lineWidth = 2 * devicePixelRatio;
|
|
66
|
+
ctx.save();
|
|
67
|
+
ctx.strokeStyle = this.options.viewer.general.textSelectionColor;
|
|
68
|
+
ctx.lineWidth = lineWidth;
|
|
69
|
+
ctx.setLineDash([lineWidth, lineWidth]);
|
|
70
|
+
ctx.strokeRect(rect.x - lineWidth, rect.y - lineWidth, rect.w + 2 * lineWidth, rect.h + 2 * lineWidth);
|
|
71
|
+
ctx.restore();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
setColor(color) {
|
|
75
|
+
if (this.highlightAnnotation && this.highlightAnnotation.color) {
|
|
76
|
+
const newColor = new Color(color);
|
|
77
|
+
const currentColor = new Color(this.highlightAnnotation.color);
|
|
78
|
+
newColor.setOpacity(currentColor.a);
|
|
79
|
+
this.highlightAnnotation.color = newColor.toRgba();
|
|
80
|
+
this.updateHighlightAnnotation();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
close() {
|
|
84
|
+
this.remove();
|
|
85
|
+
}
|
|
86
|
+
updateHighlightAnnotation() {
|
|
87
|
+
const promise = new Promise((resolve, reject) => {
|
|
88
|
+
if (this.pdfApi && this.highlightAnnotation) {
|
|
89
|
+
this.pdfApi
|
|
90
|
+
.updateItem(this.highlightAnnotation)
|
|
91
|
+
.then((item) => {
|
|
92
|
+
resolve();
|
|
93
|
+
})
|
|
94
|
+
.catch((error) => {
|
|
95
|
+
console.warn(error);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
reject();
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
return promise;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface EditHighlightAnnotationToolbarProps {
|
|
2
|
+
colors: string[];
|
|
3
|
+
selectedColor: string;
|
|
4
|
+
onColorChanged(color: string): void;
|
|
5
|
+
onClose(): void;
|
|
6
|
+
}
|
|
7
|
+
interface EditHighlightAnnotationToolbarState {
|
|
8
|
+
colors: string[];
|
|
9
|
+
selectedColor: string;
|
|
10
|
+
}
|
|
11
|
+
export interface EditHighlightAnnotationToolbarActions {
|
|
12
|
+
setColor(color: string): EditHighlightAnnotationToolbarState;
|
|
13
|
+
}
|
|
14
|
+
export declare const createEditHighlightAnnotationToolbar: (props: EditHighlightAnnotationToolbarProps, element: HTMLElement) => EditHighlightAnnotationToolbarActions;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { app, h } from '../../lib/hyperapp';
|
|
2
|
+
import { Toolbar } from '../../common/Toolbar';
|
|
3
|
+
import { ToolbarItemGroup } from '../../common/ToolbarItemGroup';
|
|
4
|
+
import { ToolbarButton } from '../../common/ToolbarButton';
|
|
5
|
+
import { icons } from '../../common/icons';
|
|
6
|
+
import { ToolbarSeparator } from '../../common/ToolbarSeparator';
|
|
7
|
+
import { ColorPicker } from '../../common/ColorPicker';
|
|
8
|
+
export const createEditHighlightAnnotationToolbar = (props, element) => {
|
|
9
|
+
const state = {
|
|
10
|
+
colors: props.colors,
|
|
11
|
+
selectedColor: props.selectedColor,
|
|
12
|
+
};
|
|
13
|
+
const actions = {
|
|
14
|
+
setColor: (color) => ($state) => {
|
|
15
|
+
props.onColorChanged(color);
|
|
16
|
+
return Object.assign(Object.assign({}, $state), { selectedColor: color });
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
const App = () => h(EditHighlightAnnotationToolbar, null);
|
|
20
|
+
/* tslint:disable-next-line:max-line-length */
|
|
21
|
+
const EditHighlightAnnotationToolbar = ({}) => ($state, $actions) => (h(Toolbar, { allowWrap: true, alignCenter: true },
|
|
22
|
+
h(ToolbarItemGroup, null,
|
|
23
|
+
h(ColorPicker, { colors: $state.colors, color: $state.selectedColor, icon: icons.fillColor, mode: "buttons", onChange: $actions.setColor })),
|
|
24
|
+
h(ToolbarItemGroup, { pushRight: true },
|
|
25
|
+
h(ToolbarSeparator, null),
|
|
26
|
+
h(ToolbarButton, { icon: icons.close, onClick: props.onClose }))));
|
|
27
|
+
return app(state, actions, App, element);
|
|
28
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CanvasModule, CanvasModuleType } from '../CanvasModule';
|
|
2
|
+
import { PdfItemType } from '../../pdf-viewer-api';
|
|
3
|
+
export declare class HighlightAnnotationModule extends CanvasModule {
|
|
4
|
+
toolbarElement: HTMLElement | null;
|
|
5
|
+
static moduleInfo: {
|
|
6
|
+
name: string;
|
|
7
|
+
moduleType: CanvasModuleType;
|
|
8
|
+
requiredFeatures: {
|
|
9
|
+
annotate: boolean;
|
|
10
|
+
fillFormFields: boolean;
|
|
11
|
+
};
|
|
12
|
+
translationKey: string;
|
|
13
|
+
icon: string;
|
|
14
|
+
};
|
|
15
|
+
constructor();
|
|
16
|
+
onRegister(): {
|
|
17
|
+
toolbar: HTMLElement;
|
|
18
|
+
contextbar: {
|
|
19
|
+
itemTypes: PdfItemType[];
|
|
20
|
+
icon: import("../../common/icons").IconDefinition;
|
|
21
|
+
tooltip: string;
|
|
22
|
+
onCmd: (annotationId: number) => void;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
activate(): void;
|
|
26
|
+
onEdit(annotationId: number): void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { CanvasModule, CanvasModuleType } from '../CanvasModule';
|
|
2
|
+
import { AddHighlightAnnotationLayer } from './AddHighlightAnnotationLayer';
|
|
3
|
+
import { PdfItemType } from '../../pdf-viewer-api';
|
|
4
|
+
import { icons } from '../../common/Icon';
|
|
5
|
+
import { translationManager } from '../../common/TranslationManager';
|
|
6
|
+
import { EditHighlightAnnotationLayer } from './EditHighlightAnnotationLayer';
|
|
7
|
+
export class HighlightAnnotationModule extends CanvasModule {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.toolbarElement = null;
|
|
11
|
+
this.name = HighlightAnnotationModule.moduleInfo.name;
|
|
12
|
+
this.activate = this.activate.bind(this);
|
|
13
|
+
}
|
|
14
|
+
onRegister() {
|
|
15
|
+
this.toolbarElement = document.createElement('div');
|
|
16
|
+
return {
|
|
17
|
+
toolbar: this.toolbarElement,
|
|
18
|
+
contextbar: {
|
|
19
|
+
itemTypes: [
|
|
20
|
+
PdfItemType.HIGHLIGHT,
|
|
21
|
+
PdfItemType.UNDERLINE,
|
|
22
|
+
PdfItemType.SQUIGGLY,
|
|
23
|
+
PdfItemType.STRIKE_OUT,
|
|
24
|
+
],
|
|
25
|
+
icon: icons.edit,
|
|
26
|
+
tooltip: translationManager.getText('annotHighlight.edit'),
|
|
27
|
+
onCmd: (annotationId) => {
|
|
28
|
+
this.onEdit(annotationId);
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
activate() {
|
|
34
|
+
if (!this.canvasLayers['add']) {
|
|
35
|
+
this.createCanvasLayer('add', AddHighlightAnnotationLayer);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
this.removeCanvasLayer('add');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
onEdit(annotationId) {
|
|
42
|
+
this.createCanvasLayer('edit', EditHighlightAnnotationLayer, annotationId);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
HighlightAnnotationModule.moduleInfo = {
|
|
46
|
+
name: 'HighlightAnnotationModule',
|
|
47
|
+
moduleType: CanvasModuleType.Tool,
|
|
48
|
+
requiredFeatures: {
|
|
49
|
+
annotate: true,
|
|
50
|
+
fillFormFields: false,
|
|
51
|
+
},
|
|
52
|
+
translationKey: 'annotHighlight.add',
|
|
53
|
+
icon: 'highlighter',
|
|
54
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CanvasModule, CanvasModuleType } from '../CanvasModule';
|
|
2
|
+
export declare class ImageAnnotationModule extends CanvasModule {
|
|
3
|
+
toolbarElement: HTMLElement | null;
|
|
4
|
+
private fileInput;
|
|
5
|
+
static moduleInfo: {
|
|
6
|
+
name: string;
|
|
7
|
+
moduleType: CanvasModuleType;
|
|
8
|
+
requiredFeatures: {
|
|
9
|
+
annotate: boolean;
|
|
10
|
+
fillFormFields: boolean;
|
|
11
|
+
};
|
|
12
|
+
translationKey: string;
|
|
13
|
+
icon: string;
|
|
14
|
+
};
|
|
15
|
+
constructor();
|
|
16
|
+
onRegister(): {
|
|
17
|
+
toolbar: HTMLElement;
|
|
18
|
+
};
|
|
19
|
+
activate(file?: File): void;
|
|
20
|
+
private createImage;
|
|
21
|
+
private onFileSelected;
|
|
22
|
+
private createImageStampAnnotation;
|
|
23
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { CanvasModule, CanvasModuleType } from '../CanvasModule';
|
|
11
|
+
import { PdfItemType } from '../../pdf-viewer-api';
|
|
12
|
+
import { imageDataUrlToUint8Array } from '../../common/Tools';
|
|
13
|
+
import { MIN_SIZE } from '../../pdf-viewer-canvas/view-layers/views/AnnotationBorder';
|
|
14
|
+
export class ImageAnnotationModule extends CanvasModule {
|
|
15
|
+
constructor() {
|
|
16
|
+
super();
|
|
17
|
+
this.toolbarElement = null;
|
|
18
|
+
this.fileInput = null;
|
|
19
|
+
this.name = ImageAnnotationModule.moduleInfo.name;
|
|
20
|
+
this.createImage = this.createImage.bind(this);
|
|
21
|
+
this.onFileSelected = this.onFileSelected.bind(this);
|
|
22
|
+
this.createImageStampAnnotation = this.createImageStampAnnotation.bind(this);
|
|
23
|
+
}
|
|
24
|
+
onRegister() {
|
|
25
|
+
this.toolbarElement = document.createElement('div');
|
|
26
|
+
this.fileInput = document.createElement('input');
|
|
27
|
+
this.fileInput.setAttribute('type', 'file');
|
|
28
|
+
this.fileInput.setAttribute('accept', '.jpg, .jpeg, .jpe, .jif, .jfif, .jfi, .jp2, .j2k, .jpf, .jpm, .jpg2, .j2c, .jpc, .jpx, .mj2 .tif, tiff, .png, .gif, .bmp');
|
|
29
|
+
this.fileInput.style.position = 'absolute';
|
|
30
|
+
this.fileInput.style.left = '-5000px';
|
|
31
|
+
this.fileInput.onchange = (e) => {
|
|
32
|
+
if (e.currentTarget.files && e.currentTarget.files.length) {
|
|
33
|
+
const file = e.currentTarget.files[0];
|
|
34
|
+
this.onFileSelected(file);
|
|
35
|
+
e.currentTarget.value = '';
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
this.toolbarElement.append(this.fileInput);
|
|
39
|
+
return {
|
|
40
|
+
toolbar: this.toolbarElement,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
activate(file) {
|
|
44
|
+
if (file) {
|
|
45
|
+
this.onFileSelected(file);
|
|
46
|
+
}
|
|
47
|
+
else if (this.fileInput) {
|
|
48
|
+
this.fileInput.click();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
createImage(dataUrl) {
|
|
52
|
+
const image = new Image();
|
|
53
|
+
image.onload = () => {
|
|
54
|
+
// image needs to be over min since the moment it is added
|
|
55
|
+
const anyUnderMinSize = image.width < MIN_SIZE || image.width < MIN_SIZE;
|
|
56
|
+
let width = image.width;
|
|
57
|
+
let height = image.height;
|
|
58
|
+
// set the smallest to MIN_SIZE
|
|
59
|
+
// and scale keeping aspect ratio
|
|
60
|
+
if (anyUnderMinSize && width <= height) {
|
|
61
|
+
height = (MIN_SIZE * height) / width;
|
|
62
|
+
width = MIN_SIZE;
|
|
63
|
+
}
|
|
64
|
+
else if (anyUnderMinSize && height < width) {
|
|
65
|
+
width = (MIN_SIZE * width) / height;
|
|
66
|
+
height = MIN_SIZE;
|
|
67
|
+
}
|
|
68
|
+
const imageInfo = {
|
|
69
|
+
width: width,
|
|
70
|
+
height: height,
|
|
71
|
+
stampImage: imageDataUrlToUint8Array(image.src),
|
|
72
|
+
};
|
|
73
|
+
this.createImageStampAnnotation(imageInfo);
|
|
74
|
+
};
|
|
75
|
+
image.src = dataUrl;
|
|
76
|
+
}
|
|
77
|
+
onFileSelected(file) {
|
|
78
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
const reader = new FileReader();
|
|
80
|
+
const _this = this;
|
|
81
|
+
reader.onload = function (e) {
|
|
82
|
+
_this.createImage(e.target.result);
|
|
83
|
+
};
|
|
84
|
+
reader.readAsDataURL(file);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
createImageStampAnnotation(imageInfo) {
|
|
88
|
+
if (this.pdfApi !== null && this.store !== null && this.options !== null) {
|
|
89
|
+
const state = this.store.getState();
|
|
90
|
+
const document = state.document;
|
|
91
|
+
const canvasRect = this.getCanvasSize();
|
|
92
|
+
const screenCenter = {
|
|
93
|
+
x: canvasRect.width / 2,
|
|
94
|
+
y: canvasRect.height / 2,
|
|
95
|
+
};
|
|
96
|
+
// get page to insert image
|
|
97
|
+
let page = this.pdfApi.getPageNumber();
|
|
98
|
+
const screenRect = {
|
|
99
|
+
x: 0,
|
|
100
|
+
y: 0,
|
|
101
|
+
w: canvasRect.width,
|
|
102
|
+
h: canvasRect.height,
|
|
103
|
+
};
|
|
104
|
+
const pageScreenRect = this.pdfApi.getPageScreenRect(page);
|
|
105
|
+
const x1 = Math.max(screenRect.x, pageScreenRect.x);
|
|
106
|
+
const y1 = Math.max(screenRect.y, pageScreenRect.y);
|
|
107
|
+
const x2 = Math.min(screenRect.w, pageScreenRect.x + pageScreenRect.w);
|
|
108
|
+
const y2 = Math.min(screenRect.h, pageScreenRect.y + pageScreenRect.h);
|
|
109
|
+
const boundingRect = {
|
|
110
|
+
x: x1,
|
|
111
|
+
y: y1,
|
|
112
|
+
w: x2 - x1,
|
|
113
|
+
h: y2 - y1,
|
|
114
|
+
};
|
|
115
|
+
const pageBoundingBox = this.pdfApi.transformScreenRectToPdfRect(boundingRect, page);
|
|
116
|
+
const imagepPdfRect = {
|
|
117
|
+
pdfX: 0,
|
|
118
|
+
pdfY: 0,
|
|
119
|
+
pdfW: imageInfo.width * 0.24,
|
|
120
|
+
pdfH: imageInfo.height * 0.24,
|
|
121
|
+
page,
|
|
122
|
+
};
|
|
123
|
+
if (imagepPdfRect.pdfW > pageBoundingBox.pdfW) {
|
|
124
|
+
const f = (pageBoundingBox.pdfW / imagepPdfRect.pdfW) * 0.97;
|
|
125
|
+
imagepPdfRect.pdfW = imagepPdfRect.pdfW * f;
|
|
126
|
+
imagepPdfRect.pdfH = imagepPdfRect.pdfH * f;
|
|
127
|
+
}
|
|
128
|
+
if (imagepPdfRect.pdfH > pageBoundingBox.pdfH) {
|
|
129
|
+
const f = (pageBoundingBox.pdfH / imagepPdfRect.pdfH) * 0.97;
|
|
130
|
+
imagepPdfRect.pdfW = imagepPdfRect.pdfW * f;
|
|
131
|
+
imagepPdfRect.pdfH = imagepPdfRect.pdfH * f;
|
|
132
|
+
}
|
|
133
|
+
imagepPdfRect.pdfX = (pageBoundingBox.pdfW - imagepPdfRect.pdfW) / 2 + pageBoundingBox.pdfX;
|
|
134
|
+
imagepPdfRect.pdfY = (pageBoundingBox.pdfH - imagepPdfRect.pdfH) / 2 + pageBoundingBox.pdfY;
|
|
135
|
+
this.pdfApi.registerStampImage(imageInfo.stampImage).then((imageId) => {
|
|
136
|
+
if (this.pdfApi !== null && this.options !== null) {
|
|
137
|
+
const annotation = {
|
|
138
|
+
itemType: PdfItemType.STAMP,
|
|
139
|
+
imageId,
|
|
140
|
+
page,
|
|
141
|
+
color: this.options.annotation.colors.defaultHighlightColor,
|
|
142
|
+
pdfRect: imagepPdfRect,
|
|
143
|
+
author: this.options.viewer.general.user,
|
|
144
|
+
};
|
|
145
|
+
this.pdfApi
|
|
146
|
+
.createItem(annotation)
|
|
147
|
+
.then((annot) => {
|
|
148
|
+
// select new annotation
|
|
149
|
+
const pdfViewerCanvasApi = this.pdfViewerCanvas;
|
|
150
|
+
pdfViewerCanvasApi.dispatchEvent('itemSelected', annot);
|
|
151
|
+
})
|
|
152
|
+
.catch((err) => {
|
|
153
|
+
console.error(err);
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
ImageAnnotationModule.moduleInfo = {
|
|
161
|
+
name: 'ImageAnnotationModule',
|
|
162
|
+
moduleType: CanvasModuleType.Tool,
|
|
163
|
+
requiredFeatures: {
|
|
164
|
+
annotate: true,
|
|
165
|
+
fillFormFields: false,
|
|
166
|
+
},
|
|
167
|
+
translationKey: 'annotImage.add',
|
|
168
|
+
icon: 'image',
|
|
169
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './freetext-annotation/FreetextAnnotationModule';
|
|
2
|
+
export * from './highlight-annotation/HighlightAnnotationModule';
|
|
3
|
+
export * from './ink-annotation/InkAnnotationModule';
|
|
4
|
+
export * from './popup/PopupModule';
|
|
5
|
+
export * from './stamp-annotation/StampAnnotationModule';
|
|
6
|
+
export * from './text-annotation/TextAnnotationModule';
|
|
7
|
+
export * from './image-annotations/ImageAnnotationModule';
|
|
8
|
+
export * from './shape-annotations/ShapeAnnotationModule';
|
|
9
|
+
export * from './eraser/EraserModule';
|
|
10
|
+
export * from './print-service/PrintServiceModule';
|
|
11
|
+
export * from './form-fields/FormFieldModule';
|
|
12
|
+
export * from './CanvasLayer';
|
|
13
|
+
export * from './CanvasModule';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './freetext-annotation/FreetextAnnotationModule';
|
|
2
|
+
export * from './highlight-annotation/HighlightAnnotationModule';
|
|
3
|
+
export * from './ink-annotation/InkAnnotationModule';
|
|
4
|
+
export * from './popup/PopupModule';
|
|
5
|
+
export * from './stamp-annotation/StampAnnotationModule';
|
|
6
|
+
export * from './text-annotation/TextAnnotationModule';
|
|
7
|
+
export * from './image-annotations/ImageAnnotationModule';
|
|
8
|
+
export * from './shape-annotations/ShapeAnnotationModule';
|
|
9
|
+
export * from './eraser/EraserModule';
|
|
10
|
+
export * from './print-service/PrintServiceModule';
|
|
11
|
+
export * from './form-fields/FormFieldModule';
|
|
12
|
+
export * from './CanvasLayer';
|
|
13
|
+
export * from './CanvasModule';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { CanvasLayer } from '../CanvasLayer';
|
|
2
|
+
import { ViewerCanvasState } from '../../pdf-viewer-canvas/state/store';
|
|
3
|
+
export declare class AddInkAnnotationLayer extends CanvasLayer {
|
|
4
|
+
private context;
|
|
5
|
+
private drawing;
|
|
6
|
+
private lines;
|
|
7
|
+
private page;
|
|
8
|
+
private zoom;
|
|
9
|
+
private inkWidth;
|
|
10
|
+
private penColors;
|
|
11
|
+
private penWidths;
|
|
12
|
+
private penColor;
|
|
13
|
+
private penOpacity;
|
|
14
|
+
private boundingBox;
|
|
15
|
+
private toolbar;
|
|
16
|
+
private currentAnnotation;
|
|
17
|
+
private isUpdatingAnnotation;
|
|
18
|
+
private pendingUpdate;
|
|
19
|
+
onCreate(): void;
|
|
20
|
+
onSave(): Promise<void>;
|
|
21
|
+
onRemove(): void;
|
|
22
|
+
render(timestamp: number, state: ViewerCanvasState): void;
|
|
23
|
+
private startLine;
|
|
24
|
+
private endLine;
|
|
25
|
+
handlePointerMove: (e: PointerEvent) => void;
|
|
26
|
+
handlePointerUp: (e: PointerEvent) => void;
|
|
27
|
+
private drawLines;
|
|
28
|
+
private drawBoundingBox;
|
|
29
|
+
private setPenColor;
|
|
30
|
+
private setPenOpacity;
|
|
31
|
+
private setPenSize;
|
|
32
|
+
private debouncedRecreateInkAnnotation;
|
|
33
|
+
private reset;
|
|
34
|
+
private save;
|
|
35
|
+
private add;
|
|
36
|
+
private undo;
|
|
37
|
+
private recreateInkAnnotation;
|
|
38
|
+
private createNewInkAnnotation;
|
|
39
|
+
private getBoundingBox;
|
|
40
|
+
}
|