2019-03-09 00:36:14 +00:00
import React from 'react' ;
2020-02-08 01:24:23 +00:00
import { gettext } from '../utils/constants' ;
2019-03-09 00:36:14 +00:00
class PDFViewer extends React . Component {
2023-08-09 10:54:58 +00:00
componentDidMount ( ) {
const el = document . createElement ( 'div' ) ;
el . id = 'printContainer' ;
document . body . append ( el ) ;
}
2019-03-09 00:36:14 +00:00
render ( ) {
return (
< React . Fragment >
< div id = "outerContainer" >
2023-08-09 10:54:58 +00:00
< div id = "sidebarContainer" >
2019-03-09 00:36:14 +00:00
< div id = "toolbarSidebar" >
2023-08-09 10:54:58 +00:00
< div id = "thumbnails-header" className = "p-4 d-flex justify-content-between" >
< h3 className = "m-0 title font-weight-normal" > { gettext ( 'Thumbnail' ) } < / h 3 >
< button id = "close-thumbnail-panel" className = "close-thumbnail-panel sf2-icon-x3 border-0 bg-transparent" aria - controls = "sidebarContainer" > < / b u t t o n >
< / d i v >
< div id = "toolbarSidebarLeft" className = "sf-hide" >
< div id = "sidebarViewButtons" className = "splitToolbarButton toggled" role = "radiogroup" >
2024-05-29 03:35:36 +00:00
< button id = "viewThumbnail" className = "toolbarButton toggled" title = "Show Thumbnails" tabIndex = { 2 } data - l10n - id = "pdfjs-thumbs-button" role = "radio" aria - checked = "true" aria - controls = "thumbnailView" >
< span data - l10n - id = "pdfjs-thumbs-button-label" > Thumbnails < / s p a n >
2021-10-20 07:22:21 +00:00
< / b u t t o n >
2024-05-29 03:35:36 +00:00
< button id = "viewOutline" className = "toolbarButton" title = "Show Document Outline (double-click to expand/collapse all items)" tabIndex = { 3 } data - l10n - id = "pdfjs-document-outline-button" role = "radio" aria - checked = "false" aria - controls = "outlineView" >
< span data - l10n - id = "pdfjs-document-outline-button-label" > Document Outline < / s p a n >
2021-10-20 07:22:21 +00:00
< / b u t t o n >
2024-05-29 03:35:36 +00:00
< button id = "viewAttachments" className = "toolbarButton" title = "Show Attachments" tabIndex = { 4 } data - l10n - id = "pdfjs-attachments-button" role = "radio" aria - checked = "false" aria - controls = "attachmentsView" >
< span data - l10n - id = "pdfjs-attachments-button-label" > Attachments < / s p a n >
2021-10-20 07:22:21 +00:00
< / b u t t o n >
2024-05-29 03:35:36 +00:00
< button id = "viewLayers" className = "toolbarButton" title = "Show Layers (double-click to reset all layers to the default state)" tabIndex = { 5 } data - l10n - id = "pdfjs-layers-button" role = "radio" aria - checked = "false" aria - controls = "layersView" >
< span data - l10n - id = "pdfjs-layers-button-label" > Layers < / s p a n >
2021-10-20 07:22:21 +00:00
< / b u t t o n >
< / d i v >
< / d i v >
< div id = "toolbarSidebarRight" >
2024-05-29 03:35:36 +00:00
< div id = "outlineOptionsContainer" className = "sf-hide" >
< div className = "verticalToolbarSeparator" / >
< button id = "currentOutlineItem" className = "toolbarButton" disabled = "disabled" title = "Find Current Outline Item" tabIndex = { 6 } data - l10n - id = "pdfjs-current-outline-item-button" >
< span data - l10n - id = "pdfjs-current-outline-item-button-label" > Current Outline Item < / s p a n >
2021-10-20 07:22:21 +00:00
< / b u t t o n >
< / d i v >
2019-03-09 00:36:14 +00:00
< / d i v >
< / d i v >
< div id = "sidebarContent" >
< div id = "thumbnailView" >
< / d i v >
< div id = "outlineView" className = "hidden" >
< / d i v >
< div id = "attachmentsView" className = "hidden" >
< / d i v >
2021-10-20 07:22:21 +00:00
< div id = "layersView" className = "hidden" >
< / d i v >
2019-03-09 00:36:14 +00:00
< / d i v >
2024-05-29 03:35:36 +00:00
< div id = "sidebarResizer" / >
< /div> {/ * sidebarContainer * / }
2019-03-09 00:36:14 +00:00
< div id = "mainContainer" >
2023-08-09 10:54:58 +00:00
< div className = "findbar hidden doorHanger" id = "findbar" >
2019-03-09 00:36:14 +00:00
< div id = "findbarInputContainer" >
2024-05-29 03:35:36 +00:00
< input id = "findInput" className = "toolbarField" title = "Find" placeholder = "Find in document…" tabIndex = { 91 } data - l10n - id = "pdfjs-find-input" aria - invalid = "false" / >
2019-03-09 00:36:14 +00:00
< div className = "splitToolbarButton" >
2024-05-29 03:35:36 +00:00
< button id = "findPrevious" className = "toolbarButton" title = "Find the previous occurrence of the phrase" tabIndex = { 92 } data - l10n - id = "pdfjs-find-previous-button" >
< span data - l10n - id = "pdfjs-find-previous-button-label" > Previous < / s p a n >
2019-03-09 00:36:14 +00:00
< / b u t t o n >
2024-05-29 03:35:36 +00:00
< div className = "splitToolbarButtonSeparator" / >
< button id = "findNext" className = "toolbarButton" title = "Find the next occurrence of the phrase" tabIndex = { 93 } data - l10n - id = "pdfjs-find-next-button" >
< span data - l10n - id = "pdfjs-find-next-button-label" > Next < / s p a n >
2019-03-09 00:36:14 +00:00
< / b u t t o n >
< / d i v >
< / d i v >
< div id = "findbarOptionsOneContainer" >
2024-05-29 03:35:36 +00:00
< input type = "checkbox" id = "findHighlightAll" className = "toolbarField" tabIndex = { 94 } / >
< label htmlFor = "findHighlightAll" className = "toolbarLabel" data - l10n - id = "pdfjs-find-highlight-checkbox" > Highlight All < / l a b e l >
< input type = "checkbox" id = "findMatchCase" className = "toolbarField" tabIndex = { 95 } / >
< label htmlFor = "findMatchCase" className = "toolbarLabel" data - l10n - id = "pdfjs-find-match-case-checkbox-label" > Match Case < / l a b e l >
2019-03-09 00:36:14 +00:00
< / d i v >
< div id = "findbarOptionsTwoContainer" >
2024-05-29 03:35:36 +00:00
< input type = "checkbox" id = "findMatchDiacritics" className = "toolbarField" tabIndex = { 96 } / >
< label htmlFor = "findMatchDiacritics" className = "toolbarLabel" data - l10n - id = "pdfjs-find-match-diacritics-checkbox-label" > Match Diacritics < / l a b e l >
< input type = "checkbox" id = "findEntireWord" className = "toolbarField" tabIndex = { 97 } / >
< label htmlFor = "findEntireWord" className = "toolbarLabel" data - l10n - id = "pdfjs-find-entire-word-checkbox-label" > Whole Words < / l a b e l >
2019-03-09 00:36:14 +00:00
< / d i v >
2023-08-09 10:54:58 +00:00
< div id = "findbarMessageContainer" aria - live = "polite" >
2024-05-29 03:35:36 +00:00
< span id = "findResultsCount" className = "toolbarLabel" / >
< span id = "findMsg" className = "toolbarLabel" / >
< / d i v >
< /div> {/ * findbar * / }
< div className = "editorParamsToolbar hidden doorHangerRight" id = "editorHighlightParamsToolbar" >
< div id = "highlightParamsToolbarContainer" className = "editorParamsToolbarContainer" >
< div id = "editorHighlightColorPicker" className = "colorPicker" >
< span id = "highlightColorPickerLabel" className = "editorParamsLabel" data - l10n - id = "pdfjs-editor-highlight-colorpicker-label" > Highlight color < / s p a n >
< / d i v >
< div id = "editorHighlightThickness" >
< label htmlFor = "editorFreeHighlightThickness" className = "editorParamsLabel" data - l10n - id = "pdfjs-editor-free-highlight-thickness-input" > Thickness < / l a b e l >
< div className = "thicknessPicker" >
< input type = "range" id = "editorFreeHighlightThickness" className = "editorParamsSlider" data - l10n - id = "pdfjs-editor-free-highlight-thickness-title" defaultValue = { 12 } min = { 8 } max = { 24 } step = { 1 } tabIndex = { 101 } / >
< / d i v >
< / d i v >
< div id = "editorHighlightVisibility" >
< div className = "divider" / >
< div className = "toggler" >
< label htmlFor = "editorHighlightShowAll" className = "editorParamsLabel" data - l10n - id = "pdfjs-editor-highlight-show-all-button-label" > Show all < / l a b e l >
< button id = "editorHighlightShowAll" className = "toggle-button" data - l10n - id = "pdfjs-editor-highlight-show-all-button" aria - pressed = "true" tabIndex = { 102 } / >
< / d i v >
< / d i v >
2019-03-09 00:36:14 +00:00
< / d i v >
< / d i v >
2023-08-09 10:54:58 +00:00
< div className = "editorParamsToolbar hidden doorHangerRight" id = "editorFreeTextParamsToolbar" >
< div className = "editorParamsToolbarContainer" >
< div className = "editorParamsSetter" >
2024-05-29 03:35:36 +00:00
< label htmlFor = "editorFreeTextColor" className = "editorParamsLabel" data - l10n - id = "pdfjs-editor-free-text-color-input" > Color < / l a b e l >
< input type = "color" id = "editorFreeTextColor" className = "editorParamsColor" tabIndex = { 103 } / >
2023-08-09 10:54:58 +00:00
< / d i v >
< div className = "editorParamsSetter" >
2024-05-29 03:35:36 +00:00
< label htmlFor = "editorFreeTextFontSize" className = "editorParamsLabel" data - l10n - id = "pdfjs-editor-free-text-size-input" > Size < / l a b e l >
< input type = "range" id = "editorFreeTextFontSize" className = "editorParamsSlider" defaultValue = { 10 } min = { 5 } max = { 100 } step = { 1 } tabIndex = { 104 } / >
2023-08-09 10:54:58 +00:00
< / d i v >
< / d i v >
< / d i v >
< div className = "editorParamsToolbar hidden doorHangerRight" id = "editorInkParamsToolbar" >
< div className = "editorParamsToolbarContainer" >
< div className = "editorParamsSetter" >
2024-05-29 03:35:36 +00:00
< label htmlFor = "editorInkColor" className = "editorParamsLabel" data - l10n - id = "pdfjs-editor-ink-color-input" > Color < / l a b e l >
< input type = "color" id = "editorInkColor" className = "editorParamsColor" tabIndex = { 105 } / >
2023-08-09 10:54:58 +00:00
< / d i v >
< div className = "editorParamsSetter" >
2024-05-29 03:35:36 +00:00
< label htmlFor = "editorInkThickness" className = "editorParamsLabel" data - l10n - id = "pdfjs-editor-ink-thickness-input" > Thickness < / l a b e l >
< input type = "range" id = "editorInkThickness" className = "editorParamsSlider" defaultValue = { 1 } min = { 1 } max = { 20 } step = { 1 } tabIndex = { 106 } / >
2023-08-09 10:54:58 +00:00
< / d i v >
< div className = "editorParamsSetter" >
2024-05-29 03:35:36 +00:00
< label htmlFor = "editorInkOpacity" className = "editorParamsLabel" data - l10n - id = "pdfjs-editor-ink-opacity-input" > Opacity < / l a b e l >
< input type = "range" id = "editorInkOpacity" className = "editorParamsSlider" defaultValue = { 100 } min = { 1 } max = { 100 } step = { 1 } tabIndex = { 107 } / >
2023-08-09 10:54:58 +00:00
< / d i v >
< / d i v >
< / d i v >
2024-05-29 03:35:36 +00:00
< div className = "editorParamsToolbar hidden doorHangerRight" id = "editorStampParamsToolbar" >
< div className = "editorParamsToolbarContainer" >
< button id = "editorStampAddImage" className = "secondaryToolbarButton" title = "Add image" tabIndex = { 108 } data - l10n - id = "pdfjs-editor-stamp-add-image-button" >
< span className = "editorParamsLabel" data - l10n - id = "pdfjs-editor-stamp-add-image-button-label" > Add image < / s p a n >
< / b u t t o n >
< / d i v >
< / d i v >
2023-08-09 10:54:58 +00:00
< div id = "secondaryToolbar" className = "secondaryToolbar hidden doorHangerRight" >
< div id = "secondaryToolbarButtonContainer" >
2024-05-29 03:35:36 +00:00
< button id = "secondaryOpenFile" className = "secondaryToolbarButton" title = "Open File" tabIndex = { 51 } data - l10n - id = "pdfjs-open-file-button" >
< span data - l10n - id = "pdfjs-open-file-button-label" > Open < / s p a n >
2019-03-09 00:36:14 +00:00
< / b u t t o n >
2024-05-29 03:35:36 +00:00
< button id = "secondaryPrint" className = "secondaryToolbarButton visibleMediumView" title = "Print" tabIndex = { 52 } data - l10n - id = "pdfjs-print-button" >
< span data - l10n - id = "pdfjs-print-button-label" > Print < / s p a n >
2019-03-09 00:36:14 +00:00
< / b u t t o n >
2024-05-29 03:35:36 +00:00
< button id = "secondaryDownload" className = "secondaryToolbarButton visibleMediumView" title = "Save" tabIndex = { 53 } data - l10n - id = "pdfjs-save-button" >
< span data - l10n - id = "pdfjs-save-button-label" > Save < / s p a n >
2019-03-09 00:36:14 +00:00
< / b u t t o n >
2024-05-29 03:35:36 +00:00
< div className = "horizontalToolbarSeparator" / >
< button id = "presentationMode" className = "secondaryToolbarButton" title = "Switch to Presentation Mode" tabIndex = { 54 } data - l10n - id = "pdfjs-presentation-mode-button" >
< span data - l10n - id = "pdfjs-presentation-mode-button-label" > Presentation Mode < / s p a n >
2023-08-09 10:54:58 +00:00
< / b u t t o n >
2024-05-29 03:35:36 +00:00
< a href = "#" id = "viewBookmark" className = "secondaryToolbarButton" title = "Current Page (View URL from Current Page)" tabIndex = { 55 } data - l10n - id = "pdfjs-bookmark-button" >
< span data - l10n - id = "pdfjs-bookmark-button-label" > Current Page < / s p a n >
2023-08-09 10:54:58 +00:00
< / a >
2024-05-29 03:35:36 +00:00
< div id = "viewBookmarkSeparator" className = "horizontalToolbarSeparator" / >
2023-08-09 10:54:58 +00:00
{ / *
2024-05-29 03:35:36 +00:00
< button id = "firstPage" className = "secondaryToolbarButton" title = "Go to First Page" tabIndex = { 56 } data - l10n - id = "pdfjs-first-page-button" >
< span data - l10n - id = "pdfjs-first-page-button-label" > Go to First Page < / s p a n >
< / b u t t o n >
< button id = "lastPage" className = "secondaryToolbarButton" title = "Go to Last Page" tabIndex = { 57 } data - l10n - id = "pdfjs-last-page-button" >
< span data - l10n - id = "pdfjs-last-page-button-label" > Go to Last Page < / s p a n >
< / b u t t o n >
2023-08-09 10:54:58 +00:00
* / }
2024-05-29 03:35:36 +00:00
< div className = "horizontalToolbarSeparator" / >
< button id = "pageRotateCw" className = "secondaryToolbarButton" title = "Rotate Clockwise" tabIndex = { 58 } data - l10n - id = "pdfjs-page-rotate-cw-button" >
< span data - l10n - id = "pdfjs-page-rotate-cw-button-label" > Rotate Clockwise < / s p a n >
2019-03-09 00:36:14 +00:00
< / b u t t o n >
2024-05-29 03:35:36 +00:00
< button id = "pageRotateCcw" className = "secondaryToolbarButton" title = "Rotate Counterclockwise" tabIndex = { 59 } data - l10n - id = "pdfjs-page-rotate-ccw-button" >
< span data - l10n - id = "pdfjs-page-rotate-ccw-button-label" > Rotate Counterclockwise < / s p a n >
2019-03-09 00:36:14 +00:00
< / b u t t o n >
2024-05-29 03:35:36 +00:00
< div className = "horizontalToolbarSeparator" / >
2023-08-09 10:54:58 +00:00
< div id = "cursorToolButtons" role = "radiogroup" >
2024-05-29 03:35:36 +00:00
< button id = "cursorSelectTool" className = "secondaryToolbarButton toggled" title = "Enable Text Selection Tool" tabIndex = { 60 } data - l10n - id = "pdfjs-cursor-text-select-tool-button" role = "radio" aria - checked = "true" >
< span data - l10n - id = "pdfjs-cursor-text-select-tool-button-label" > Text Selection Tool < / s p a n >
2023-08-09 10:54:58 +00:00
< / b u t t o n >
2024-05-29 03:35:36 +00:00
< button id = "cursorHandTool" className = "secondaryToolbarButton" title = "Enable Hand Tool" tabIndex = { 61 } data - l10n - id = "pdfjs-cursor-hand-tool-button" role = "radio" aria - checked = "false" >
< span data - l10n - id = "pdfjs-cursor-hand-tool-button-label" > Hand Tool < / s p a n >
2023-08-09 10:54:58 +00:00
< / b u t t o n >
< / d i v >
2024-05-29 03:35:36 +00:00
< div className = "horizontalToolbarSeparator" / >
2023-08-09 10:54:58 +00:00
< div id = "scrollModeButtons" role = "radiogroup" >
2024-05-29 03:35:36 +00:00
< button id = "scrollPage" className = "secondaryToolbarButton" title = "Use Page Scrolling" tabIndex = { 62 } data - l10n - id = "pdfjs-scroll-page-button" role = "radio" aria - checked = "false" >
< span data - l10n - id = "pdfjs-scroll-page-button-label" > Page Scrolling < / s p a n >
2023-08-09 10:54:58 +00:00
< / b u t t o n >
2024-05-29 03:35:36 +00:00
< button id = "scrollVertical" className = "secondaryToolbarButton toggled" title = "Use Vertical Scrolling" tabIndex = { 63 } data - l10n - id = "pdfjs-scroll-vertical-button" role = "radio" aria - checked = "true" >
< span data - l10n - id = "pdfjs-scroll-vertical-button-label" > Vertical Scrolling < / s p a n >
2023-08-09 10:54:58 +00:00
< / b u t t o n >
2024-05-29 03:35:36 +00:00
< button id = "scrollHorizontal" className = "secondaryToolbarButton" title = "Use Horizontal Scrolling" tabIndex = { 64 } data - l10n - id = "pdfjs-scroll-horizontal-button" role = "radio" aria - checked = "false" >
< span data - l10n - id = "pdfjs-scroll-horizontal-button-label" > Horizontal Scrolling < / s p a n >
2023-08-09 10:54:58 +00:00
< / b u t t o n >
2024-05-29 03:35:36 +00:00
< button id = "scrollWrapped" className = "secondaryToolbarButton" title = "Use Wrapped Scrolling" tabIndex = { 65 } data - l10n - id = "pdfjs-scroll-wrapped-button" role = "radio" aria - checked = "false" >
< span data - l10n - id = "pdfjs-scroll-wrapped-button-label" > Wrapped Scrolling < / s p a n >
2023-08-09 10:54:58 +00:00
< / b u t t o n >
< / d i v >
2024-05-29 03:35:36 +00:00
< div className = "horizontalToolbarSeparator" / >
2023-08-09 10:54:58 +00:00
< div id = "spreadModeButtons" role = "radiogroup" >
2024-05-29 03:35:36 +00:00
< button id = "spreadNone" className = "secondaryToolbarButton toggled" title = "Do not join page spreads" tabIndex = { 66 } data - l10n - id = "pdfjs-spread-none-button" role = "radio" aria - checked = "true" >
< span data - l10n - id = "pdfjs-spread-none-button-label" > No Spreads < / s p a n >
2023-08-09 10:54:58 +00:00
< / b u t t o n >
2024-05-29 03:35:36 +00:00
< button id = "spreadOdd" className = "secondaryToolbarButton" title = "Join page spreads starting with odd-numbered pages" tabIndex = { 67 } data - l10n - id = "pdfjs-spread-odd-button" role = "radio" aria - checked = "false" >
< span data - l10n - id = "pdfjs-spread-odd-button-label" > Odd Spreads < / s p a n >
2023-08-09 10:54:58 +00:00
< / b u t t o n >
2024-05-29 03:35:36 +00:00
< button id = "spreadEven" className = "secondaryToolbarButton" title = "Join page spreads starting with even-numbered pages" tabIndex = { 68 } data - l10n - id = "pdfjs-spread-even-button" role = "radio" aria - checked = "false" >
< span data - l10n - id = "pdfjs-spread-even-button-label" > Even Spreads < / s p a n >
2023-08-09 10:54:58 +00:00
< / b u t t o n >
< / d i v >
2024-05-29 03:35:36 +00:00
< div className = "horizontalToolbarSeparator" / >
< button id = "documentProperties" className = "secondaryToolbarButton" title = "Document Properties…" tabIndex = { 69 } data - l10n - id = "pdfjs-document-properties-button" aria - controls = "documentPropertiesDialog" >
< span data - l10n - id = "pdfjs-document-properties-button-label" > Document Properties … < / s p a n >
2019-03-09 00:36:14 +00:00
< / b u t t o n >
< / d i v >
2024-05-29 03:35:36 +00:00
< /div> {/ * secondaryToolbar * / }
2019-03-09 00:36:14 +00:00
< div className = "toolbar" >
< div id = "toolbarContainer" >
2020-02-08 01:24:23 +00:00
< div id = "toolbarViewer" >
2023-08-09 10:54:58 +00:00
< div id = "toolbarViewerLeft" >
2024-05-29 03:35:36 +00:00
< button id = "sidebarToggle" className = "toolbarButton" title = "Toggle Sidebar" tabIndex = { 11 } data - l10n - id = "pdfjs-toggle-sidebar-button" aria - expanded = "false" aria - controls = "sidebarContainer" >
< span data - l10n - id = "pdfjs-toggle-sidebar-button-label" > Toggle Sidebar < / s p a n >
2019-03-09 00:36:14 +00:00
< / b u t t o n >
2024-05-29 03:35:36 +00:00
< div className = "toolbarButtonSpacer d-none" / >
< button id = "viewFind" className = "toolbarButton d-none" title = "Find in Document" tabIndex = { 12 } data - l10n - id = "pdfjs-findbar-button" aria - expanded = "false" aria - controls = "findbar" >
< span data - l10n - id = "pdfjs-findbar-button-label" > Find < / s p a n >
2019-03-09 00:36:14 +00:00
< / b u t t o n >
2023-08-09 10:54:58 +00:00
< div className = "splitToolbarButton hiddenSmallView ml-2 d-flex align-items-center" >
< div className = "splitToolbarButtonSeparator mr-2" > < / d i v >
< button id = "firstPage" className = "toolbarButton" title = "Go to First Page" tabIndex = "56" data - l10n - id = "first_page" >
< span data - l10n - id = "first_page_label" > Go to First Page < / s p a n >
< / b u t t o n >
2024-05-29 03:35:36 +00:00
< button className = "toolbarButton" title = "Previous Page" id = "previous" tabIndex = { 13 } data - l10n - id = "pdfjs-previous-button" >
< span data - l10n - id = "pdfjs-previous-button-label" > Previous < / s p a n >
2019-03-09 00:36:14 +00:00
< / b u t t o n >
2023-08-09 10:54:58 +00:00
< input type = "number" id = "pageNumber" className = "toolbarField" title = "Page" defaultValue = "1" min = "1" tabIndex = "15" data - l10n - id = "page" autoComplete = "off" / >
< span id = "numPages" className = "toolbarLabel" > < / s p a n >
2024-05-29 03:35:36 +00:00
< button className = "toolbarButton" title = "Next Page" id = "next" tabIndex = { 14 } data - l10n - id = "pdfjs-next-button" >
< span data - l10n - id = "pdfjs-next-button-label" > Next < / s p a n >
2019-03-09 00:36:14 +00:00
< / b u t t o n >
2023-08-09 10:54:58 +00:00
< button id = "lastPage" className = "toolbarButton" title = "Go to Last Page" tabIndex = "57" data - l10n - id = "last_page" >
< span data - l10n - id = "last_page_label" > Go to Last Page < / s p a n >
< / b u t t o n >
2019-03-09 00:36:14 +00:00
< / d i v >
< / d i v >
2020-02-08 01:24:23 +00:00
< div id = "toolbarViewerRight" className = "sf-hide" >
2023-08-09 10:54:58 +00:00
< div id = "editorModeButtons" className = "splitToolbarButton toggled" role = "radiogroup" >
2024-05-29 03:35:36 +00:00
< button id = "editorHighlight" className = "toolbarButton" hidden disabled = "disabled" title = "Highlight" role = "radio" aria - checked = "false" aria - controls = "editorHighlightParamsToolbar" tabIndex = { 31 } data - l10n - id = "pdfjs-editor-highlight-button" >
< span data - l10n - id = "pdfjs-editor-highlight-button-label" > Highlight < / s p a n >
< / b u t t o n >
< button id = "editorFreeText" className = "toolbarButton" disabled = "disabled" title = "Text" role = "radio" aria - checked = "false" aria - controls = "editorFreeTextParamsToolbar" tabIndex = { 32 } data - l10n - id = "pdfjs-editor-free-text-button" >
< span data - l10n - id = "pdfjs-editor-free-text-button-label" > Text < / s p a n >
< / b u t t o n >
< button id = "editorInk" className = "toolbarButton" disabled = "disabled" title = "Draw" role = "radio" aria - checked = "false" aria - controls = "editorInkParamsToolbar" tabIndex = { 33 } data - l10n - id = "pdfjs-editor-ink-button" >
< span data - l10n - id = "pdfjs-editor-ink-button-label" > Draw < / s p a n >
2023-08-09 10:54:58 +00:00
< / b u t t o n >
2024-05-29 03:35:36 +00:00
< button id = "editorStamp" className = "toolbarButton hidden" disabled = "disabled" title = "Add or edit images" role = "radio" aria - checked = "false" aria - controls = "editorStampParamsToolbar" tabIndex = { 34 } data - l10n - id = "pdfjs-editor-stamp-button" >
< span data - l10n - id = "pdfjs-editor-stamp-button-label" > Add or edit images < / s p a n >
2023-08-09 10:54:58 +00:00
< / b u t t o n >
< / d i v >
2024-05-29 03:35:36 +00:00
< div id = "editorModeSeparator" className = "verticalToolbarSeparator" / >
2023-08-09 10:54:58 +00:00
2024-05-29 03:35:36 +00:00
< button id = "print" className = "toolbarButton hiddenMediumView" title = "Print" tabIndex = { 41 } data - l10n - id = "pdfjs-print-button" >
< span data - l10n - id = "pdfjs-print-button-label" > Print < / s p a n >
< / b u t t o n >
< button id = "download" className = "toolbarButton hiddenMediumView" title = "Save" tabIndex = { 42 } data - l10n - id = "pdfjs-save-button" >
< span data - l10n - id = "pdfjs-save-button-label" > Save < / s p a n >
< / b u t t o n >
< div className = "verticalToolbarSeparator hiddenMediumView" / >
< button id = "secondaryToolbarToggle" className = "toolbarButton" title = "Tools" tabIndex = { 43 } data - l10n - id = "pdfjs-tools-button" aria - expanded = "false" aria - controls = "secondaryToolbar" >
< span data - l10n - id = "pdfjs-tools-button-label" > Tools < / s p a n >
2019-03-09 00:36:14 +00:00
< / b u t t o n >
< / d i v >
2023-08-09 10:54:58 +00:00
< div id = "toolbarViewerMiddle" className = "d-flex align-items-center" >
< div className = "splitToolbarButton float-none" >
2024-05-29 03:35:36 +00:00
< button id = "zoomOut" className = "toolbarButton" title = "Zoom Out" tabIndex = { 21 } data - l10n - id = "pdfjs-zoom-out-button" >
< span data - l10n - id = "pdfjs-zoom-out-button-label" > Zoom Out < / s p a n >
2023-08-09 10:54:58 +00:00
< / b u t t o n >
2024-05-29 03:35:36 +00:00
< div className = "splitToolbarButtonSeparator d-none" / >
2019-03-09 00:36:14 +00:00
< / d i v >
2024-05-29 03:35:36 +00:00
< span id = "scaleSelectContainer" className = "dropdownToolbarButton" >
< select id = "scaleSelect" title = "Zoom" tabIndex = { 23 } data - l10n - id = "pdfjs-zoom-select" >
< option id = "pageAutoOption" value = "auto" defaultValue = { 'auto' } data - l10n - id = "pdfjs-page-scale-auto" > Automatic Zoom < / o p t i o n >
< option id = "pageActualOption" value = "page-actual" data - l10n - id = "pdfjs-page-scale-actual" > Actual Size < / o p t i o n >
< option id = "pageFitOption" value = "page-fit" data - l10n - id = "pdfjs-page-scale-fit" > Page Fit < / o p t i o n >
< option id = "pageWidthOption" value = "page-width" data - l10n - id = "pdfjs-page-scale-width" > Page Width < / o p t i o n >
< option id = "customScaleOption" value = "custom" disabled = "disabled" hidden = { true } data - l10n - id = "pdfjs-page-scale-percent" data - l10n - args = "{ scale: 0 }" > 0 % < / o p t i o n >
< option value = "0.5" data - l10n - id = "pdfjs-page-scale-percent" data - l10n - args = "{ scale: 50 }" > 50 % < / o p t i o n >
< option value = "0.75" data - l10n - id = "pdfjs-page-scale-percent" data - l10n - args = "{ scale: 75 }" > 75 % < / o p t i o n >
< option value = { 1 } data - l10n - id = "pdfjs-page-scale-percent" data - l10n - args = "{ scale: 100 }" > 100 % < / o p t i o n >
< option value = "1.25" data - l10n - id = "pdfjs-page-scale-percent" data - l10n - args = "{ scale: 125 }" > 125 % < / o p t i o n >
< option value = "1.5" data - l10n - id = "pdfjs-page-scale-percent" data - l10n - args = "{ scale: 150 }" > 150 % < / o p t i o n >
< option value = { 2 } data - l10n - id = "pdfjs-page-scale-percent" data - l10n - args = "{ scale: 200 }" > 200 % < / o p t i o n >
< option value = { 3 } data - l10n - id = "pdfjs-page-scale-percent" data - l10n - args = "{ scale: 300 }" > 300 % < / o p t i o n >
< option value = { 4 } data - l10n - id = "pdfjs-page-scale-percent" data - l10n - args = "{ scale: 400 }" > 400 % < / o p t i o n >
2019-03-09 00:36:14 +00:00
< / s e l e c t >
2024-05-29 03:35:36 +00:00
< / s p a n >
< button id = "zoomIn" className = "toolbarButton" title = "Zoom In" tabIndex = { 22 } data - l10n - id = "pdfjs-zoom-in-button" >
< span data - l10n - id = "pdfjs-zoom-in-button-label" > Zoom In < / s p a n >
< / b u t t o n >
2019-03-09 00:36:14 +00:00
< / d i v >
< / d i v >
< div id = "loadingBar" >
2023-08-11 07:17:10 +00:00
< span className = "loading-icon loading-tip" > < / s p a n >
{ / * < d i v c l a s s N a m e = " p r o g r e s s " >
2024-05-29 03:35:36 +00:00
< div className = "glimmer" >
< /div>*/ }
2019-03-09 00:36:14 +00:00
< / d i v >
< / d i v >
< / d i v >
2024-05-29 03:35:36 +00:00
< div id = "viewerContainer" tabIndex = { 0 } >
< div id = "viewer" className = "pdfViewer" / >
2019-03-09 00:36:14 +00:00
< / d i v >
2024-05-29 03:35:36 +00:00
< /div> {/ * mainContainer * / }
2019-03-09 00:36:14 +00:00
2023-08-09 10:54:58 +00:00
< div id = "dialogContainer" >
< dialog id = "passwordDialog" >
< div className = "row" >
2024-05-29 03:35:36 +00:00
< label htmlFor = "password" id = "passwordText" data - l10n - id = "pdfjs-password-label" > Enter the password to open this PDF file : < / l a b e l >
2019-03-09 00:36:14 +00:00
< / d i v >
2023-08-09 10:54:58 +00:00
< div className = "row" >
< input type = "password" id = "password" className = "toolbarField" / >
2019-03-09 00:36:14 +00:00
< / d i v >
2023-08-09 10:54:58 +00:00
< div className = "buttonRow" >
2024-05-29 03:35:36 +00:00
< button id = "passwordCancel" className = "dialogButton" > < span data - l10n - id = "pdfjs-password-cancel-button" > Cancel < / s p a n > < / b u t t o n >
< button id = "passwordSubmit" className = "dialogButton" > < span data - l10n - id = "pdfjs-password-ok-button" > OK < / s p a n > < / b u t t o n >
2019-03-09 00:36:14 +00:00
< / d i v >
2023-08-09 10:54:58 +00:00
< / d i a l o g >
< dialog id = "documentPropertiesDialog" >
< div className = "row" >
2024-05-29 03:35:36 +00:00
< span id = "fileNameLabel" data - l10n - id = "pdfjs-document-properties-file-name" > File name : < / s p a n >
2023-08-09 10:54:58 +00:00
< p id = "fileNameField" aria - labelledby = "fileNameLabel" > - < / p >
< / d i v >
< div className = "row" >
2024-05-29 03:35:36 +00:00
< span id = "fileSizeLabel" data - l10n - id = "pdfjs-document-properties-file-size" > File size : < / s p a n >
2023-08-09 10:54:58 +00:00
< p id = "fileSizeField" aria - labelledby = "fileSizeLabel" > - < / p >
< / d i v >
2024-05-29 03:35:36 +00:00
< div className = "separator" / >
2023-08-09 10:54:58 +00:00
< div className = "row" >
2024-05-29 03:35:36 +00:00
< span id = "titleLabel" data - l10n - id = "pdfjs-document-properties-title" > Title : < / s p a n >
2023-08-09 10:54:58 +00:00
< p id = "titleField" aria - labelledby = "titleLabel" > - < / p >
< / d i v >
< div className = "row" >
2024-05-29 03:35:36 +00:00
< span id = "authorLabel" data - l10n - id = "pdfjs-document-properties-author" > Author : < / s p a n >
2023-08-09 10:54:58 +00:00
< p id = "authorField" aria - labelledby = "authorLabel" > - < / p >
< / d i v >
< div className = "row" >
2024-05-29 03:35:36 +00:00
< span id = "subjectLabel" data - l10n - id = "pdfjs-document-properties-subject" > Subject : < / s p a n >
2023-08-09 10:54:58 +00:00
< p id = "subjectField" aria - labelledby = "subjectLabel" > - < / p >
< / d i v >
< div className = "row" >
2024-05-29 03:35:36 +00:00
< span id = "keywordsLabel" data - l10n - id = "pdfjs-document-properties-keywords" > Keywords : < / s p a n >
2023-08-09 10:54:58 +00:00
< p id = "keywordsField" aria - labelledby = "keywordsLabel" > - < / p >
< / d i v >
< div className = "row" >
2024-05-29 03:35:36 +00:00
< span id = "creationDateLabel" data - l10n - id = "pdfjs-document-properties-creation-date" > Creation Date : < / s p a n >
2023-08-09 10:54:58 +00:00
< p id = "creationDateField" aria - labelledby = "creationDateLabel" > - < / p >
< / d i v >
< div className = "row" >
2024-05-29 03:35:36 +00:00
< span id = "modificationDateLabel" data - l10n - id = "pdfjs-document-properties-modification-date" > Modification Date : < / s p a n >
2023-08-09 10:54:58 +00:00
< p id = "modificationDateField" aria - labelledby = "modificationDateLabel" > - < / p >
< / d i v >
< div className = "row" >
2024-05-29 03:35:36 +00:00
< span id = "creatorLabel" data - l10n - id = "pdfjs-document-properties-creator" > Creator : < / s p a n >
2023-08-09 10:54:58 +00:00
< p id = "creatorField" aria - labelledby = "creatorLabel" > - < / p >
< / d i v >
2024-05-29 03:35:36 +00:00
< div className = "separator" / >
2023-08-09 10:54:58 +00:00
< div className = "row" >
2024-05-29 03:35:36 +00:00
< span id = "producerLabel" data - l10n - id = "pdfjs-document-properties-producer" > PDF Producer : < / s p a n >
2023-08-09 10:54:58 +00:00
< p id = "producerField" aria - labelledby = "producerLabel" > - < / p >
< / d i v >
< div className = "row" >
2024-05-29 03:35:36 +00:00
< span id = "versionLabel" data - l10n - id = "pdfjs-document-properties-version" > PDF Version : < / s p a n >
2023-08-09 10:54:58 +00:00
< p id = "versionField" aria - labelledby = "versionLabel" > - < / p >
< / d i v >
< div className = "row" >
2024-05-29 03:35:36 +00:00
< span id = "pageCountLabel" data - l10n - id = "pdfjs-document-properties-page-count" > Page Count : < / s p a n >
2023-08-09 10:54:58 +00:00
< p id = "pageCountField" aria - labelledby = "pageCountLabel" > - < / p >
< / d i v >
< div className = "row" >
2024-05-29 03:35:36 +00:00
< span id = "pageSizeLabel" data - l10n - id = "pdfjs-document-properties-page-size" > Page Size : < / s p a n >
2023-08-09 10:54:58 +00:00
< p id = "pageSizeField" aria - labelledby = "pageSizeLabel" > - < / p >
< / d i v >
2024-05-29 03:35:36 +00:00
< div className = "separator" / >
2023-08-09 10:54:58 +00:00
< div className = "row" >
2024-05-29 03:35:36 +00:00
< span id = "linearizedLabel" data - l10n - id = "pdfjs-document-properties-linearized" > Fast Web View : < / s p a n >
2023-08-09 10:54:58 +00:00
< p id = "linearizedField" aria - labelledby = "linearizedLabel" > - < / p >
< / d i v >
< div className = "buttonRow" >
2024-05-29 03:35:36 +00:00
< button id = "documentPropertiesClose" className = "dialogButton" > < span data - l10n - id = "pdfjs-document-properties-close-button" > Close < / s p a n > < / b u t t o n >
< / d i v >
< / d i a l o g >
< dialog id = "altTextDialog" aria - labelledby = "dialogLabel" aria - describedby = "dialogDescription" >
< div id = "altTextContainer" >
< div id = "overallDescription" >
< span id = "dialogLabel" data - l10n - id = "pdfjs-editor-alt-text-dialog-label" className = "title" > Choose an option < / s p a n >
< span id = "dialogDescription" data - l10n - id = "pdfjs-editor-alt-text-dialog-description" >
Alt text ( alternative text ) helps when people can ’ t see the image or when it doesn ’ t load .
< / s p a n >
< / d i v >
< div id = "addDescription" >
< div className = "radio" >
< div className = "radioButton" >
< input type = "radio" id = "descriptionButton" name = "altTextOption" tabIndex = { 0 } aria - describedby = "descriptionAreaLabel" defaultChecked / >
< label htmlFor = "descriptionButton" data - l10n - id = "pdfjs-editor-alt-text-add-description-label" > Add a description < / l a b e l >
< / d i v >
< div className = "radioLabel" >
< span id = "descriptionAreaLabel" data - l10n - id = "pdfjs-editor-alt-text-add-description-description" >
Aim for 1 - 2 sentences that describe the subject , setting , or actions .
< / s p a n >
< / d i v >
< / d i v >
< div className = "descriptionArea" >
< textarea id = "descriptionTextarea" placeholder = "For example, “A young man sits down at a table to eat a meal”" aria - labelledby = "descriptionAreaLabel" data - l10n - id = "pdfjs-editor-alt-text-textarea" tabIndex = { 0 } defaultValue = { '' } / >
< / d i v >
< / d i v >
< div id = "markAsDecorative" >
< div className = "radio" >
< div className = "radioButton" >
< input type = "radio" id = "decorativeButton" name = "altTextOption" aria - describedby = "decorativeLabel" / >
< label htmlFor = "decorativeButton" data - l10n - id = "pdfjs-editor-alt-text-mark-decorative-label" > Mark as decorative < / l a b e l >
< / d i v >
< div className = "radioLabel" >
< span id = "decorativeLabel" data - l10n - id = "pdfjs-editor-alt-text-mark-decorative-description" >
This is used for ornamental images , like borders or watermarks .
< / s p a n >
< / d i v >
< / d i v >
< / d i v >
< div id = "buttons" >
< button id = "altTextCancel" tabIndex = { 0 } > < span data - l10n - id = "pdfjs-editor-alt-text-cancel-button" > Cancel < / s p a n > < / b u t t o n >
< button id = "altTextSave" tabIndex = { 0 } > < span data - l10n - id = "pdfjs-editor-alt-text-save-button" > Save < / s p a n > < / b u t t o n >
< / d i v >
2023-08-09 10:54:58 +00:00
< / d i v >
< / d i a l o g >
< dialog id = "printServiceDialog" style = { { minWidth : '200px' } } >
< div className = "row" >
2024-05-29 03:35:36 +00:00
< span data - l10n - id = "pdfjs-print-progress-message" > Preparing document for printing … < / s p a n >
2023-08-09 10:54:58 +00:00
< / d i v >
< div className = "row" >
2024-05-29 03:35:36 +00:00
< progress value = { 0 } max = { 100 } / >
< span data - l10n - id = "pdfjs-print-progress-percent" data - l10n - args = "{ progress: 0 }" className = "relative-progress" > 0 % < / s p a n >
2023-08-09 10:54:58 +00:00
< / d i v >
< div className = "buttonRow" >
2024-05-29 03:35:36 +00:00
< button id = "printCancel" className = "dialogButton" > < span data - l10n - id = "pdfjs-print-progress-close-button" > Cancel < / s p a n > < / b u t t o n >
2023-08-09 10:54:58 +00:00
< / d i v >
< / d i a l o g >
2024-05-29 03:35:36 +00:00
< /div> {/ * dialogContainer * / }
2019-03-09 00:36:14 +00:00
2024-05-29 03:35:36 +00:00
< /div> {/ * outerContainer * / }
2023-08-09 10:54:58 +00:00
{ /*<div id="printContainer"></div>*/ }
< input type = "file" id = "fileInput" className = "hidden" / >
2019-03-09 00:36:14 +00:00
< / R e a c t . F r a g m e n t >
) ;
}
}
export default PDFViewer ;