Updated pdfviewer plugin to latest version of pdf.js
|
@ -44,6 +44,9 @@ or the YUI Compressor [2].
|
|||
$ <roundcubedir>/bin/jsshrink.sh viewer/pdf.js ECMASCRIPT5
|
||||
$ <roundcubedir>/bin/jsshrink.sh viewer/viewer.js ECMASCRIPT5
|
||||
|
||||
This will create minimized versions in viewer/*.min.js which are
|
||||
linked by the viewer.html template.
|
||||
|
||||
[1] http://closure-compiler.googlecode.com/
|
||||
[2] http://developer.yahoo.com/yui/compressor/
|
||||
|
||||
|
|
|
@ -1,57 +1,69 @@
|
|||
--- viewer/viewer.html.orig 2013-10-03 14:06:24.000000000 +0200
|
||||
+++ viewer/viewer.html 2013-10-03 13:53:17.000000000 +0200
|
||||
@@ -31,7 +31,7 @@
|
||||
--- viewer/viewer.html.orig 2014-01-20 16:22:49.000000000 +0100
|
||||
+++ viewer/viewer.html 2014-01-20 16:38:37.000000000 +0100
|
||||
@@ -31,12 +31,12 @@
|
||||
<!-- This snippet is used in production, see Makefile -->
|
||||
<link rel="resource" type="application/l10n" href="locale/locale.properties"/>
|
||||
<script type="text/javascript" src="l10n.js"></script>
|
||||
-<script type="text/javascript" src="../build/pdf.js"></script>
|
||||
+<script type="text/javascript" src="pdf.js"></script>
|
||||
+<script type="text/javascript" src="pdf.min.js"></script>
|
||||
|
||||
|
||||
|
||||
@@ -88,18 +88,10 @@
|
||||
<script type="text/javascript" src="debugger.js"></script>
|
||||
- <script type="text/javascript" src="viewer.js"></script>
|
||||
+ <script type="text/javascript" src="viewer.min.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
<span data-l10n-id="presentation_mode_label">Presentation Mode</span>
|
||||
</button>
|
||||
|
||||
- <button id="secondaryOpenFile" class="secondaryToolbarButton openFile visibleLargeView" title="Open File" tabindex="19" data-l10n-id="open_file">
|
||||
- <span data-l10n-id="open_file_label">Open</span>
|
||||
- </button>
|
||||
-
|
||||
<button id="secondaryPrint" class="secondaryToolbarButton print visibleMediumView" title="Print" tabindex="20" data-l10n-id="print">
|
||||
+ <button id="secondaryOpenFile" class="secondaryToolbarButton openFile hidden" title="Open File" tabindex="19" data-l10n-id="open_file">
|
||||
<span data-l10n-id="open_file_label">Open</span>
|
||||
</button>
|
||||
|
||||
@@ -96,11 +96,11 @@
|
||||
<span data-l10n-id="print_label">Print</span>
|
||||
</button>
|
||||
|
||||
- <button id="secondaryDownload" class="secondaryToolbarButton download visibleMediumView" title="Download" tabindex="21" data-l10n-id="download">
|
||||
- <span data-l10n-id="download_label">Download</span>
|
||||
- </button>
|
||||
-
|
||||
<div class="horizontalToolbarSeparator visibleLargeView"></div>
|
||||
+ <button id="secondaryDownload" class="secondaryToolbarButton download hidden" title="Download" tabindex="21" data-l10n-id="download">
|
||||
<span data-l10n-id="download_label">Download</span>
|
||||
</button>
|
||||
|
||||
<button id="firstPage" class="secondaryToolbarButton firstPage" title="Go to First Page" tabindex="22" data-l10n-id="first_page">
|
||||
@@ -150,20 +142,10 @@
|
||||
- <a href="#" id="secondaryViewBookmark" class="secondaryToolbarButton bookmark visibleSmallView" title="Current view (copy or open in new window)" tabindex="22" data-l10n-id="bookmark">
|
||||
+ <a href="#" id="secondaryViewBookmark" class="secondaryToolbarButton bookmark hidden" title="Current view (copy or open in new window)" tabindex="22" data-l10n-id="bookmark">
|
||||
<span data-l10n-id="bookmark_label">Current View</span>
|
||||
</a>
|
||||
|
||||
@@ -159,7 +159,7 @@
|
||||
<span data-l10n-id="presentation_mode_label">Presentation Mode</span>
|
||||
</button>
|
||||
|
||||
- <button id="openFile" class="toolbarButton openFile hiddenLargeView" title="Open File" tabindex="13" data-l10n-id="open_file">
|
||||
- <span data-l10n-id="open_file_label">Open</span>
|
||||
- </button>
|
||||
-
|
||||
<button id="print" class="toolbarButton print hiddenMediumView" title="Print" tabindex="14" data-l10n-id="print">
|
||||
+ <button id="openFile" class="toolbarButton openFile hidden" title="Open File" tabindex="13" data-l10n-id="open_file">
|
||||
<span data-l10n-id="open_file_label">Open</span>
|
||||
</button>
|
||||
|
||||
@@ -167,11 +167,11 @@
|
||||
<span data-l10n-id="print_label">Print</span>
|
||||
</button>
|
||||
|
||||
- <button id="download" class="toolbarButton download hiddenMediumView" title="Download" tabindex="15" data-l10n-id="download">
|
||||
- <span data-l10n-id="download_label">Download</span>
|
||||
- </button>
|
||||
- <!-- <div class="toolbarButtonSpacer"></div> -->
|
||||
- <a href="#" id="viewBookmark" class="toolbarButton bookmark hiddenSmallView" title="Current view (copy or open in new window)" tabindex="16" data-l10n-id="bookmark"><span data-l10n-id="bookmark_label">Current View</span></a>
|
||||
-
|
||||
<div class="verticalToolbarSeparator hiddenSmallView"></div>
|
||||
+ <button id="download" class="toolbarButton download hidden" title="Download" tabindex="15" data-l10n-id="download">
|
||||
<span data-l10n-id="download_label">Download</span>
|
||||
</button>
|
||||
<!-- <div class="toolbarButtonSpacer"></div> -->
|
||||
- <a href="#" id="viewBookmark" class="toolbarButton bookmark hiddenSmallView" title="Current view (copy or open in new window)" tabindex="16" data-l10n-id="bookmark">
|
||||
+ <a href="#" id="viewBookmark" class="toolbarButton bookmark hidden" title="Current view (copy or open in new window)" tabindex="16" data-l10n-id="bookmark">
|
||||
<span data-l10n-id="bookmark_label">Current View</span>
|
||||
</a>
|
||||
|
||||
<button id="secondaryToolbarToggle" class="toolbarButton" title="Tools" tabindex="17" data-l10n-id="tools">
|
||||
--- viewer/viewer.js.orig 2013-10-03 14:06:30.000000000 +0200
|
||||
+++ viewer/viewer.js 2013-10-03 14:06:00.000000000 +0200
|
||||
@@ -22,7 +22,7 @@
|
||||
--- viewer/viewer.js.orig 2014-01-20 16:22:49.000000000 +0100
|
||||
+++ viewer/viewer.js 2014-01-20 16:32:24.000000000 +0100
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
|
@ -60,7 +72,7 @@
|
|||
var DEFAULT_SCALE = 'auto';
|
||||
var DEFAULT_SCALE_DELTA = 1.1;
|
||||
var UNKNOWN_SCALE = 0;
|
||||
@@ -49,7 +49,7 @@
|
||||
@@ -55,7 +55,7 @@
|
||||
};
|
||||
|
||||
PDFJS.imageResourcesPath = './images/';
|
||||
|
@ -69,19 +81,19 @@
|
|||
|
||||
var mozL10n = document.mozL10n || document.webL10n;
|
||||
|
||||
@@ -1313,9 +1313,9 @@
|
||||
|
||||
this.presentationMode.addEventListener('click',
|
||||
this.presentationModeClick.bind(this));
|
||||
- this.openFile.addEventListener('click', this.openFileClick.bind(this));
|
||||
+ //this.openFile.addEventListener('click', this.openFileClick.bind(this));
|
||||
this.print.addEventListener('click', this.printClick.bind(this));
|
||||
- this.download.addEventListener('click', this.downloadClick.bind(this));
|
||||
+ //this.download.addEventListener('click', this.downloadClick.bind(this));
|
||||
|
||||
this.firstPage.addEventListener('click', this.firstPageClick.bind(this));
|
||||
this.lastPage.addEventListener('click', this.lastPageClick.bind(this));
|
||||
@@ -3991,8 +3991,8 @@
|
||||
@@ -1581,9 +1581,9 @@
|
||||
// (except for toggleHandTool, hand_tool.js is responsible for it):
|
||||
{ element: this.presentationModeButton,
|
||||
handler: this.presentationModeClick },
|
||||
- { element: this.openFile, handler: this.openFileClick },
|
||||
+ //{ element: this.openFile, handler: this.openFileClick },
|
||||
{ element: this.print, handler: this.printClick },
|
||||
- { element: this.download, handler: this.downloadClick },
|
||||
+ //{ element: this.download, handler: this.downloadClick },
|
||||
{ element: this.firstPage, handler: this.firstPageClick },
|
||||
{ element: this.lastPage, handler: this.lastPageClick },
|
||||
{ element: this.pageRotateCw, handler: this.pageRotateCwClick },
|
||||
@@ -4806,8 +4806,8 @@
|
||||
document.body.appendChild(fileInput);
|
||||
|
||||
if (!window.File || !window.FileReader || !window.FileList || !window.Blob) {
|
||||
|
@ -92,7 +104,7 @@
|
|||
} else {
|
||||
document.getElementById('fileInput').value = null;
|
||||
}
|
||||
@@ -4147,14 +4147,14 @@
|
||||
@@ -4970,14 +4970,14 @@
|
||||
document.getElementById('presentationMode').addEventListener('click',
|
||||
SecondaryToolbar.presentationModeClick.bind(SecondaryToolbar));
|
||||
|
||||
|
@ -109,29 +121,5 @@
|
|||
+// document.getElementById('download').addEventListener('click',
|
||||
+// SecondaryToolbar.downloadClick.bind(SecondaryToolbar));
|
||||
|
||||
document.getElementById('contextFirstPage').addEventListener('click',
|
||||
SecondaryToolbar.firstPageClick.bind(SecondaryToolbar));
|
||||
@@ -4229,8 +4229,8 @@
|
||||
store.set('scrollLeft', Math.round(topLeft[0]));
|
||||
store.set('scrollTop', Math.round(topLeft[1]));
|
||||
});
|
||||
- var href = PDFView.getAnchorUrl(pdfOpenParams);
|
||||
- document.getElementById('viewBookmark').href = href;
|
||||
+ //var href = PDFView.getAnchorUrl(pdfOpenParams);
|
||||
+ //document.getElementById('viewBookmark').href = href;
|
||||
|
||||
// Update the current bookmark in the browsing history.
|
||||
PDFHistory.updateCurrentBookmark(pdfOpenParams, pageNumber);
|
||||
@@ -4273,9 +4273,9 @@
|
||||
PDFView.setTitleUsingUrl(file.name);
|
||||
|
||||
// URL does not reflect proper document location - hiding some icons.
|
||||
- document.getElementById('viewBookmark').setAttribute('hidden', 'true');
|
||||
- document.getElementById('download').setAttribute('hidden', 'true');
|
||||
- document.getElementById('secondaryDownload').setAttribute('hidden', 'true');
|
||||
+ //document.getElementById('viewBookmark').setAttribute('hidden', 'true');
|
||||
+ //document.getElementById('download').setAttribute('hidden', 'true');
|
||||
+ //document.getElementById('secondaryDownload').setAttribute('hidden', 'true');
|
||||
}, true);
|
||||
|
||||
function selectScaleOption(value) {
|
||||
PDFView.open(file, 0);
|
||||
|
|
|
@ -361,12 +361,16 @@ if (typeof PDFJS === 'undefined') {
|
|||
if (index >= 0 && remove)
|
||||
list.splice(index, 1);
|
||||
element.className = list.join(' ');
|
||||
return (index >= 0);
|
||||
}
|
||||
|
||||
var classListPrototype = {
|
||||
add: function(name) {
|
||||
changeList(this.element, name, true, false);
|
||||
},
|
||||
contains: function(name) {
|
||||
return changeList(this.element, name, false, false);
|
||||
},
|
||||
remove: function(name) {
|
||||
changeList(this.element, name, false, true);
|
||||
},
|
||||
|
@ -438,6 +442,14 @@ if (typeof PDFJS === 'undefined') {
|
|||
}
|
||||
})();
|
||||
|
||||
// Checks if possible to use URL.createObjectURL()
|
||||
(function checkOnBlobSupport() {
|
||||
// sometimes IE loosing the data created with createObjectURL(), see #3977
|
||||
if (navigator.userAgent.indexOf('Trident') >= 0) {
|
||||
PDFJS.disableCreateObjectURL = true;
|
||||
}
|
||||
})();
|
||||
|
||||
// Checks if navigator.language is supported
|
||||
(function checkNavigatorLanguage() {
|
||||
if ('language' in navigator)
|
||||
|
|
|
@ -240,6 +240,8 @@ var Stepper = (function StepperClosure() {
|
|||
return out;
|
||||
}
|
||||
|
||||
var opMap = null;
|
||||
|
||||
var glyphCommands = {
|
||||
'showText': 0,
|
||||
'showSpacedText': 0,
|
||||
|
@ -271,6 +273,12 @@ var Stepper = (function StepperClosure() {
|
|||
headerRow.appendChild(c('th', 'args'));
|
||||
panel.appendChild(content);
|
||||
this.table = table;
|
||||
if (!opMap) {
|
||||
opMap = Object.create(null);
|
||||
for (var key in PDFJS.OPS) {
|
||||
opMap[PDFJS.OPS[key]] = key;
|
||||
}
|
||||
}
|
||||
},
|
||||
updateOperatorList: function updateOperatorList(operatorList) {
|
||||
var self = this;
|
||||
|
@ -300,7 +308,7 @@ var Stepper = (function StepperClosure() {
|
|||
breakCell.appendChild(cbox);
|
||||
line.appendChild(breakCell);
|
||||
line.appendChild(c('td', i.toString()));
|
||||
var fn = operatorList.fnArray[i];
|
||||
var fn = opMap[operatorList.fnArray[i]];
|
||||
var decArgs = args;
|
||||
if (fn in glyphCommands) {
|
||||
var glyphIndex = glyphCommands[fn];
|
||||
|
|
Before Width: | Height: | Size: 371 B After Width: | Height: | Size: 272 B |
Before Width: | Height: | Size: 381 B After Width: | Height: | Size: 268 B |
Before Width: | Height: | Size: 381 B After Width: | Height: | Size: 268 B |
Before Width: | Height: | Size: 371 B After Width: | Height: | Size: 272 B |
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 340 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 315 B |
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 414 B |
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 414 B |
Before Width: | Height: | Size: 454 B After Width: | Height: | Size: 290 B |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 244 B After Width: | Height: | Size: 210 B |
Before Width: | Height: | Size: 512 B After Width: | Height: | Size: 343 B |
Before Width: | Height: | Size: 237 B After Width: | Height: | Size: 200 B |
Before Width: | Height: | Size: 417 B After Width: | Height: | Size: 348 B |
Before Width: | Height: | Size: 558 B After Width: | Height: | Size: 462 B |
Before Width: | Height: | Size: 353 B After Width: | Height: | Size: 296 B |
Before Width: | Height: | Size: 426 B After Width: | Height: | Size: 310 B |
Before Width: | Height: | Size: 344 B After Width: | Height: | Size: 307 B |
Before Width: | Height: | Size: 491 B After Width: | Height: | Size: 450 B |
Before Width: | Height: | Size: 474 B After Width: | Height: | Size: 437 B |
Before Width: | Height: | Size: 503 B After Width: | Height: | Size: 411 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 583 B |
Before Width: | Height: | Size: 302 B After Width: | Height: | Size: 296 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 548 B |
Before Width: | Height: | Size: 349 B After Width: | Height: | Size: 306 B |
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 405 B |
Before Width: | Height: | Size: 300 B After Width: | Height: | Size: 261 B |
Before Width: | Height: | Size: 211 B After Width: | Height: | Size: 182 B |
Before Width: | Height: | Size: 143 B After Width: | Height: | Size: 141 B |
|
@ -42,6 +42,8 @@ bookmark.title=Aktuelle Ansicht (Kopieren oder in einem neuen Fenster öffnen)
|
|||
bookmark_label=Aktuelle Ansicht
|
||||
|
||||
# Secondary toolbar and context menu
|
||||
tools.title=Werkzeuge
|
||||
tools_label=Werkzeuge
|
||||
first_page.title=Erste Seite
|
||||
first_page.label=Erste Seite
|
||||
first_page_label=Erste Seite
|
||||
|
@ -51,9 +53,14 @@ last_page_label=Letzte Seite
|
|||
page_rotate_cw.title=Im Uhrzeigersinn drehen
|
||||
page_rotate_cw.label=Im Uhrzeigersinn drehen
|
||||
page_rotate_cw_label=Im Uhrzeigersinn drehen
|
||||
page_rotate_ccw.title=Entgegen dem Uhrzeigersinn drehen
|
||||
page_rotate_ccw.label=Entgegen dem Uhrzeigersinn drehen
|
||||
page_rotate_ccw_label=Entgegen dem Uhrzeigersinn drehen
|
||||
page_rotate_ccw.title=Gegen den Uhrzeigersinn drehen
|
||||
page_rotate_ccw.label=Gegen den Uhrzeigersinn drehen
|
||||
page_rotate_ccw_label=Gegen den Uhrzeigersinn drehen
|
||||
|
||||
hand_tool_enable.title=Hand-Werkzeug aktivieren
|
||||
hand_tool_enable_label=Hand-Werkzeug aktivieren
|
||||
hand_tool_disable.title=Hand-Werkzeug deaktivieren
|
||||
hand_tool_disable_label=Hand-Werkzeug deaktivieren
|
||||
|
||||
# Tooltips and alt text for side panel toolbar buttons
|
||||
# (the _label strings are alt text for the buttons, the .title strings are
|
||||
|
@ -91,9 +98,9 @@ find_not_found=Ausdruck nicht gefunden
|
|||
error_more_info=Mehr Info
|
||||
error_less_info=Weniger Info
|
||||
error_close=Schließen
|
||||
# LOCALIZATION NOTE (error_build): "{{build}}" will be replaced by the PDF.JS
|
||||
# build ID.
|
||||
error_build=PDF.JS Build: {{build}}
|
||||
# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be
|
||||
# replaced by the PDF.JS version and build ID.
|
||||
error_version_info=PDF.js v{{version}} (build: {{build}})
|
||||
# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an
|
||||
# english string describing the error.
|
||||
error_message=Nachricht: {{message}}
|
||||
|
@ -104,7 +111,7 @@ error_stack=Stack: {{stack}}
|
|||
error_file=Datei: {{file}}
|
||||
# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number
|
||||
error_line=Zeile: {{line}}
|
||||
rendering_error=Das PDF konnte nicht angezeigt werden.
|
||||
rendering_error=Die PDF-Datei konnte nicht angezeigt werden.
|
||||
|
||||
# Predefined zoom values
|
||||
page_scale_width=Seitenbreite
|
||||
|
@ -114,15 +121,21 @@ page_scale_actual=Originalgröße
|
|||
|
||||
# Loading indicator messages
|
||||
loading_error_indicator=Fehler
|
||||
loading_error=Das PDF konnte nicht geladen werden.
|
||||
loading_error=Die PDF-Datei konnte nicht geladen werden.
|
||||
invalid_file_error=Ungültige oder beschädigte PDF-Datei.
|
||||
missing_file_error=Fehlende PDF-Datei.
|
||||
|
||||
# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
|
||||
# "{{type}}" will be replaced with an annotation type from a list defined in
|
||||
# the PDF spec (32000-1:2008 Table 169 – Annotation types).
|
||||
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
|
||||
text_annotation_type.alt=[{{type}} Annotation]
|
||||
request_password=Das PDF ist passwortgeschützt:
|
||||
password_label=Geben Sie das Passwort ein, um diese Datei zu öffnen.
|
||||
password_invalid=Ungültiges Passwort. Versuchen Sie es erneut.
|
||||
password_ok=OK
|
||||
password_cancel=Abbrechen
|
||||
|
||||
printing_not_supported=Warnung: Drucken wird durch diesen Browser nicht vollständig unterstützt.
|
||||
printing_not_ready=Warnung: Die PDF-Datei ist zum Drucken noch nicht vollständig geladen.
|
||||
web_fonts_disabled=Webfonts sind deaktiviert: Eingebundene PDF-Schriftarten können nicht verwendet werden.
|
||||
document_colors_disabled=PDF-Dateien können eigene Farben nicht verwenden: \'Seiten das Verwenden von eigenen Farben erlauben\' ist im Browser deaktiviert.
|
||||
|
|
|
@ -57,6 +57,11 @@ page_rotate_ccw.title=Rotate Counterclockwise
|
|||
page_rotate_ccw.label=Rotate Counterclockwise
|
||||
page_rotate_ccw_label=Rotate Counterclockwise
|
||||
|
||||
hand_tool_enable.title=Enable hand tool
|
||||
hand_tool_enable_label=Enable hand tool
|
||||
hand_tool_disable.title=Disable hand tool
|
||||
hand_tool_disable_label=Disable hand tool
|
||||
|
||||
# Tooltips and alt text for side panel toolbar buttons
|
||||
# (the _label strings are alt text for the buttons, the .title strings are
|
||||
# tooltips)
|
||||
|
|
|
@ -38,10 +38,12 @@ print.title=Imprimir
|
|||
print_label=Imprimir
|
||||
download.title=Descargar
|
||||
download_label=Descargar
|
||||
bookmark.title=Vista actual (copie o abra en una ventana nueva)
|
||||
bookmark.title=Vista actual (para copiar o abrir en otra ventana)
|
||||
bookmark_label=Vista actual
|
||||
|
||||
# Secondary toolbar and context menu
|
||||
tools.title=Herramientas
|
||||
tools_label=Herramientas
|
||||
first_page.title=Ir a la primera página
|
||||
first_page.label=Ir a la primera página
|
||||
first_page_label=Ir a la primera página
|
||||
|
@ -55,6 +57,11 @@ page_rotate_ccw.title=Girar a la izquierda
|
|||
page_rotate_ccw.label=Girar a la izquierda
|
||||
page_rotate_ccw_label=Girar a la izquierda
|
||||
|
||||
hand_tool_enable.title=Activar la herramienta Mano
|
||||
hand_tool_enable_label=Activar la herramienta Mano
|
||||
hand_tool_disable.title=Desactivar la herramienta Mano
|
||||
hand_tool_disable_label=Desactivar la herramienta Mano
|
||||
|
||||
# Tooltips and alt text for side panel toolbar buttons
|
||||
# (the _label strings are alt text for the buttons, the .title strings are
|
||||
# tooltips)
|
||||
|
@ -118,14 +125,17 @@ loading_error=Ocurrió un error al cargar el PDF.
|
|||
invalid_file_error=El archivo PDF no es válido o está dañado.
|
||||
missing_file_error=Falta el archivo PDF.
|
||||
|
||||
# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
|
||||
# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
|
||||
# "{{type}}" will be replaced with an annotation type from a list defined in
|
||||
# the PDF spec (32000-1:2008 Table 169 – Annotation types).
|
||||
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
|
||||
text_annotation_type.alt=[Anotación {{type}}]
|
||||
request_password=El archivo PDF está protegido por una contraseña:
|
||||
password_label=Escriba la contraseña para abrir este archivo PDF.
|
||||
password_invalid=La contraseña no es válida. Inténtelo de nuevo.
|
||||
password_ok=Aceptar
|
||||
password_cancel=Cancelar
|
||||
|
||||
printing_not_supported=Aviso: Este navegador no es compatible completamente con la impresión.
|
||||
printing_not_ready=Aviso: El PDF no se ha cargado completamente para su impresión.
|
||||
web_fonts_disabled=Se han desactivado los tipos de letra web: no se pueden usar los tipos de letra incrustados en el PDF.
|
||||
web_colors_disabled=Se han desactivado los colores web.
|
||||
document_colors_disabled=No se permite que los documentos PDF usen sus propios colores: la opción «Permitir que las páginas elijan sus propios colores» está desactivada en el navegador.
|
||||
|
|
|
@ -23,7 +23,7 @@ next_label=次へ
|
|||
# Do not translate "{{pageCount}}", it will be substituted with a number
|
||||
# representing the total number of pages.
|
||||
page_label=ページ:
|
||||
page_of=of {{pageCount}}
|
||||
page_of=/ {{pageCount}}
|
||||
|
||||
zoom_out.title=縮小
|
||||
zoom_out_label=縮小
|
||||
|
@ -57,6 +57,11 @@ page_rotate_ccw.title=左回転
|
|||
page_rotate_ccw.label=左回転
|
||||
page_rotate_ccw_label=左回転
|
||||
|
||||
hand_tool_enable.title=手のひらツールを有効にする
|
||||
hand_tool_enable_label=手のひらツールを有効にする
|
||||
hand_tool_disable.title=手のひらツールを無効にする
|
||||
hand_tool_disable_label=手のひらツールを無効にする
|
||||
|
||||
# Tooltips and alt text for side panel toolbar buttons
|
||||
# (the _label strings are alt text for the buttons, the .title strings are
|
||||
# tooltips)
|
||||
|
@ -125,8 +130,10 @@ missing_file_error=PDF ファイルが見つかりません。
|
|||
# the PDF spec (32000-1:2008 Table 169 – Annotation types).
|
||||
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
|
||||
text_annotation_type.alt=[{{type}} 注釈]
|
||||
request_password=PDF はパスワードによって保護されています
|
||||
invalid_password=無効なパスワードです
|
||||
password_label=この PDF ファイルを開くためのパスワードを入力してください。
|
||||
password_invalid=無効なパスワードです。もう一度やり直してください。
|
||||
password_ok=OK
|
||||
password_cancel=キャンセル
|
||||
|
||||
printing_not_supported=警告:このブラウザでは印刷が完全にサポートされていません
|
||||
printing_not_ready=警告:PDF を印刷するための読み込みが終了していません
|
||||
|
|
|
@ -70,8 +70,8 @@
|
|||
[sr]
|
||||
@import url(sr/viewer.properties)
|
||||
|
||||
[sv]
|
||||
@import url(sv/viewer.properties)
|
||||
[sv-SE]
|
||||
@import url(sv-SE/viewer.properties)
|
||||
|
||||
[tr]
|
||||
@import url(tr/viewer.properties)
|
||||
|
|
|
@ -57,6 +57,11 @@ page_rotate_ccw.title=Tegen de klok in roteren
|
|||
page_rotate_ccw.label=Tegen de klok in roteren
|
||||
page_rotate_ccw_label=Tegen de klok in roteren
|
||||
|
||||
hand_tool_enable.title=Handcursor inschakelen
|
||||
hand_tool_enable_label=Handcursor inschakelen
|
||||
hand_tool_disable.title=Handcursor uitschakelen
|
||||
hand_tool_disable_label=Handcursor uitschakelen
|
||||
|
||||
# Tooltips and alt text for side panel toolbar buttons
|
||||
# (the _label strings are alt text for the buttons, the .title strings are
|
||||
# tooltips)
|
||||
|
|
|
@ -42,6 +42,8 @@ bookmark.title=当前视图(复制或在新窗口中打开)
|
|||
bookmark_label=当前视图
|
||||
|
||||
# Secondary toolbar and context menu
|
||||
tools.title=工具
|
||||
tools_label=工具
|
||||
first_page.title=转到第一页
|
||||
first_page.label=转到第一页
|
||||
first_page_label=转到第一页
|
||||
|
@ -55,6 +57,11 @@ page_rotate_ccw.title=逆时针旋转
|
|||
page_rotate_ccw.label=逆时针旋转
|
||||
page_rotate_ccw_label=逆时针旋转
|
||||
|
||||
hand_tool_enable.title=启用掌型工具
|
||||
hand_tool_enable_label=启用掌型工具
|
||||
hand_tool_disable.title=禁用掌型工具
|
||||
hand_tool_disable_label=禁用掌型工具
|
||||
|
||||
# Tooltips and alt text for side panel toolbar buttons
|
||||
# (the _label strings are alt text for the buttons, the .title strings are
|
||||
# tooltips)
|
||||
|
@ -123,7 +130,12 @@ missing_file_error=缺失 PDF 文件。
|
|||
# the PDF spec (32000-1:2008 Table 169 – Annotation types).
|
||||
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
|
||||
text_annotation_type.alt=[{{type}} 注解]
|
||||
request_password=该 PDF 文档受密码保护:
|
||||
password_label=输入 PDF 文件的密码。
|
||||
password_invalid=密码无效,请重新输入。
|
||||
password_ok=确定
|
||||
password_cancel=取消
|
||||
|
||||
printing_not_supported=警告:该浏览器不能完全支持打印。
|
||||
printing_not_ready=警告:此 PDF 没有完全被载入以供打印。
|
||||
web_fonts_disabled=Web 页面字体已被禁用,无法使用嵌入到 PDF 中的字体。
|
||||
document_colors_disabled=PDF 文件不被允许使用自己的颜色:\‘允许页面选择自己的颜色’\没有在该浏览器中被激活。
|
||||
|
|
|
@ -57,6 +57,11 @@ page_rotate_ccw.title=逆時針旋轉
|
|||
page_rotate_ccw.label=逆時針旋轉
|
||||
page_rotate_ccw_label=逆時針旋轉
|
||||
|
||||
hand_tool_enable.title=啟用掌型工具
|
||||
hand_tool_enable_label=啟用掌型工具
|
||||
hand_tool_disable.title=停用掌型工具
|
||||
hand_tool_disable_label=停用掌型工具
|
||||
|
||||
# Tooltips and alt text for side panel toolbar buttons
|
||||
# (the _label strings are alt text for the buttons, the .title strings are
|
||||
# tooltips)
|
||||
|
@ -125,8 +130,10 @@ missing_file_error=找不到 PDF 檔案。
|
|||
# the PDF spec (32000-1:2008 Table 169 – Annotation types).
|
||||
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
|
||||
text_annotation_type.alt=[{{type}} 註解]
|
||||
request_password=PDF 已被密碼保護:
|
||||
invalid_password=密碼無效。
|
||||
password_label=請輸入用來開啟此 PDF 檔案的密碼。
|
||||
password_invalid=密碼不正確,請再試一次。
|
||||
password_ok=確定
|
||||
password_cancel=取消
|
||||
|
||||
printing_not_supported=警告: 此瀏覽器未完整支援列印功能。
|
||||
printing_not_ready=警告: 此 PDF 未完成下載以供列印。
|
||||
|
|
178
plugins/pdfviewer/viewer/pdf.min.js
vendored
Normal file
|
@ -0,0 +1,178 @@
|
|||
"undefined"===typeof PDFJS&&(("undefined"!==typeof window?window:this).PDFJS={});PDFJS.version="0.8.894";PDFJS.build="ac91047";
|
||||
(function(){var E,X;function K(b){PDFJS.verbosity>=PDFJS.VERBOSITY_LEVELS.infos&&console.log("Info: "+b)}function x(b){PDFJS.verbosity>=PDFJS.VERBOSITY_LEVELS.warnings&&console.log("Warning: "+b)}function m(b){if(1<arguments.length){var a=["Error:"];a.push.apply(a,arguments);console.log.apply(console,a);b=[].join.call(arguments," ")}else console.log("Error: "+b);console.log(oa());Z.notify(da.unknown);throw Error(b);}function oa(){try{throw Error();}catch(b){return b.stack?b.stack.split("\n").slice(2).join("\n"):
|
||||
""}}function pa(b,a){if(!a)return b;if(0<=a.indexOf(":"))return a;if("/"==a.charAt(0)){var c=b.indexOf("://"),c=b.indexOf("/",c+3);return b.substring(0,c)+a}var e=b.length,c=b.lastIndexOf("#"),e=0<=c?c:e,c=b.lastIndexOf("?",e),c=b.lastIndexOf("/",0<=c?c:e);return b.substring(0,c+1)+a}function $(b,a){if(!b)return!1;var c=b.indexOf(":");if(0>c)return a;switch(b.substr(0,c)){case "http":case "https":case "ftp":case "mailto":return!0;default:return!1}}function U(b,a,c){Object.defineProperty(b,a,{value:c,
|
||||
enumerable:!0,configurable:!0,writable:!1});return c}function V(b){var a,c=b.length,e="";if("\u00fe"===b[0]&&"\u00ff"===b[1])for(a=2;a<c;a+=2)e+=String.fromCharCode(b.charCodeAt(a)<<8|b.charCodeAt(a+1));else for(a=0;a<c;++a)var d=qa[b.charCodeAt(a)],e=e+(d?String.fromCharCode(d):b.charAt(a));return e}function L(b){return"boolean"==typeof b}function P(b){return b instanceof Name}function R(b,a){if(!(b instanceof Dict))return!1;if(!a)return!0;var c=b.get("Type");return P(c)&&c.name==a}function D(b){return b instanceof
|
||||
Array}function Y(b){return"object"==typeof b&&null!==b&&void 0!==b&&"getBytes"in b}function ea(b){if("object"!=typeof b)return!1;if(!R(b))if(Y(b))b=b.dict;else return!1;return b.has("FunctionType")}function aa(b,a){this.name=b;this.comObj=a;this.callbackIndex=1;this.postMessageTransfers=!0;var c=this.callbacks={},e=this.actionHandler={};e.console_log=[function(a){console.log.apply(console,a)}];e.console_error=[function(a){console.error.apply(console,a)}];e._unsupported_feature=[function(a){Z.notify(a)}];
|
||||
a.onmessage=function(d){var b=d.data;if(b.isReply)if(d=b.callbackId,b.callbackId in c){var f=c[d];delete c[d];f(b.data)}else m("Cannot resolve callback "+d);else if(b.action in e)if(d=e[b.action],b.callbackId){var h={},f=new Promise(function(a,c){h.resolve=a;h.reject=c});h.promise=f;f.then(function(c){a.postMessage({isReply:!0,callbackId:b.callbackId,data:c})});d[0].call(d[1],b.data,h)}else d[0].call(d[1],b.data);else m("Unkown action from worker: "+b.action)}}function ra(b,a,c){var e=new Image;e.onload=
|
||||
function(){c.resolve(b,e)};e.src=a}function fa(b,a){var c=document.createElement("canvas");c.width=b;c.height=a;return c}function ga(b){b.mozCurrentTransform||(b._scaleX=b._scaleX||1,b._scaleY=b._scaleY||1,b._originalSave=b.save,b._originalRestore=b.restore,b._originalRotate=b.rotate,b._originalScale=b.scale,b._originalTranslate=b.translate,b._originalTransform=b.transform,b._originalSetTransform=b.setTransform,b._transformMatrix=[b._scaleX,0,0,b._scaleY,0,0],b._transformStack=[],Object.defineProperty(b,
|
||||
"mozCurrentTransform",{get:function(){return this._transformMatrix}}),Object.defineProperty(b,"mozCurrentTransformInverse",{get:function(){var a=this._transformMatrix,c=a[0],e=a[1],d=a[2],b=a[3],f=a[4],a=a[5],h=c*b-e*d,k=e*d-c*b;return[b/h,e/k,d/k,c/h,(b*f-d*a)/k,(e*f-c*a)/h]}}),b.save=function(){var a=this._transformMatrix;this._transformStack.push(a);this._transformMatrix=a.slice(0,6);this._originalSave()},b.restore=function(){var a=this._transformStack.pop();a&&(this._transformMatrix=a,this._originalRestore())},
|
||||
b.translate=function(a,c){var e=this._transformMatrix;e[4]=e[0]*a+e[2]*c+e[4];e[5]=e[1]*a+e[3]*c+e[5];this._originalTranslate(a,c)},b.scale=function(a,c){var e=this._transformMatrix;e[0]*=a;e[1]*=a;e[2]*=c;e[3]*=c;this._originalScale(a,c)},b.transform=function(a,c,e,d,g,f){var h=this._transformMatrix;this._transformMatrix=[h[0]*a+h[2]*c,h[1]*a+h[3]*c,h[0]*e+h[2]*d,h[1]*e+h[3]*d,h[0]*g+h[2]*f+h[4],h[1]*g+h[3]*f+h[5]];b._originalTransform(a,c,e,d,g,f)},b.setTransform=function(a,c,e,d,g,f){this._transformMatrix=
|
||||
[a,c,e,d,g,f];b._originalSetTransform(a,c,e,d,g,f)},b.rotate=function(a){var c=Math.cos(a),e=Math.sin(a),d=this._transformMatrix;this._transformMatrix=[d[0]*c+d[2]*e,d[1]*c+d[3]*e,d[0]*-e+d[2]*c,d[1]*-e+d[3]*c,d[4],d[5]];this._originalRotate(a)})}function sa(b){var a=b.width,c=b.height,e,d,g=a+1,f=new Uint8Array(g*(c+1)),h=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),k=a+7&-8,l=b.data,n=new Uint8Array(k*c),p=0;b=0;for(e=l.length;b<e;b++){d=128;for(var z=l[b];0<d;)n[p++]=z&d?0:255,d>>=1}p=l=
|
||||
0;0!==n[p]&&(f[0]=1,++l);for(e=1;e<a;e++)n[p]!==n[p+1]&&(f[e]=n[p]?2:1,++l),p++;0!==n[p]&&(f[e]=2,++l);for(b=1;b<c;b++){p=b*k;d=b*g;n[p-k]!==n[p]&&(f[d]=n[p]?1:8,++l);z=(n[p]?4:0)+(n[p-k]?8:0);for(e=1;e<a;e++)z=(z>>2)+(n[p+1]?4:0)+(n[p-k+1]?8:0),h[z]&&(f[d+e]=h[z],++l),p++;n[p-k]!==n[p]&&(f[d+e]=n[p]?2:4,++l);if(1E3<l)return null}p=k*(c-1);d=b*g;0!==n[p]&&(f[d]=8,++l);for(e=1;e<a;e++)n[p]!==n[p+1]&&(f[d+e]=n[p]?4:8,++l),p++;0!==n[p]&&(f[d+e]=4,++l);if(1E3<l)return null;var h=new Int32Array([0,g,-1,
|
||||
0,-g,0,0,0,1]),s=[];for(b=0;l&&b<=c;b++){k=b*g;for(n=k+a;k<n&&!f[k];)k++;if(k!==n){n=[k%g,b];p=f[k];e=k;do{d=h[p];do k+=d;while(!f[k]);d=f[k];5!==d&&10!==d?(p=d,f[k]=0):(p=d&51*p>>4,f[k]&=p>>2|p<<2);n.push(k%g);n.push(k/g|0);--l}while(e!==k);s.push(n);--b}}return function(d){d.save();d.scale(1/a,-1/c);d.translate(0,-c);d.beginPath();for(var e=0,k=s.length;e<k;e++){var b=s[e];d.moveTo(b[0],b[1]);for(var g=2,l=b.length;g<l;g+=2)d.lineTo(b[g],b[g+1])}d.fill();d.beginPath();d.restore()}}var t="undefined"===
|
||||
typeof window?this:window,W="undefined"==typeof window,ba=[0.0010,0,0,0.0010,0,0];X=0;t.PDFJS||(t.PDFJS={});t.PDFJS.pdfBug=!1;PDFJS.VERBOSITY_LEVELS={errors:0,warnings:1,infos:5};var y=PDFJS.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,
|
||||
closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,
|
||||
setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,
|
||||
paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87},da=PDFJS.UNSUPPORTED_FEATURES={unknown:"unknown",forms:"forms",javaScript:"javaScript",smask:"smask",shadingPattern:"shadingPattern",font:"font"},Z=PDFJS.UnsupportedManager=function(){var b=[];return{listen:function(a){b.push(a)},notify:function(a){x('Unsupported feature "'+a+'"');for(var c=0,e=b.length;c<e;c++)b[c](a)}}}();PDFJS.isValidUrl=$;var ha=PDFJS.PasswordResponses={NEED_PASSWORD:1,
|
||||
INCORRECT_PASSWORD:2};(function(){function b(a,c){this.name="PasswordException";this.message=a;this.code=c}b.prototype=Error();return b.constructor=b})();(function(){function b(a,c){this.name="UnknownErrorException";this.message=a;this.details=c}b.prototype=Error();return b.constructor=b})();(function(){function b(a){this.name="InvalidPDFException";this.message=a}b.prototype=Error();return b.constructor=b})();(function(){function b(a){this.name="MissingPDFException";this.message=a}b.prototype=Error();
|
||||
return b.constructor=b})();var ta=function(){function b(a){this.message=a}b.prototype=Error();b.prototype.name="NotImplementedException";return b.constructor=b}();(function(){function b(a,c){this.begin=a;this.end=c;this.message="Missing data ["+a+", "+c+")"}b.prototype=Error();b.prototype.name="MissingDataException";return b.constructor=b})();(function(){function b(a){this.message=a}b.prototype=Error();b.prototype.name="XRefParseException";return b.constructor=b})();var ia=[1,0,0,1,0,0],q=PDFJS.Util=
|
||||
function(){function b(){}b.makeCssRgb=function(a){return"rgb("+a[0]+","+a[1]+","+a[2]+")"};b.makeCssCmyk=function(a){a=r.singletons.cmyk.getRgb(a,0);return b.makeCssRgb(a)};b.transform=function(a,c){return[a[0]*c[0]+a[2]*c[1],a[1]*c[0]+a[3]*c[1],a[0]*c[2]+a[2]*c[3],a[1]*c[2]+a[3]*c[3],a[0]*c[4]+a[2]*c[5]+a[4],a[1]*c[4]+a[3]*c[5]+a[5]]};b.applyTransform=function(a,c){return[a[0]*c[0]+a[1]*c[2]+c[4],a[0]*c[1]+a[1]*c[3]+c[5]]};b.applyInverseTransform=function(a,c){var e=c[0]*c[3]-c[1]*c[2];return[(a[0]*
|
||||
c[3]-a[1]*c[2]+c[2]*c[5]-c[4]*c[3])/e,(-a[0]*c[1]+a[1]*c[0]+c[4]*c[1]-c[5]*c[0])/e]};b.getAxialAlignedBoundingBox=function(a,c){var e=b.applyTransform(a,c),d=b.applyTransform(a.slice(2,4),c),g=b.applyTransform([a[0],a[3]],c),f=b.applyTransform([a[2],a[1]],c);return[Math.min(e[0],d[0],g[0],f[0]),Math.min(e[1],d[1],g[1],f[1]),Math.max(e[0],d[0],g[0],f[0]),Math.max(e[1],d[1],g[1],f[1])]};b.inverseTransform=function(a){var c=a[0]*a[3]-a[1]*a[2];return[a[3]/c,-a[1]/c,-a[2]/c,a[0]/c,(a[2]*a[5]-a[4]*a[3])/
|
||||
c,(a[4]*a[1]-a[5]*a[0])/c]};b.apply3dTransform=function(a,c){return[a[0]*c[0]+a[1]*c[1]+a[2]*c[2],a[3]*c[0]+a[4]*c[1]+a[5]*c[2],a[6]*c[0]+a[7]*c[1]+a[8]*c[2]]};b.singularValueDecompose2dScale=function(a){var c=[a[0],a[2],a[1],a[3]],e=a[0]*c[0]+a[1]*c[2],d=a[2]*c[1]+a[3]*c[3],b=(e+d)/2;a=Math.sqrt((e+d)*(e+d)-4*(e*d-(a[2]*c[0]+a[3]*c[2])*(a[0]*c[1]+a[1]*c[3])))/2;c=b-a||1;return[Math.sqrt(b+a||1),Math.sqrt(c)]};b.normalizeRect=function(a){var c=a.slice(0);a[0]>a[2]&&(c[0]=a[2],c[2]=a[0]);a[1]>a[3]&&
|
||||
(c[1]=a[3],c[3]=a[1]);return c};b.intersect=function(a,c){function e(a,c){return a-c}var d=[a[0],a[2],c[0],c[2]].sort(e),g=[a[1],a[3],c[1],c[3]].sort(e),f=[];a=b.normalizeRect(a);c=b.normalizeRect(c);if(d[0]===a[0]&&d[1]===c[0]||d[0]===c[0]&&d[1]===a[0])f[0]=d[1],f[2]=d[2];else return!1;if(g[0]===a[1]&&g[1]===c[1]||g[0]===c[1]&&g[1]===a[1])f[1]=g[1],f[3]=g[2];else return!1;return f};b.sign=function(a){return 0>a?-1:1};b.concatenateToArray=function(a,c){Array.prototype.push.apply(a,c)};b.prependToArray=
|
||||
function(a,c){Array.prototype.unshift.apply(a,c)};b.extendObj=function(a,c){for(var e in c)a[e]=c[e]};b.getInheritableProperty=function(a,c){for(;a&&!a.has(c);)a=a.get("Parent");return a?a.get(c):null};b.inherit=function(a,c,e){a.prototype=Object.create(c.prototype);a.prototype.constructor=a;for(var d in e)a.prototype[d]=e[d]};b.loadScript=function(a,c){var e=document.createElement("script"),d=!1;e.setAttribute("src",a);c&&(e.onload=function(){d||c();d=!0});document.getElementsByTagName("head")[0].appendChild(e)};
|
||||
return b}();PDFJS.PageViewport=function(){function b(a,c,e,d,b,f){this.viewBox=a;this.scale=c;this.rotation=e;this.offsetX=d;this.offsetY=b;var h=(a[2]+a[0])/2,k=(a[3]+a[1])/2,l,n,p;e%=360;switch(0>e?e+360:e){case 180:e=-1;n=l=0;p=1;break;case 90:e=0;n=l=1;p=0;break;case 270:e=0;n=l=-1;p=0;break;default:e=1,n=l=0,p=-1}f&&(n=-n,p=-p);0===e?(d=Math.abs(k-a[1])*c+d,b=Math.abs(h-a[0])*c+b,f=Math.abs(a[3]-a[1])*c,a=Math.abs(a[2]-a[0])*c):(d=Math.abs(h-a[0])*c+d,b=Math.abs(k-a[1])*c+b,f=Math.abs(a[2]-a[0])*
|
||||
c,a=Math.abs(a[3]-a[1])*c);this.transform=[e*c,l*c,n*c,p*c,d-e*c*h-n*c*k,b-l*c*h-p*c*k];this.width=f;this.height=a;this.fontScale=c}b.prototype={clone:function(a){a=a||{};var c="scale"in a?a.scale:this.scale,e="rotation"in a?a.rotation:this.rotation;return new b(this.viewBox.slice(),c,e,this.offsetX,this.offsetY,a.dontFlip)},convertToViewportPoint:function(a,c){return q.applyTransform([a,c],this.transform)},convertToViewportRectangle:function(a){var c=q.applyTransform([a[0],a[1]],this.transform);
|
||||
a=q.applyTransform([a[2],a[3]],this.transform);return[c[0],c[1],a[0],a[1]]},convertToPdfPoint:function(a,c){return q.applyInverseTransform([a,c],this.transform)}};return b}();var qa=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,
|
||||
8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364],G=PDFJS.LegacyPromise=function(){return function(){var b,a,c=new Promise(function(c,d){b=c;a=d});c.resolve=b;c.reject=a;return c}}();(function(){function b(c){this._status=a;this._handlers=[];c.call(this,this._resolve.bind(this),this._reject.bind(this))}if(t.Promise)"function"!==typeof t.Promise.all&&(t.Promise.all=function(a){var c=0,e=[],b,k,l=new t.Promise(function(a,c){b=a;k=c});a.forEach(function(a,
|
||||
d){c++;a.then(function(a){e[d]=a;c--;0===c&&b(e)},k)});0===c&&b(e);return l}),"function"!==typeof t.Promise.resolve&&(t.Promise.resolve=function(a){return new t.Promise(function(c){c(a)})});else{var a=0,c=2,e={handlers:[],running:!1,unhandledRejections:[],pendingRejectionCheck:!1,scheduleHandlers:function(c){c._status!=a&&(this.handlers=this.handlers.concat(c._handlers),c._handlers=[],this.running||(this.running=!0,setTimeout(this.runHandlers.bind(this),0)))},runHandlers:function(){for(var a=Date.now()+
|
||||
1;0<this.handlers.length;){var e=this.handlers.shift(),b=e.thisPromise._status,h=e.thisPromise._value;try{1===b?"function"==typeof e.onResolve&&(h=e.onResolve(h)):"function"===typeof e.onReject&&(h=e.onReject(h),b=1,e.thisPromise._unhandledRejection&&this.removeUnhandeledRejection(e.thisPromise))}catch(k){b=c,h=k}e.nextPromise._updateStatus(b,h);if(Date.now()>=a)break}0<this.handlers.length?setTimeout(this.runHandlers.bind(this),0):this.running=!1},addUnhandledRejection:function(a){this.unhandledRejections.push({promise:a,
|
||||
time:Date.now()});this.scheduleRejectionCheck()},removeUnhandeledRejection:function(a){a._unhandledRejection=!1;for(var c=0;c<this.unhandledRejections.length;c++)this.unhandledRejections[c].promise===a&&(this.unhandledRejections.splice(c),c--)},scheduleRejectionCheck:function(){this.pendingRejectionCheck||(this.pendingRejectionCheck=!0,setTimeout(function(){this.pendingRejectionCheck=!1;for(var a=Date.now(),c=0;c<this.unhandledRejections.length;c++)if(500<a-this.unhandledRejections[c].time){var e=
|
||||
this.unhandledRejections[c].promise._value,b="Unhandled rejection: "+e;e.stack&&(b+="\n"+e.stack);x(b);this.unhandledRejections.splice(c);c--}this.unhandledRejections.length&&this.scheduleRejectionCheck()}.bind(this),500))}};b.all=function(a){function e(a){k._status!==c&&(n=[],h(a))}var f,h,k=new b(function(a,c){f=a;h=c}),l=a.length,n=[];if(0===l)return f(n),k;for(var p=0,z=a.length;p<z;++p){var s=a[p],w=function(a){return function(e){k._status!==c&&(n[a]=e,l--,0===l&&f(n))}}(p);b.isPromise(s)?s.then(w,
|
||||
e):w(s)}return k};b.isPromise=function(a){return a&&"function"===typeof a.then};b.resolve=function(a){return new b(function(c){c(a)})};b.prototype={_status:null,_value:null,_handlers:null,_unhandledRejection:null,_updateStatus:function(a,g){1!==this._status&&this._status!==c&&(1==a&&b.isPromise(g)?g.then(this._updateStatus.bind(this,1),this._updateStatus.bind(this,c)):(this._status=a,this._value=g,a===c&&0===this._handlers.length&&(this._unhandledRejection=!0,e.addUnhandledRejection(this)),e.scheduleHandlers(this)))},
|
||||
_resolve:function(a){this._updateStatus(1,a)},_reject:function(a){this._updateStatus(c,a)},then:function(a,c){var f=new b(function(a,c){this.reject=this.resolve=c});this._handlers.push({thisPromise:this,onResolve:a,onReject:c,nextPromise:f});e.scheduleHandlers(this);return f}};t.Promise=b}})();var ua=function(){function b(){this.started={};this.times=[];this.enabled=!0}b.prototype={time:function(a){this.enabled&&(a in this.started&&x("Timer is already running for "+a),this.started[a]=Date.now())},
|
||||
timeEnd:function(a){this.enabled&&(a in this.started||x("Timer has not been started for "+a),this.times.push({name:a,start:this.started[a],end:Date.now()}),delete this.started[a])},toString:function(){for(var a=this.times,c="",e=0,d=0,b=a.length;d<b;++d){var f=a[d].name;f.length>e&&(e=f.length)}d=0;for(b=a.length;d<b;++d){for(var h=a[d],f=h.end-h.start,h=h.name;h.length<e;)h+=" ";c+=h+" "+f+"ms\n"}return c}};return b}();PDFJS.createBlob=function(b,a){if("undefined"!==typeof Blob)return new Blob([b],
|
||||
{type:a});var c=new MozBlobBuilder;c.append(b);return c.getBlob(a)};PDFJS.createObjectURL=function(){return function(b,a){if(!PDFJS.disableCreateObjectURL&&"undefined"!==typeof URL&&URL.createObjectURL){var c=PDFJS.createBlob(b,a);return URL.createObjectURL(c)}for(var c="data:"+a+";base64,",e=0,d=b.length;e<d;e+=3)var g=b[e]&255,f=b[e+1]&255,h=b[e+2]&255,c=c+("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="[g>>2]+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="[(g&
|
||||
3)<<4|f>>4]+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="[e+1<d?(f&15)<<2|h>>6:64]+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="[e+2<d?h&63:64]);return c}}();aa.prototype={on:function(b,a,c){var e=this.actionHandler;e[b]&&m('There is already an actionName called "'+b+'"');e[b]=[a,c]},send:function(b,a,c,e){b={action:b,data:a};c&&(a=this.callbackIndex++,this.callbacks[a]=c,b.callbackId=a);e&&this.postMessageTransfers?this.comObj.postMessage(b,e):this.comObj.postMessage(b)}};
|
||||
var r=function(){function b(){m("should not call ColorSpace constructor")}b.prototype={getRgb:function(a,c){m("Should not call ColorSpace.getRgb")},getRgbItem:function(a,c,e,d){m("Should not call ColorSpace.getRgbItem")},getRgbBuffer:function(a,c,e,d,b,f){m("Should not call ColorSpace.getRgbBuffer")},getOutputLength:function(a){m("Should not call ColorSpace.getOutputLength")},isPassthrough:function(a){return!1},createRgbBuffer:function(a,c,e,d){if(this.isPassthrough(d))return a.subarray(c);var b=
|
||||
new Uint8Array(3*e),f=1<<d;if(1===this.numComps&&e>f&&"DeviceGray"!==this.name&&"DeviceRGB"!==this.name){for(var h=8>=d?new Uint8Array(f):new Uint16Array(f),k=0;k<f;k++)h[k]=k;var l=new Uint8Array(3*f);this.getRgbBuffer(h,0,f,l,0,d);for(k=d=0;k<e;++k)f=3*a[c++],b[d++]=l[f],b[d++]=l[f+1],b[d++]=l[f+2];return b}this.getRgbBuffer(a,c,e,b,0,d);return b},usesZeroToOneRange:!0};b.parse=function(a,c,e){a=b.parseToIR(a,c,e);return a instanceof ja?a:b.fromIR(a)};b.fromIR=function(a){var c=D(a)?a[0]:a;switch(c){case "DeviceGrayCS":return this.singletons.gray;
|
||||
case "DeviceRgbCS":return this.singletons.rgb;case "DeviceCmykCS":return this.singletons.cmyk;case "CalGrayCS":var c=a[1].WhitePoint,e=a[1].BlackPoint;return new va(c,e,a[1].Gamma);case "PatternCS":return(a=a[1])&&(a=b.fromIR(a)),new wa(a);case "IndexedCS":return c=a[2],e=a[3],new xa(b.fromIR(a[1]),c,e);case "AlternateCS":return c=a[3],new ja(a[1],b.fromIR(a[2]),S.fromIR(c));case "LabCS":return c=a[1].WhitePoint,e=a[1].BlackPoint,new ya(c,e,a[1].Range);default:m("Unkown name "+c)}return null};b.parseToIR=
|
||||
function(a,c,e){if(P(a)){var d=e.get("ColorSpace");R(d)&&(d=d.get(a.name))&&(a=d)}a=c.fetchIfRef(a);if(P(a))switch(this.mode=d=a.name,d){case "DeviceGray":case "G":return"DeviceGrayCS";case "DeviceRGB":case "RGB":return"DeviceRgbCS";case "DeviceCMYK":case "CMYK":return"DeviceCmykCS";case "Pattern":return["PatternCS",null];default:m("unrecognized colorspace "+d)}else if(D(a))switch(this.mode=d=a[0].name,d){case "DeviceGray":case "G":return"DeviceGrayCS";case "DeviceRGB":case "RGB":return"DeviceRgbCS";
|
||||
case "DeviceCMYK":case "CMYK":return"DeviceCmykCS";case "CalGray":return c=a[1].getAll(),["CalGrayCS",c];case "CalRGB":return"DeviceRgbCS";case "ICCBased":d=c.fetchIfRef(a[1]).dict.get("N");if(1==d)return"DeviceGrayCS";if(3==d)return"DeviceRgbCS";if(4==d)return"DeviceCmykCS";break;case "Pattern":return(a=a[1])&&(a=b.parseToIR(a,c,e)),["PatternCS",a];case "Indexed":case "I":return e=b.parseToIR(a[1],c,e),d=a[2]+1,c=c.fetchIfRef(a[3]),Y(c)&&(c=c.getBytes()),["IndexedCS",e,d,c];case "Separation":case "DeviceN":var g=
|
||||
a[1],d=1;P(g)?d=1:D(g)&&(d=g.length);e=b.parseToIR(a[2],c,e);c=S.getIR(c,c.fetchIfRef(a[3]));return["AlternateCS",d,e,c];case "Lab":return c=a[1].getAll(),["LabCS",c];default:m('unimplemented color space object "'+d+'"')}else m('unrecognized color space object: "'+a+'"');return null};b.isDefaultDecode=function(a,c){if(!a)return!0;if(2*c!==a.length)return x("The decode map is not the correct length"),!0;for(var e=0,d=a.length;e<d;e+=2)if(0!==a[e]||1!=a[e+1])return!1;return!0};b.singletons={get gray(){return U(this,
|
||||
"gray",new za)},get rgb(){return U(this,"rgb",new Aa)},get cmyk(){return U(this,"cmyk",new Ba)}};return b}(),ja=function(){function b(a,c,e){this.name="Alternate";this.numComps=a;this.defaultColor=new Float32Array(a);for(var d=0;d<a;++d)this.defaultColor[d]=1;this.base=c;this.tintFn=e}b.prototype={getRgb:function(a,c){var e=new Uint8Array(3);this.getRgbItem(a,c,e,0);return e},getRgbItem:function(a,c,e,d){a="subarray"in a?a.subarray(c,c+this.numComps):Array.prototype.slice.call(a,c,c+this.numComps);
|
||||
a=this.tintFn(a);this.base.getRgbItem(a,0,e,d)},getRgbBuffer:function(a,c,e,d,b,f){var h=this.tintFn,k=this.base;f=1/((1<<f)-1);for(var l=k.numComps,n=k.usesZeroToOneRange,p=k.isPassthrough(8)||!n,z=p?b:0,s=p?d:new Uint8Array(l*e),w=this.numComps,F=new Float32Array(w),A=0;A<e;A++){for(var C=0;C<w;C++)F[C]=a[c++]*f;var m=h(F);if(n)for(C=0;C<l;C++)s[z++]=255*m[C];else k.getRgbItem(m,0,s,z),z+=l}p||k.getRgbBuffer(s,0,e,d,b,8)},getOutputLength:function(a){return this.base.getOutputLength(a*this.base.numComps/
|
||||
this.numComps)},isPassthrough:r.prototype.isPassthrough,createRgbBuffer:r.prototype.createRgbBuffer,isDefaultDecode:function(a){return r.isDefaultDecode(a,this.numComps)},usesZeroToOneRange:!0};return b}(),wa=function(){function b(a){this.name="Pattern";this.base=a}b.prototype={};return b}(),xa=function(){function b(a,c,e){this.name="Indexed";this.numComps=1;this.defaultColor=new Uint8Array([0]);this.base=a;this.highVal=c;a=a.numComps*c;var d;if(Y(e))d=new Uint8Array(a),e=e.getBytes(a),d.set(e);else if("string"==
|
||||
typeof e)for(d=new Uint8Array(a),c=0;c<a;++c)d[c]=e.charCodeAt(c);else e instanceof Uint8Array||e instanceof Array?d=e:m("Unrecognized lookup table: "+e);this.lookup=d}b.prototype={getRgb:function(a,c){return this.base.getRgb(this.lookup,a[c]*this.base.numComps)},getRgbItem:function(a,c,e,d){this.base.getRgbItem(this.lookup,a[c]*this.base.numComps,e,d)},getRgbBuffer:function(a,c,e,d,b){for(var f=this.base,h=f.numComps,k=f.getOutputLength(h),l=this.lookup,n=0;n<e;++n){var p=a[c++]*h;f.getRgbBuffer(l,
|
||||
p,1,d,b,8);b+=k}},getOutputLength:function(a){return this.base.getOutputLength(a*this.base.numComps)},isPassthrough:r.prototype.isPassthrough,createRgbBuffer:r.prototype.createRgbBuffer,isDefaultDecode:function(a){return!0},usesZeroToOneRange:!0};return b}(),za=function(){function b(){this.name="DeviceGray";this.numComps=1;this.defaultColor=new Float32Array([0])}b.prototype={getRgb:function(a,c){var e=new Uint8Array(3);this.getRgbItem(a,c,e,0);return e},getRgbItem:function(a,c,e,d){a=255*a[c]|0;e[d]=
|
||||
e[d+1]=e[d+2]=0>a?0:255<a?255:a},getRgbBuffer:function(a,c,e,d,b,f){f=255/((1<<f)-1);for(var h=0;h<e;++h){var k=f*a[c++]|0;d[b++]=k;d[b++]=k;d[b++]=k}},getOutputLength:function(a){return 3*a},isPassthrough:r.prototype.isPassthrough,createRgbBuffer:r.prototype.createRgbBuffer,isDefaultDecode:function(a){return r.isDefaultDecode(a,this.numComps)},usesZeroToOneRange:!0};return b}(),Aa=function(){function b(){this.name="DeviceRGB";this.numComps=3;this.defaultColor=new Float32Array([0,0,0])}b.prototype=
|
||||
{getRgb:function(a,c){var e=new Uint8Array(3);this.getRgbItem(a,c,e,0);return e},getRgbItem:function(a,c,e,d){var b=255*a[c]|0,f=255*a[c+1]|0;a=255*a[c+2]|0;e[d]=0>b?0:255<b?255:b;e[d+1]=0>f?0:255<f?255:f;e[d+2]=0>a?0:255<a?255:a},getRgbBuffer:function(a,c,e,d,b,f){e*=3;if(8==f)d.set(a.subarray(c,c+e),b);else{f=255/((1<<f)-1);for(var h=0;h<e;++h)d[b++]=f*a[c++]|0}},getOutputLength:function(a){return a},isPassthrough:function(a){return 8==a},createRgbBuffer:r.prototype.createRgbBuffer,isDefaultDecode:function(a){return r.isDefaultDecode(a,
|
||||
this.numComps)},usesZeroToOneRange:!0};return b}(),Ba=function(){function b(a,e,d,b,f){var h=a[e+0]*d,k=a[e+1]*d,l=a[e+2]*d;d*=a[e+3];a=h*(-4.387332384609988*h+54.48615194189176*k+18.82290502165302*l+212.25662451639585*d+-285.2331026137004)+k*(1.7149763477362134*k-5.6096736904047315*l+-17.873870861415444*d-5.497006427196366)+l*(-2.5217340131683033*l-21.248923337353073*d+17.5119270841813)+d*(-21.86122147463605*d-189.48180835922747)+255;e=h*(8.841041422036149*h+60.118027045597366*k+6.871425592049007*
|
||||
l+31.159100130055922*d+-79.2970844816548)+k*(-15.310361306967817*k+17.575251261109482*l+131.35250912493976*d-190.9453302588951)+l*(4.444339102852739*l+9.8632861493405*d-24.86741582555878)+d*(-20.737325471181034*d-187.80453709719578)+255;h=h*(0.8842522430003296*h+8.078677503112928*k+30.89978309703729*l-0.23883238689178934*d+-14.183576799673286)+k*(10.49593273432072*k+63.02378494754052*l+50.606957656360734*d-112.23884253719248)+l*(0.03296041114873217*l+115.60384449646641*d+-193.58209356861505)+d*(-22.33816807309886*
|
||||
d-180.12613974708367)+255;b[f]=255<a?255:0>a?0:a;b[f+1]=255<e?255:0>e?0:e;b[f+2]=255<h?255:0>h?0:h}function a(){this.name="DeviceCMYK";this.numComps=4;this.defaultColor=new Float32Array([0,0,0,1])}a.prototype={getRgb:function(a,e){var d=new Uint8Array(3);b(a,e,1,d,0);return d},getRgbItem:function(a,e,d,g){b(a,e,1,d,g)},getRgbBuffer:function(a,e,d,g,f,h){h=1/((1<<h)-1);for(var k=0;k<d;k++)b(a,e,h,g,f),e+=4,f+=3},getOutputLength:function(a){return 3*(a>>2)},isPassthrough:r.prototype.isPassthrough,createRgbBuffer:r.prototype.createRgbBuffer,
|
||||
isDefaultDecode:function(a){return r.isDefaultDecode(a,this.numComps)},usesZeroToOneRange:!0};return a}(),va=function(){function b(a,e,d){this.name="CalGray";this.numComps=1;this.defaultColor=new Float32Array([0]);a||m("WhitePoint missing - required for color space CalGray");e=e||[0,0,0];this.XW=a[0];this.YW=a[1];this.ZW=a[2];this.XB=e[0];this.YB=e[1];this.ZB=e[2];this.G=d||1;(0>this.XW||0>this.ZW||1!==this.YW)&&m("Invalid WhitePoint components for "+this.name+", no fallback available");if(0>this.XB||
|
||||
0>this.YB||0>this.ZB)K("Invalid BlackPoint for "+this.name+", falling back to default"),this.XB=this.YB=this.ZB=0;0===this.XB&&0===this.YB&&0===this.ZB||x(this.name+", BlackPoint: XB: "+this.XB+", YB: "+this.YB+", ZB: "+this.ZB+", only default values are supported.");1>this.G&&(K("Invalid Gamma: "+this.G+" for "+this.name+", falling back to default"),this.G=1)}function a(a,e,d,b,f,h){e=Math.pow(e[d]*h,a.G);a=Math.max(116*Math.pow(a.YW*e,1/3)-16,0);b[f]=255*a/100;b[f+1]=255*a/100;b[f+2]=255*a/100}
|
||||
b.prototype={getRgb:function(a,e){var d=new Uint8Array(3);this.getRgbItem(a,e,d,0);return d},getRgbItem:function(c,e,d,b){a(this,c,e,d,b,1)},getRgbBuffer:function(c,e,d,b,f,h){h=1/((1<<h)-1);for(var k=0;k<d;++k)a(this,c,e,b,f,h),e+=1,f+=3},getOutputLength:function(a){return 3*a},isPassthrough:r.prototype.isPassthrough,createRgbBuffer:r.prototype.createRgbBuffer,isDefaultDecode:function(a){return r.isDefaultDecode(a,this.numComps)},usesZeroToOneRange:!0};return b}(),ya=function(){function b(a,c,b){this.name=
|
||||
"Lab";this.numComps=3;this.defaultColor=new Float32Array([0,0,0]);a||m("WhitePoint missing - required for color space Lab");c=c||[0,0,0];b=b||[-100,100,-100,100];this.XW=a[0];this.YW=a[1];this.ZW=a[2];this.amin=b[0];this.amax=b[1];this.bmin=b[2];this.bmax=b[3];this.XB=c[0];this.YB=c[1];this.ZB=c[2];(0>this.XW||0>this.ZW||1!==this.YW)&&m("Invalid WhitePoint components, no fallback available");if(0>this.XB||0>this.YB||0>this.ZB)K("Invalid BlackPoint, falling back to default"),this.XB=this.YB=this.ZB=
|
||||
0;if(this.amin>this.amax||this.bmin>this.bmax)K("Invalid Range, falling back to defaults"),this.amin=-100,this.amax=100,this.bmin=-100,this.bmax=100}function a(a){return a>=6/29?a*a*a:108/841*(a-4/29)}function c(c,d,b,f,h,k){var l=d[b],n=d[b+1];d=d[b+2];!1!==f&&(l=0+100*l/f,n=c.amin+n*(c.amax-c.amin)/f,d=c.bmin+d*(c.bmax-c.bmin)/f);n=n>c.amax?c.amax:n<c.amin?c.amin:n;d=d>c.bmax?c.bmax:d<c.bmin?c.bmin:d;f=(l+16)/116;l=f-d/200;n=c.XW*a(f+n/500);f=c.YW*a(f);l=c.ZW*a(l);1>c.ZW?(c=3.1339*n+-1.617*f+-0.4906*
|
||||
l,d=-0.9785*n+1.916*f+0.0333*l,n=0.072*n+-0.229*f+1.4057*l):(c=3.2406*n+-1.5372*f+-0.4986*l,d=-0.9689*n+1.8758*f+0.0415*l,n=0.0557*n+-0.204*f+1.057*l);h[k]=255*Math.sqrt(0>c?0:1<c?1:c);h[k+1]=255*Math.sqrt(0>d?0:1<d?1:d);h[k+2]=255*Math.sqrt(0>n?0:1<n?1:n)}b.prototype={getRgb:function(a,d){var b=new Uint8Array(3);c(this,a,d,!1,b,0);return b},getRgbItem:function(a,b,g,f){c(this,a,b,!1,g,f)},getRgbBuffer:function(a,b,g,f,h,k){k=(1<<k)-1;for(var l=0;l<g;l++)c(this,a,b,k,f,h),b+=3,h+=3},getOutputLength:function(a){return a},
|
||||
isPassthrough:r.prototype.isPassthrough,isDefaultDecode:function(a){return!0},usesZeroToOneRange:!1};return b}();E=3;var ka=function(){function b(){m("should not call Pattern constructor")}b.prototype={getPattern:function(a){m("Should not call Pattern.getStyle: "+a)}};b.shadingFromIR=function(a){return N[a[0]].fromIR(a)};b.parseShading=function(a,c,b,d){a=Y(a)?a.dict:a;switch(a.get("ShadingType")){case 2:case E:return new N.RadialAxial(a,c,b,d);default:return Z.notify(da.shadingPattern),new N.Dummy}};
|
||||
return b}(),N={SMALL_NUMBER:0.01};N.RadialAxial=function(){function b(a,c,b,d,g){this.matrix=c;this.coordsArr=a.get("Coords");this.shadingType=a.get("ShadingType");this.type="Pattern";this.ctx=g;c=a.get("ColorSpace","CS");this.cs=c=r.parse(c,b,d);d=0;var f=1;a.has("Domain")&&(g=a.get("Domain"),d=g[0],f=g[1]);var h=g=!1;a.has("Extend")&&(h=a.get("Extend"),g=h[0],h=h[1]);if(!(this.shadingType!==E||g&&h)){var k=this.coordsArr[0],l=this.coordsArr[1],n=this.coordsArr[2],p=this.coordsArr[3],z=this.coordsArr[4],
|
||||
s=this.coordsArr[5],k=Math.sqrt((k-p)*(k-p)+(l-z)*(l-z));n<=s+k&&s<=n+k&&x("Unsupported radial gradient.")}this.extendStart=g;this.extendEnd=h;n=a.get("Function");if(D(n)){for(var w=[],s=0,k=n.length;s<k;s++)l=b.fetchIfRef(n[s]),ea(l)||m("Invalid function"),w.push(S.parse(b,l));n=function(a){for(var c=[],b=0,d=w.length;b<d;b++)c.push(w[b](a)[0]);return c}}else ea(n)||m("Invalid function"),n=S.parse(b,n);s=f-d;k=s/10;b=this.colorStops=[];if(d>=f||0>=k)K("Bad shading domain.");else{for(l=d;l<=f;l+=
|
||||
k)p=c.getRgb(n([l]),0),p=q.makeCssRgb(p),b.push([(l-d)/s,p]);d="transparent";a.has("Background")&&(p=c.getRgb(a.get("Background"),0),d=q.makeCssRgb(p));g||(b.unshift([0,d]),b[1][0]+=N.SMALL_NUMBER);h||(b[b.length-1][0]-=N.SMALL_NUMBER,b.push([1,d]));this.colorStops=b}}b.fromIR=function(a){var c=a[1],b=a[2],d=a[3],g=a[4],f=a[5],h=a[6];return{type:"Pattern",getPattern:function(a){var l;2==c?l=a.createLinearGradient(d[0],d[1],g[0],g[1]):c==E&&(l=a.createRadialGradient(d[0],d[1],f,g[0],g[1],h));a=0;for(var n=
|
||||
b.length;a<n;++a){var p=b[a];l.addColorStop(p[0],p[1])}return l}}};b.prototype={getIR:function(){var a=this.coordsArr,c=this.shadingType;if(2==c)var b=[a[0],a[1]],d=[a[2],a[3]],g=null,f=null;else c==E?(b=[a[0],a[1]],d=[a[3],a[4]],g=a[2],f=a[5]):m("getPattern type unknown: "+c);if(a=this.matrix)b=q.applyTransform(b,a),d=q.applyTransform(d,a);return["RadialAxial",c,this.colorStops,b,d,g,f]}};return b}();N.Dummy=function(){function b(){this.type="Pattern"}b.fromIR=function(){return{type:"Pattern",getPattern:function(){return"hotpink"}}};
|
||||
b.prototype={getIR:function(){return["Dummy"]}};return b}();var Ca=function(){function b(a,c,b,d,g,f){this.name=a[1][0].name;this.operatorList=a[2];this.matrix=a[3]||[1,0,0,1,0,0];this.bbox=a[4];this.xstep=a[5];this.ystep=a[6];this.paintType=a[7];this.tilingType=a[8];this.color=c;this.objs=d;this.commonObjs=g;this.baseTransform=f;this.type="Pattern";this.ctx=b}b.getIR=function(a,c,b){var d=c.get("Matrix"),g=c.get("BBox"),f=c.get("XStep"),h=c.get("YStep"),k=c.get("PaintType");c=c.get("TilingType");
|
||||
return["TilingPattern",b,a,d,g,f,h,k,c]};b.prototype={createPatternCanvas:function(a){var c=this.operatorList,b=this.bbox,d=this.xstep,g=this.ystep,f=this.paintType,h=this.color,k=this.objs,l=this.commonObjs;K("TilingType: "+this.tilingType);var n=b[0],p=b[1],z=b[2],s=b[3],w=[n,p],F=[n+d,p+g],A=F[0]-w[0],F=F[1]-w[1],m=q.singularValueDecompose2dScale(this.matrix),u=q.singularValueDecompose2dScale(this.baseTransform),m=[m[0]*u[0],m[1]*u[1]],A=Math.min(Math.ceil(Math.abs(A*m[0])),3E3),F=Math.min(Math.ceil(Math.abs(F*
|
||||
m[1])),3E3),m=J.getCanvas("pattern",A,F,!0),u=m.context,k=new la(u,l,k);k.groupLevel=a.groupLevel;this.setFillAndStrokeStyleToContext(u,f,h);this.setScale(A,F,d,g);this.transformToScale(k);k.transform.apply(k,[1,0,0,1,-w[0],-w[1]]);this.clipBbox(k,b,n,p,z,s);k.executeOperatorList(c);return m.canvas},setScale:function(a,c,b,d){this.scale=[a/b,c/d]},transformToScale:function(a){var c=this.scale;a.transform.apply(a,[c[0],0,0,c[1],0,0])},scaleToContext:function(){var a=this.scale;this.ctx.scale(1/a[0],
|
||||
1/a[1])},clipBbox:function(a,c,b,d,g,f){c&&D(c)&&4==c.length&&(a.rectangle(b,d,g-b,f-d),a.clip(),a.endPath())},setFillAndStrokeStyleToContext:function(a,c,b){switch(c){case 1:c=this.ctx;a.fillStyle=c.fillStyle;a.strokeStyle=c.strokeStyle;break;case 2:c=r.singletons.rgb.getRgb(b,0);c=q.makeCssRgb(c);a.fillStyle=c;a.strokeStyle=c;break;default:m("Unsupported paint type: "+c)}},getPattern:function(a,c){var b=this.createPatternCanvas(c);a=this.ctx;a.setTransform.apply(a,this.baseTransform);a.transform.apply(a,
|
||||
this.matrix);this.scaleToContext();return a.createPattern(b,"repeat")}};return b}(),S=function(){return{getSampleArray:function(b,a,c,e){for(var d=1,g=0,f=b.length;g<f;g++)d*=b[g];d*=a;b=[];var f=a=0,h=1/(Math.pow(2,c)-1);e=e.getBytes((d*c+7)/8);for(var k=0,g=0;g<d;g++){for(;a<c;)f<<=8,f|=e[k++],a+=8;a-=c;b.push((f>>a)*h);f&=(1<<a)-1}return b},getIR:function(b,a){var c=a.dict;c||(c=a);var e=[this.constructSampled,null,this.constructInterpolated,this.constructStiched,this.constructPostScript],d=c.get("FunctionType");
|
||||
(e=e[d])||m("Unknown type of function");return e.call(this,a,c,b)},fromIR:function(b){switch(b[0]){case 0:return this.constructSampledFromIR(b);case 2:return this.constructInterpolatedFromIR(b);case 3:return this.constructStichedFromIR(b);default:return this.constructPostScriptFromIR(b)}},parse:function(b,a){var c=this.getIR(b,a);return this.fromIR(c)},constructSampled:function(b,a){function c(a){for(var c=a.length,b=[],d=0,e=0;e<c;e+=2)b[d]=[a[e],a[e+1]],++d;return b}var e=a.get("Domain"),d=a.get("Range");
|
||||
e&&d||m("No domain or range");var g=e.length/2,f=d.length/2,e=c(e),d=c(d),h=a.get("Size"),k=a.get("BitsPerSample"),l=a.get("Order")||1;1!==l&&K("No support for cubic spline interpolation: "+l);l=a.get("Encode");if(!l)for(var l=[],n=0;n<g;++n)l.push(0),l.push(h[n]-1);var l=c(l),n=(n=a.get("Decode"))?c(n):d,p=this.getSampleArray(h,f,k,b);return[0,g,e,l,n,p,h,f,Math.pow(2,k)-1,d]},constructSampledFromIR:function(b){return function(a){var c=b[1],e=b[2],d=b[3],g=b[4],f=b[5],h=b[6],k=b[7],l=b[9];c!=a.length&&
|
||||
m("Incorrect number of arguments: "+c+" != "+a.length);for(var n=1<<c,p=new Float64Array(n),z=new Uint32Array(n),s=0;s<n;s++)p[s]=1;for(var w=k,F=1,A=0;A<c;++A){for(var s=e[A][0],C=e[A][1],u=Math.min(Math.max(a[A],s),C),M=d[A][0]+(d[A][1]-d[A][0])/(C-s)*(u-s),C=h[A],M=Math.min(Math.max(M,0),C-1),s=M<C-1?Math.floor(M):M-1,u=s+1-M,M=M-s,q=s*w,r=q+w,s=0;s<n;s++)s&F?(p[s]*=M,z[s]+=r):(p[s]*=u,z[s]+=q);w*=C;F<<=1}a=new Float64Array(k);for(s=0;s<k;++s){for(A=c=0;A<n;A++)c+=f[z[A]+s]*p[A];c=g[s][0]+(g[s][1]-
|
||||
g[s][0])/1*(c-0);a[s]=Math.min(Math.max(c,l[s][0]),l[s][1])}return a}},constructInterpolated:function(b,a){var c=a.get("C0")||[0],e=a.get("C1")||[1],d=a.get("N");D(c)&&D(e)||m("Illegal dictionary for interpolated function");for(var g=c.length,f=[],h=0;h<g;++h)f.push(e[h]-c[h]);return[2,c,f,d]},constructInterpolatedFromIR:function(b){var a=b[1],c=b[2],e=b[3],d=c.length;return function(b){b=1==e?b[0]:Math.pow(b[0],e);for(var f=[],h=0;h<d;++h)f.push(a[h]+b*c[h]);return f}},constructStiched:function(b,
|
||||
a,c){(b=a.get("Domain"))||m("No domain");1!=b.length/2&&m("Bad domain for stiched function");for(var e=a.get("Functions"),d=[],g=0,f=e.length;g<f;++g)d.push(S.getIR(c,c.fetchIfRef(e[g])));c=a.get("Bounds");a=a.get("Encode");return[3,b,c,a,d]},constructStichedFromIR:function(b){var a=b[1],c=b[2],e=b[3];b=b[4];for(var d=[],g=0,f=b.length;g<f;g++)d.push(S.fromIR(b[g]));return function(b){b=b[0];var k=a[0],l=a[1];b>l?b=l:b<k&&(b=k);k=0;for(l=c.length;k<l&&!(b<c[k]);++k);l=a[0];0<k&&(l=c[k-1]);var f=a[1];
|
||||
k<c.length&&(f=c[k]);var g=e[2*k];return d[k]([g+(b-l)*(e[2*k+1]-g)/(f-l)])}},constructPostScript:function(b,a,c){c=a.get("Domain");a=a.get("Range");c||m("No domain.");a||m("No range.");b=new Da(b);b=(new Ea(b)).parse();return[4,c,a,b]},constructPostScriptFromIR:function(b){var a=b[1],c=b[2],e=c.length/2,d=new Fa(b[3]),g=new Ga;return function(b){for(var h=[],k=0,l=a.length/2;k<l;++k)h.push(b[k]);b=h.join("_");if(g.has(b))return g.get(b);h=d.execute(h);l=[];for(k=e-1;0<=k;--k){var n=h.pop(),p=2*k;
|
||||
n<c[p]?n=c[p]:n>c[p+1]&&(n=c[p+1]);l[k]=n}g.set(b,l);return l}}}}(),Ga=function(){function b(){this.cache={};this.total=0}b.prototype={has:function(a){return a in this.cache},get:function(a){return this.cache[a]},set:function(a,c){1024>this.total&&(this.cache[a]=c,this.total++)}};return b}(),Ha=function(){function b(a){this.stack=a||[]}b.prototype={push:function(a){100<=this.stack.length&&m("PostScript function stack overflow.");this.stack.push(a)},pop:function(){0>=this.stack.length&&m("PostScript function stack underflow.");
|
||||
return this.stack.pop()},copy:function(a){100<=this.stack.length+a&&m("PostScript function stack overflow.");var c=this.stack,b=c.length-a;for(a-=1;0<=a;a--,b++)c.push(c[b])},index:function(a){this.push(this.stack[this.stack.length-a-1])},roll:function(a,c){var b=this.stack,d=b.length-a,g=b.length-1,f=d+(c-Math.floor(c/a)*a),h,k,l;h=d;for(k=g;h<k;h++,k--)l=b[h],b[h]=b[k],b[k]=l;h=d;for(k=f-1;h<k;h++,k--)l=b[h],b[h]=b[k],b[k]=l;h=f;for(k=g;h<k;h++,k--)l=b[h],b[h]=b[k],b[k]=l}};return b}(),Fa=function(){function b(a,
|
||||
c){this.operators=a;this.operands=c}b.prototype={execute:function(a){a=new Ha(a);for(var c=0,b=this.operators,d=b.length,g,f;c<d;)if(g=b[c++],"number"==typeof g)a.push(g);else switch(g){case "jz":f=a.pop();(g=a.pop())||(c=f);break;case "j":c=g=a.pop();break;case "abs":g=a.pop();a.push(Math.abs(g));break;case "add":f=a.pop();g=a.pop();a.push(g+f);break;case "and":f=a.pop();g=a.pop();L(g)&&L(f)?a.push(g&&f):a.push(g&f);break;case "atan":g=a.pop();a.push(Math.atan(g));break;case "bitshift":f=a.pop();
|
||||
g=a.pop();0<g?a.push(g<<f):a.push(g>>f);break;case "ceiling":g=a.pop();a.push(Math.ceil(g));break;case "copy":g=a.pop();a.copy(g);break;case "cos":g=a.pop();a.push(Math.cos(g));break;case "cvi":g=a.pop()|0;a.push(g);break;case "cvr":break;case "div":f=a.pop();g=a.pop();a.push(g/f);break;case "dup":a.copy(1);break;case "eq":f=a.pop();g=a.pop();a.push(g==f);break;case "exch":a.roll(2,1);break;case "exp":f=a.pop();g=a.pop();a.push(Math.pow(g,f));break;case "false":a.push(!1);break;case "floor":g=a.pop();
|
||||
a.push(Math.floor(g));break;case "ge":f=a.pop();g=a.pop();a.push(g>=f);break;case "gt":f=a.pop();g=a.pop();a.push(g>f);break;case "idiv":f=a.pop();g=a.pop();a.push(g/f|0);break;case "index":g=a.pop();a.index(g);break;case "le":f=a.pop();g=a.pop();a.push(g<=f);break;case "ln":g=a.pop();a.push(Math.log(g));break;case "log":g=a.pop();a.push(Math.log(g)/Math.LN10);break;case "lt":f=a.pop();g=a.pop();a.push(g<f);break;case "mod":f=a.pop();g=a.pop();a.push(g%f);break;case "mul":f=a.pop();g=a.pop();a.push(g*
|
||||
f);break;case "ne":f=a.pop();g=a.pop();a.push(g!=f);break;case "neg":a.pop();a.push(-f);break;case "not":g=a.pop();L(g)&&L(f)?a.push(g&&f):a.push(g&f);break;case "or":f=a.pop();g=a.pop();L(g)&&L(f)?a.push(g||f):a.push(g|f);break;case "pop":a.pop();break;case "roll":f=a.pop();g=a.pop();a.roll(g,f);break;case "round":g=a.pop();a.push(Math.round(g));break;case "sin":g=a.pop();a.push(Math.sin(g));break;case "sqrt":g=a.pop();a.push(Math.sqrt(g));break;case "sub":f=a.pop();g=a.pop();a.push(g-f);break;case "true":a.push(!0);
|
||||
break;case "truncate":g=a.pop();g=0>g?Math.ceil(g):Math.floor(g);a.push(g);break;case "xor":f=a.pop();g=a.pop();L(g)&&L(f)?a.push(g!=f):a.push(g^f);break;default:m("Unknown operator "+g)}return a.stack}};return b}(),Ea=function(){function b(a){this.lexer=a;this.operators=[];this.prev=this.token=null}b.prototype={nextToken:function(){this.prev=this.token;this.token=this.lexer.getToken()},accept:function(a){return this.token.type==a?(this.nextToken(),!0):!1},expect:function(a){if(this.accept(a))return!0;
|
||||
m("Unexpected symbol: found "+this.token.type+" expected "+a+".")},parse:function(){this.nextToken();this.expect(v.LBRACE);this.parseBlock();this.expect(v.RBRACE);return this.operators},parseBlock:function(){for(;;)if(this.accept(v.NUMBER))this.operators.push(this.prev.value);else if(this.accept(v.OPERATOR))this.operators.push(this.prev.value);else if(this.accept(v.LBRACE))this.parseCondition();else break},parseCondition:function(){var a=this.operators.length;this.operators.push(null,null);this.parseBlock();
|
||||
this.expect(v.RBRACE);if(this.accept(v.IF))this.operators[a]=this.operators.length,this.operators[a+1]="jz";else if(this.accept(v.LBRACE)){var c=this.operators.length;this.operators.push(null,null);var b=this.operators.length;this.parseBlock();this.expect(v.RBRACE);this.expect(v.IFELSE);this.operators[c]=this.operators.length;this.operators[c+1]="j";this.operators[a]=b;this.operators[a+1]="jz"}else m("PS Function: error parsing conditional.")}};return b}(),v={LBRACE:0,RBRACE:1,NUMBER:2,OPERATOR:3,
|
||||
IF:4,IFELSE:5},T=function(){function b(a,b){this.type=a;this.value=b}var a={};b.getOperator=function(c){var e=a[c];return e?e:a[c]=new b(v.OPERATOR,c)};b.LBRACE=new b(v.LBRACE,"{");b.RBRACE=new b(v.RBRACE,"}");b.IF=new b(v.IF,"IF");b.IFELSE=new b(v.IFELSE,"IFELSE");return b}(),Da=function(){function b(a){this.stream=a;this.nextChar()}b.prototype={nextChar:function(){return this.currentChar=this.stream.getByte()},getToken:function(){for(var a=!1,c=this.currentChar;;){if(0>c)return EOF;if(a){if(10===
|
||||
c||13===c)a=!1}else if(37==c)a=!0;else if(!Lexer.isSpace(c))break;c=this.nextChar()}switch(c|0){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return new T(v.NUMBER,this.getNumber());case 123:return this.nextChar(),T.LBRACE;case 125:return this.nextChar(),T.RBRACE}for(a=String.fromCharCode(c);0<=(c=this.nextChar())&&(65<=c&&90>=c||97<=c&&122>=c);)a+=String.fromCharCode(c);switch(a.toLowerCase()){case "if":return T.IF;case "ifelse":return T.IFELSE;
|
||||
default:return T.getOperator(a)}},getNumber:function(){for(var a=this.currentChar,c=String.fromCharCode(a);0<=(a=this.nextChar());)if(48<=a&&57>=a||45===a||46===a)c+=String.fromCharCode(a);else break;a=parseFloat(c);isNaN(a)&&m("Invalid floating point number: "+a);return a}};return b}(),H=function(){function b(a,b,d){var g=q.getAxialAlignedBoundingBox(b,d);b=g[0];d=g[1];var f=g[2],g=g[3];if(b===f||d===g)return[1,0,0,1,a[0],a[1]];f=(a[2]-a[0])/(f-b);g=(a[3]-a[1])/(g-d);return[f,0,0,g,a[0]-b*f,a[1]-
|
||||
d*g]}function a(a){if(a.data)this.data=a.data;else{var b=a.dict;a=this.data={};a.subtype=b.get("Subtype").name;var d=b.get("Rect");a.rect=q.normalizeRect(d);a.annotationFlags=b.get("F");d=b.get("C");D(d)&&3===d.length?a.color=d:a.color=[0,0,0];if(b.has("BS"))d=b.get("BS"),a.borderWidth=d.has("W")?d.get("W"):1;else if(d=b.get("Border")||[0,0,1],a.borderWidth=d[2]||0,(d=d[3])&&D(d)){var g=d.length;if(0<g){for(var f=!1,h=0,k=0;k<g;k++)if(0<=+d[k])0<d[k]&&h++;else{f=!0;break}if(f||0===h)a.borderWidth=
|
||||
0}}var l;d=b.get("AP");R(d)?(d=d.get("N"),R(d)?(b=b.get("AS"))&&d.has(b.name)&&(l=d.get(b.name)):l=d):l=void 0;this.appearance=l;a.hasAppearance=!!this.appearance}}a.prototype={getData:function(){return this.data},hasHtml:function(){return!1},getHtmlElement:function(a){throw new ta("getHtmlElement() should be implemented in subclass");},getEmptyContainer:function(a,b){W&&m("getEmptyContainer() should be called from main thread");b=b||this.data.rect;var d=document.createElement(a);d.style.width=Math.ceil(b[2]-
|
||||
b[0])+"px";d.style.height=Math.ceil(b[3]-b[1])+"px";return d},isViewable:function(){var a=this.data;return!(!a||a.annotationFlags&&a.annotationFlags&34||!a.rect)},loadResources:function(a){var b=new G;this.appearance.dict.getAsync("Resources").then(function(d){d?(new ObjectLoader(d.map,a,d.xref)).load().then(function(){b.resolve(d)}):b.resolve()}.bind(this));return b},getOperatorList:function(a){var e=new G;if(!this.appearance)return e.resolve(new OperatorList),e;var d=this.data,g=this.appearance.dict,
|
||||
f=this.loadResources("ExtGState ColorSpace Pattern Shading XObject Font".split(" ")),h=g.get("BBox")||[0,0,1,1],k=g.get("Matrix")||[1,0,0,1,0,0],l=b(d.rect,h,k);f.then(function(b){var f=new OperatorList;f.addOp(y.beginAnnotation,[d.rect,l,k]);a.getOperatorList(this.appearance,b,f);f.addOp(y.endAnnotation,[]);e.resolve(f)}.bind(this));return e}};a.getConstructor=function(c,b){if(c){if("Link"===c)return Ia;if("Text"===c)return Ja;if("Widget"===c){if(b)return"Tx"===b?Ka:ca}else return a}};a.fromData=
|
||||
function(c){var b=a.getConstructor(c.subtype,c.fieldType);if(b)return new b({data:c})};a.fromRef=function(c,b){var d=c.fetchIfRef(b);if(R(d)){var g=d.get("Subtype");if(g=P(g)?g.name:""){var f=q.getInheritableProperty(d,"FT"),f=P(f)?f.name:"";if(f=a.getConstructor(g,f)){d=new f({dict:d,ref:b});if(d.isViewable())return d;x("unimplemented annotation type: "+g)}}}};a.appendToOperatorList=function(a,b,d,g){var f=new G;d=[];for(var h=0,k=a.length;h<k;++h)d.push(a[h].getOperatorList(g));Promise.all(d).then(function(a){b.addOp(y.beginAnnotations,
|
||||
[]);for(var c=0,d=a.length;c<d;++c)b.addOpList(a[c]);b.addOp(y.endAnnotations,[]);f.resolve()},function(a){f.reject(a)});return f};return a}();PDFJS.Annotation=H;var ca=function(){function b(a){H.call(this,a);if(!a.data){var b=a.dict,d=this.data;d.fieldValue=V(q.getInheritableProperty(b,"V")||"");d.alternativeText=V(b.get("TU")||"");d.defaultAppearance=q.getInheritableProperty(b,"DA")||"";var g=q.getInheritableProperty(b,"FT");d.fieldType=P(g)?g.name:"";d.fieldFlags=q.getInheritableProperty(b,"Ff")||
|
||||
0;this.fieldResources=q.getInheritableProperty(b,"DR")||new Dict;var g=[],f=b;for(a=a.ref;f;){var b=f.get("Parent"),h=f.getRaw("Parent");if(f=f.get("T"))g.unshift(V(f));else{var f=b.get("Kids"),k,l;k=0;for(l=f.length;k<l;k++){var n=f[k];if(n.num==a.num&&n.gen==a.gen)break}g.unshift("`"+k)}f=b;a=h}d.fullName=g.join(".")}}var a=H.prototype;q.inherit(b,H,{isViewable:function(){return"Sig"===this.data.fieldType?(x("unimplemented annotation type: Widget signature"),!1):a.isViewable.call(this)}});return b}(),
|
||||
Ka=function(){function b(a){ca.call(this,a);a.data||(this.data.textAlignment=q.getInheritableProperty(a.dict,"Q"))}q.inherit(b,ca,{hasHtml:function(){return!this.data.hasAppearance&&!!this.data.fieldValue},getHtmlElement:function(a){W&&m("getHtmlElement() shall be called from main thread");var c=this.data,b=this.getEmptyContainer("div");b.style.display="table";var d=document.createElement("div");d.textContent=c.fieldValue;d.style.textAlign=["left","center","right"][c.textAlignment];d.style.verticalAlign=
|
||||
"middle";d.style.display="table-cell";a=c.fontRefName?a.getData(c.fontRefName):null;var g=d.style;g.fontSize=c.fontSize+"px";g.direction=0>c.fontDirection?"rtl":"ltr";a&&(g.fontWeight=a.black?a.bold?"bolder":"bold":a.bold?"bold":"normal",g.fontStyle=a.italic?"italic":"normal",c=a.loadedName,g.fontFamily=(c?'"'+c+'", ':"")+(a.fallbackName||"Helvetica, sans-serif"));b.appendChild(d);return b},getOperatorList:function(a){if(this.appearance)return H.prototype.getOperatorList.call(this,a);var c=new G,
|
||||
b=new OperatorList,d=this.data,g=d.defaultAppearance;if(!g)return c.resolve(b),c;for(var f=Stream,h=g.length,k=new Uint8Array(h),l=0;l<h;++l)k[l]=g.charCodeAt(l)&255;g=new f(k);a.getOperatorList(g,this.fieldResources,b);a=b.fnArray;g=b.argsArray;d.rgb=[0,0,0];for(f=0;0>f;++f)h=a[f],k=g[f],h===y.setFont?(d.fontRefName=k[0],h=k[1],0>h?(d.fontDirection=-1,d.fontSize=-h):(d.fontDirection=1,d.fontSize=h)):h===y.setFillRGBColor?d.rgb=k:h===y.setFillGray&&(h=255*k[0],d.rgb=[h,h,h]);c.resolve(b);return c}});
|
||||
return b}(),Ja=function(){function b(a){H.call(this,a);if(!a.data){a=a.dict;var c=this.data,b=a.get("Contents"),d=a.get("T");c.content=V(b||"");c.title=V(d||"");c.name=a.has("Name")?a.get("Name").name:"Note"}}q.inherit(b,H,{getOperatorList:function(a){a=new G;a.resolve(new OperatorList);return a},hasHtml:function(){return!0},getHtmlElement:function(a){W&&m("getHtmlElement() shall be called from main thread");var c=this.data,b=c.rect;10>b[3]-b[1]&&(b[3]=b[1]+10);10>b[2]-b[0]&&(b[2]=b[0]+(b[3]-b[1]));
|
||||
var d=this.getEmptyContainer("section",b);d.className="annotText";a=document.createElement("img");a.style.height=d.style.height;var g=c.name;a.src=PDFJS.imageResourcesPath+"annotation-"+g.toLowerCase()+".svg";a.alt="[{{type}} Annotation]";a.dataset.l10nId="text_annotation_type";a.dataset.l10nArgs=JSON.stringify({type:g});var f=document.createElement("div");f.setAttribute("hidden",!0);var g=document.createElement("h1"),h=document.createElement("p");f.style.left=Math.floor(b[2]-b[0])+"px";f.style.top=
|
||||
"0px";g.textContent=c.title;if(c.content||c.title){for(var b=document.createElement("span"),c=c.content.split(/(?:\r\n?|\n)/),k=0,l=c.length;k<l;++k)b.appendChild(document.createTextNode(c[k])),k<l-1&&b.appendChild(document.createElement("br"));h.appendChild(b);b=function(){d.style.zIndex+=1;f.removeAttribute("hidden")};c=function(a){if(a.toElement||a.relatedTarget)d.style.zIndex-=1,f.setAttribute("hidden",!0)};f.addEventListener("mouseover",b,!1);f.addEventListener("mouseout",c,!1);a.addEventListener("mouseover",
|
||||
b,!1);a.addEventListener("mouseout",c,!1)}else f.setAttribute("hidden",!0);f.appendChild(g);f.appendChild(h);d.appendChild(a);d.appendChild(f);return d}});return b}(),Ia=function(){function b(a){H.call(this,a);if(!a.data){var c=a.dict;a=this.data;var b=c.get("A");if(b)if(c=b.get("S").name,"URI"===c){var d;d=b.get("URI");d=0===d.indexOf("www.")?"http://"+d:d;$(d,!1)||(d="");a.url=d}else"GoTo"===c?a.dest=b.get("D"):"GoToR"===c?(c=b.get("F"),R(c)&&(d=c.get("F")||""),$(d,!1)||(d=""),a.url=d,a.dest=b.get("D")):
|
||||
"Named"===c?a.action=b.get("N").name:x("unrecognized link type: "+c);else c.has("Dest")&&(d=c.get("Dest"),a.dest=P(d)?d.name:d)}}q.inherit(b,H,{hasOperatorList:function(){return!1},hasHtml:function(){return!0},getHtmlElement:function(a){a=this.data.rect;var c=document.createElement("a"),b=this.data.borderWidth;c.style.borderWidth=b+"px";for(var d=this.data.color,g=[],f=0;3>f;++f)g[f]=Math.round(255*d[f]);c.style.borderColor=q.makeCssRgb(g);c.style.borderStyle="solid";d=a[3]-a[1]-2*b;c.style.width=
|
||||
a[2]-a[0]-2*b+"px";c.style.height=d+"px";c.href=this.data.url||"";return c}});return b}();PDFJS.maxImageSize=void 0===PDFJS.maxImageSize?-1:PDFJS.maxImageSize;PDFJS.disableFontFace=void 0===PDFJS.disableFontFace?!1:PDFJS.disableFontFace;PDFJS.imageResourcesPath=void 0===PDFJS.imageResourcesPath?"":PDFJS.imageResourcesPath;PDFJS.disableWorker=void 0===PDFJS.disableWorker?!1:PDFJS.disableWorker;PDFJS.workerSrc=void 0===PDFJS.workerSrc?null:PDFJS.workerSrc;PDFJS.disableRange=void 0===PDFJS.disableRange?
|
||||
!1:PDFJS.disableRange;PDFJS.disableAutoFetch=void 0===PDFJS.disableAutoFetch?!1:PDFJS.disableAutoFetch;PDFJS.pdfBug=void 0===PDFJS.pdfBug?!1:PDFJS.pdfBug;PDFJS.postMessageTransfers=void 0===PDFJS.postMessageTransfers?!0:PDFJS.postMessageTransfers;PDFJS.disableCreateObjectURL=void 0===PDFJS.disableCreateObjectURL?!1:PDFJS.disableCreateObjectURL;PDFJS.verbosity=void 0===PDFJS.verbosity?PDFJS.VERBOSITY_LEVELS.warnings:PDFJS.verbosity;PDFJS.getDocument=function(b,a,c,e){var d,g;"string"===typeof b?b=
|
||||
{url:b}:"object"==typeof b&&null!==b&&void 0!==b&&"byteLength"in b?b={data:b}:"object"!==typeof b&&m("Invalid parameter in getDocument, need either Uint8Array, string or a parameter object");b.url||b.data||m("Invalid parameter array, need either .data or .url");var f={};for(d in b)f[d]="url"===d&&"undefined"!==typeof window?pa(window.location.href,b[d]):b[d];b=new PDFJS.LegacyPromise;d=new PDFJS.LegacyPromise;g=new La(b,d,a,e);b.then(function(){g.passwordCallback=c;g.fetchDocument(f)});return d};
|
||||
var Ma=function(){function b(a,c){this.pdfInfo=a;this.transport=c}b.prototype={get numPages(){return this.pdfInfo.numPages},get fingerprint(){return this.pdfInfo.fingerprint},get embeddedFontsUsed(){return this.transport.embeddedFontsUsed},getPage:function(a){return this.transport.getPage(a)},getPageIndex:function(a){return this.transport.getPageIndex(a)},getDestinations:function(){return this.transport.getDestinations()},getJavaScript:function(){var a=new PDFJS.LegacyPromise;a.resolve(this.pdfInfo.javaScript);
|
||||
return a},getOutline:function(){var a=new PDFJS.LegacyPromise;a.resolve(this.pdfInfo.outline);return a},getMetadata:function(){var a=new PDFJS.LegacyPromise,c=this.pdfInfo.metadata;a.resolve({info:this.pdfInfo.info,metadata:c?new PDFJS.Metadata(c):null});return a},isEncrypted:function(){var a=new PDFJS.LegacyPromise;a.resolve(this.pdfInfo.encrypted);return a},getData:function(){var a=new PDFJS.LegacyPromise;this.transport.getData(a);return a},dataLoaded:function(){return this.transport.dataLoaded()},
|
||||
cleanup:function(){this.transport.startCleanup()},destroy:function(){this.transport.destroy()}};return b}(),Pa=function(){function b(a,c){this.pageInfo=a;this.transport=c;this.stats=new ua;this.stats.enabled=!!t.PDFJS.enableStats;this.commonObjs=c.commonObjs;this.objs=new ma;this.pendingDestroy=this.cleanupAfterRender=this.receivingOperatorList=!1;this.renderTasks=[]}b.prototype={get pageNumber(){return this.pageInfo.pageIndex+1},get rotate(){return this.pageInfo.rotate},get ref(){return this.pageInfo.ref},
|
||||
get view(){return this.pageInfo.view},getViewport:function(a,c){2>arguments.length&&(c=this.rotate);return new PDFJS.PageViewport(this.view,a,c,0,0)},getAnnotations:function(){if(this.annotationsPromise)return this.annotationsPromise;var a=new PDFJS.LegacyPromise;this.annotationsPromise=a;this.transport.getAnnotations(this.pageInfo.pageIndex);return a},render:function(a){function c(a){var c=f.renderTasks.indexOf(d);0<=c&&f.renderTasks.splice(c,1);f.cleanupAfterRender&&(f.pendingDestroy=!0);f._tryDestroy();
|
||||
a?g.promise.reject(a):g.promise.resolve();b.timeEnd("Rendering");b.timeEnd("Overall")}var b=this.stats;b.time("Overall");this.pendingDestroy=!1;this.displayReadyPromise||(this.receivingOperatorList=!0,this.displayReadyPromise=new G,this.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this.stats.time("Page Request"),this.transport.messageHandler.send("RenderPageRequest",{pageIndex:this.pageNumber-1}));var d=new Na(c,a,this.objs,this.commonObjs,this.operatorList,this.pageNumber);this.renderTasks.push(d);
|
||||
var g=new Oa(d),f=this;this.displayReadyPromise.then(function(a){f.pendingDestroy?c():(b.time("Rendering"),d.initalizeGraphics(a),d.operatorListChanged())},function(a){c(a)});return g},getTextContent:function(){var a=new PDFJS.LegacyPromise;this.transport.messageHandler.send("GetTextContent",{pageIndex:this.pageNumber-1},function(c){a.resolve(c)});return a},getOperationList:function(){var a=new PDFJS.LegacyPromise;a.resolve({dependencyFontsID:null,operatorList:null});return a},destroy:function(){this.pendingDestroy=
|
||||
!0;this._tryDestroy()},_tryDestroy:function(){this.pendingDestroy&&0===this.renderTasks.length&&!this.receivingOperatorList&&(delete this.operatorList,delete this.displayReadyPromise,this.objs.clear(),this.pendingDestroy=!1)},_startRenderPage:function(a){this.displayReadyPromise.resolve(a)},_renderPageChunk:function(a){for(var c=0,b=a.length;c<b;c++)this.operatorList.fnArray.push(a.fnArray[c]),this.operatorList.argsArray.push(a.argsArray[c]);this.operatorList.lastChunk=a.lastChunk;for(c=0;c<this.renderTasks.length;c++)this.renderTasks[c].operatorListChanged();
|
||||
a.lastChunk&&(this.receivingOperatorList=!1,this._tryDestroy())}};return b}(),La=function(){function b(a,c,b,d){this.pdfDataRangeTransport=b;this.workerReadyPromise=c;this.progressCallback=d;this.commonObjs=new ma;this.pageCache=[];this.pagePromises=[];this.embeddedFontsUsed=!1;this.passwordCallback=null;if(!t.PDFJS.disableWorker&&"undefined"!==typeof Worker){(c=PDFJS.workerSrc)||m("No PDFJS.workerSrc specified");try{var g=new Worker(c),f=new aa("main",g);this.messageHandler=f;f.on("test",function(b){b&&
|
||||
b.supportTypedArray?(this.worker=g,b.supportTransfers||(PDFJS.postMessageTransfers=!1),this.setupMessageHandler(f),a.resolve()):(t.PDFJS.disableWorker=!0,this.loadFakeWorkerFiles().then(function(){this.setupFakeWorker();a.resolve()}.bind(this)))}.bind(this));var h=new Uint8Array([PDFJS.postMessageTransfers?255:0]);try{f.send("test",h,null,[h.buffer])}catch(k){K("Cannot use postMessage transfers"),h[0]=0,f.send("test",h)}return}catch(l){K("The worker has been disabled.")}}t.PDFJS.disableWorker=!0;
|
||||
this.loadFakeWorkerFiles().then(function(){this.setupFakeWorker();a.resolve()}.bind(this))}b.prototype={destroy:function(){this.pageCache=[];this.pagePromises=[];var a=this;this.messageHandler.send("Terminate",null,function(){a.worker&&a.worker.terminate()})},loadFakeWorkerFiles:function(){PDFJS.fakeWorkerFilesLoadedPromise||(PDFJS.fakeWorkerFilesLoadedPromise=new G,q.loadScript(PDFJS.workerSrc,function(){PDFJS.fakeWorkerFilesLoadedPromise.resolve()}));return PDFJS.fakeWorkerFilesLoadedPromise},setupFakeWorker:function(){x("Setting up fake worker.");
|
||||
var a={postMessage:function(b){a.onmessage({data:b})},terminate:function(){}},b=new aa("main",a);this.setupMessageHandler(b);PDFJS.WorkerMessageHandler.setup(b)},setupMessageHandler:function(a){function b(c){a.send("UpdatePassword",c)}this.messageHandler=a;var e=this.pdfDataRangeTransport;e&&(e.addRangeListener(function(b,c){a.send("OnDataRange",{begin:b,chunk:c})}),e.addProgressListener(function(b){a.send("OnDataProgress",{loaded:b})}),a.on("RequestDataRange",function(a){e.requestDataRange(a.begin,
|
||||
a.end)},this));a.on("GetDoc",function(a){this.pdfDocument=a=new Ma(a.pdfInfo,this);this.workerReadyPromise.resolve(a)},this);a.on("NeedPassword",function(a){if(this.passwordCallback)return this.passwordCallback(b,ha.NEED_PASSWORD);this.workerReadyPromise.reject(a.exception.message,a.exception)},this);a.on("IncorrectPassword",function(a){if(this.passwordCallback)return this.passwordCallback(b,ha.INCORRECT_PASSWORD);this.workerReadyPromise.reject(a.exception.message,a.exception)},this);a.on("InvalidPDF",
|
||||
function(a){this.workerReadyPromise.reject(a.exception.name,a.exception)},this);a.on("MissingPDF",function(a){this.workerReadyPromise.reject(a.exception.message,a.exception)},this);a.on("UnknownError",function(a){this.workerReadyPromise.reject(a.exception.message,a.exception)},this);a.on("GetPage",function(a){a=a.pageInfo;var b=new Pa(a,this);this.pageCache[a.pageIndex]=b;this.pagePromises[a.pageIndex].resolve(b)},this);a.on("GetAnnotations",function(a){this.pageCache[a.pageIndex].annotationsPromise.resolve(a.annotations)},
|
||||
this);a.on("StartRenderPage",function(a){var b=this.pageCache[a.pageIndex];b.stats.timeEnd("Page Request");b._startRenderPage(a.transparency)},this);a.on("RenderPageChunk",function(a){this.pageCache[a.pageIndex]._renderPageChunk(a.operatorList)},this);a.on("commonobj",function(a){var b=a[0],c=a[1];if(!this.commonObjs.hasData(b))switch(c){case "Font":a=a[2];var e;if("error"in a){var k=a.error;x("Error during font loading: "+k);this.commonObjs.resolve(b,k);break}else e=new Qa(a);Q.bind([e],function(a){this.commonObjs.resolve(b,
|
||||
e)}.bind(this));break;case "FontPath":this.commonObjs.resolve(b,a[2]);break;default:k("Got unknown common object type "+c)}},this);a.on("obj",function(a){var b=a[0],c=a[2],e=this.pageCache[a[1]];if(!e.objs.hasData(b))switch(c){case "JpegStream":a=a[3];ra(b,a,e.objs);break;case "Image":a=a[3];e.objs.resolve(b,a);"data"in a&&8E6<a.data.length&&(e.cleanupAfterRender=!0);break;default:m("Got unknown object type "+c)}},this);a.on("DocProgress",function(a){this.progressCallback&&this.progressCallback({loaded:a.loaded,
|
||||
total:a.total})},this);a.on("DocError",function(a){this.workerReadyPromise.reject(a)},this);a.on("PageError",function(a){var b=this.pageCache[a.pageNum-1];b.displayReadyPromise?b.displayReadyPromise.reject(a.error):m(a.error)},this);a.on("JpegDecode",function(a,b){var c=a[0],e=a[1];3!=e&&1!=e&&m("Only 3 component or 1 component can be returned");var k=new Image;k.onload=function(){var a=k.width,c=k.height,d=a*c,f=4*d,d=new Uint8Array(d*e),s=fa(a,c).getContext("2d");s.drawImage(k,0,0);s=s.getImageData(0,
|
||||
0,a,c).data;if(3==e)for(var w=0,m=0;w<f;w+=4,m+=3)d[m]=s[w],d[m+1]=s[w+1],d[m+2]=s[w+2];else if(1==e)for(m=w=0;w<f;w+=4,m++)d[m]=s[w];b.resolve({data:d,width:a,height:c})}.bind(this);k.src=c})},fetchDocument:function(a){a.disableAutoFetch=PDFJS.disableAutoFetch;a.chunkedViewerLoading=!!this.pdfDataRangeTransport;this.messageHandler.send("GetDocRequest",{source:a,disableRange:PDFJS.disableRange,maxImageSize:PDFJS.maxImageSize,disableFontFace:PDFJS.disableFontFace,disableCreateObjectURL:PDFJS.disableCreateObjectURL,
|
||||
verbosity:PDFJS.verbosity})},getData:function(a){this.messageHandler.send("GetData",null,function(b){a.resolve(b)})},dataLoaded:function(){var a=new PDFJS.LegacyPromise;this.messageHandler.send("DataLoaded",null,function(b){a.resolve(b)});return a},getPage:function(a,b){var e=a-1;if(e in this.pagePromises)return this.pagePromises[e];b=new PDFJS.LegacyPromise;this.pagePromises[e]=b;this.messageHandler.send("GetPageRequest",{pageIndex:e});return b},getPageIndex:function(a){var b=new PDFJS.LegacyPromise;
|
||||
this.messageHandler.send("GetPageIndex",{ref:a},function(a){b.resolve(a)});return b},getAnnotations:function(a){this.messageHandler.send("GetAnnotationsRequest",{pageIndex:a})},getDestinations:function(){var a=new PDFJS.LegacyPromise;this.messageHandler.send("GetDestinations",null,function(b){a.resolve(b)});return a},startCleanup:function(){this.messageHandler.send("Cleanup",null,function(){for(var a=0,b=this.pageCache.length;a<b;a++){var e=this.pageCache[a];e&&e.destroy()}this.commonObjs.clear();
|
||||
Q.clear()}.bind(this))}};return b}(),ma=function(){function b(){this.objs={}}b.prototype={ensureObj:function(a){if(this.objs[a])return this.objs[a];var b={promise:new G,data:null,resolved:!1};return this.objs[a]=b},get:function(a,b){if(b)return this.ensureObj(a).promise.then(b),null;var e=this.objs[a];e&&e.resolved||m("Requesting object that isn't resolved yet "+a);return e.data},resolve:function(a,b){var e=this.ensureObj(a);e.resolved=!0;e.data=b;e.promise.resolve(b)},isResolved:function(a){var b=
|
||||
this.objs;return b[a]?b[a].resolved:!1},hasData:function(a){return this.isResolved(a)},getData:function(a){var b=this.objs;return b[a]&&b[a].resolved?b[a].data:null},clear:function(){this.objs={}}};return b}(),Oa=function(){function b(a){this.internalRenderTask=a;this.promise=new PDFJS.LegacyPromise}b.prototype.cancel=function(){this.internalRenderTask.cancel()};return b}(),Na=function(){function b(a,b,e,d,g,f){this.callback=a;this.params=b;this.objs=e;this.commonObjs=d;this.operatorListIdx=null;
|
||||
this.operatorList=g;this.pageNumber=f;this.running=!1;this.graphicsReadyCallback=null;this.cancelled=this.graphicsReady=!1}b.prototype={initalizeGraphics:function(a){if(!this.cancelled){PDFJS.pdfBug&&"StepperManager"in t&&t.StepperManager.enabled&&(this.stepper=t.StepperManager.create(this.pageNumber-1),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());var b=this.params;this.gfx=new la(b.canvasContext,this.commonObjs,this.objs,b.textLayer,b.imageLayer);
|
||||
this.gfx.beginDrawing(b.viewport,a);this.operatorListIdx=0;this.graphicsReady=!0;this.graphicsReadyCallback&&this.graphicsReadyCallback()}},cancel:function(){this.running=!1;this.cancelled=!0;this.callback("cancelled")},operatorListChanged:function(){this.graphicsReady?(this.stepper&&this.stepper.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continue.bind(this))},_continue:function(){this.running=!0;this.cancelled||
|
||||
(this.params.continueCallback?this.params.continueCallback(this._next.bind(this)):this._next())},_next:function(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continue.bind(this),this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),this.callback())))}};return b}();PDFJS.Metadata=function(){function b(a){return a.replace(/>\\376\\377([^<]+)/g,function(a,
|
||||
b){for(var c=b.replace(/\\([0-3])([0-7])([0-7])/g,function(a,b,c,d){return String.fromCharCode(64*b+8*c+1*d)}),f="",h=0;h<c.length;h+=2)var k=256*c.charCodeAt(h)+c.charCodeAt(h+1),f=f+("&#x"+(65536+k).toString(16).substring(1)+";");return">"+f})}function a(a){"string"===typeof a?(a=b(a),a=(new DOMParser).parseFromString(a,"application/xml")):a instanceof Document||m("Metadata: Invalid metadata object");this.metaDocument=a;this.metadata={};this.parse()}a.prototype={parse:function(){var a=this.metaDocument.documentElement;
|
||||
if("rdf:rdf"!==a.nodeName.toLowerCase())for(a=a.firstChild;a&&"rdf:rdf"!==a.nodeName.toLowerCase();)a=a.nextSibling;var b=a?a.nodeName.toLowerCase():null;if(a&&"rdf:rdf"===b&&a.hasChildNodes()){var a=a.childNodes,d,g,f,h,k,l;f=0;for(k=a.length;f<k;f++)if(b=a[f],"rdf:description"===b.nodeName.toLowerCase())for(h=0,l=b.childNodes.length;h<l;h++)"#text"!==b.childNodes[h].nodeName.toLowerCase()&&(d=b.childNodes[h],g=d.nodeName.toLowerCase(),this.metadata[g]=d.textContent.trim())}},get:function(a){return this.metadata[a]||
|
||||
null},has:function(a){return"undefined"!==typeof this.metadata[a]}};return a}();var J=function(){var b={};return{getCanvas:function(a,c,e,d){a in b?(a=b[a],a.canvas.width=c,a.canvas.height=e,a.context.setTransform(1,0,0,1,0,0)):(c=fa(c,e),e=c.getContext("2d"),d&&ga(e),b[a]=a={canvas:c,context:e});return a},clear:function(){b={}}}}(),na=function(){function b(a){this.alphaIsShape=!1;this.fontSize=0;this.fontSizeScale=1;this.textMatrix=ia;this.fontMatrix=ba;this.wordSpacing=this.charSpacing=this.lineY=
|
||||
this.lineX=this.y=this.x=this.leading=0;this.textHScale=1;this.textRenderingMode=X;this.textRise=0;this.fillColorSpace=r.singletons.gray;this.fillColorSpaceObj=null;this.strokeColorSpace=r.singletons.gray;this.strokeColorObj=this.fillColorObj=this.strokeColorSpaceObj=null;this.strokeColor=this.fillColor="#000000";this.lineWidth=this.strokeAlpha=this.fillAlpha=1;this.old=a}b.prototype={clone:function(){return Object.create(this)},setCurrentPoint:function(a,b){this.x=a;this.y=b}};return b}(),la=function(){function b(a,
|
||||
b,c,d,e){this.ctx=a;this.current=new na;this.stateStack=[];this.pendingClip=null;this.pendingEOFill=!1;this.xobjs=this.res=null;this.commonObjs=b;this.objs=c;this.textLayer=d;this.imageLayer=e;this.groupStack=[];this.baseTransform=this.processingType3=null;this.baseTransformStack=[];this.groupLevel=0;a&&ga(a)}function a(a,b){if("undefined"!==typeof ImageData&&b instanceof ImageData)a.putImageData(b,0,0);else{var c=b.height/16|0,d=b.height-16*c,e=64*b.width,f=b.width*d*4,g=a.createImageData(b.width,
|
||||
16),h=0,m=b.data,C=g.data,u="set"in C&&"subarray"in m,q=0;for(;q<c;q++){if(u)C.set(m.subarray(h,h+e)),h+=e;else for(var r=0;r<e;r++)g.data[r]=b.data[h++];a.putImageData(g,0,16*q)}if(0!==d){if(u)C.set(m.subarray(h,h+f));else for(r=0;r<f;r++)g.data[r]=b.data[h++];a.putImageData(g,0,16*c)}}}function c(a,b){for(var c=b.width,d=b.height,e=a.createImageData(c,d),f=b.data,g=e.data,h=0,m=3,q=0;q<d;q++)for(var u=0,r=0;r<c;r++){if(!u)var t=f[h++],u=128;t&u||(g[m]=255);m+=4;u>>=1}a.putImageData(e,0,0)}var e=
|
||||
["butt","round","square"],d=["miter","round","bevel"],g={},f={};b.prototype={beginDrawing:function(a,b){var c=this.ctx.canvas.width,d=this.ctx.canvas.height;b?this.ctx.clearRect(0,0,c,d):(this.ctx.mozOpaque=!0,this.ctx.save(),this.ctx.fillStyle="rgb(255, 255, 255)",this.ctx.fillRect(0,0,c,d),this.ctx.restore());c=a.transform;this.baseTransform=c.slice();this.ctx.save();this.ctx.transform.apply(this.ctx,c);this.textLayer&&this.textLayer.beginLayout();this.imageLayer&&this.imageLayer.beginLayout()},
|
||||
executeOperatorList:function(a,b,c,d){var e=a.argsArray;a=a.fnArray;b=b||0;var f=e.length;if(f==b)return b;for(var g=Date.now()+15,h=this.commonObjs,m=this.objs,q,u=Promise.resolve();;){if(d&&b===d.nextBreakPoint)return d.breakIt(b,c),b;q=a[b];if(q!==y.dependency)this[q].apply(this,e[b]);else{q=e[b];for(var r=0,t=q.length;r<t;r++){var x=q[r],v="g_"==x.substring(0,2);if(!v&&!m.isResolved(x))return m.get(x,c),b;if(v&&!h.isResolved(x))return h.get(x,c),b}}b++;if(b==f)return b;if(c&&Date.now()>g)return u.then(c),
|
||||
b}},endDrawing:function(){this.ctx.restore();J.clear();this.textLayer&&this.textLayer.endLayout();this.imageLayer&&this.imageLayer.endLayout()},setLineWidth:function(a){this.current.lineWidth=a;this.ctx.lineWidth=a},setLineCap:function(a){this.ctx.lineCap=e[a]},setLineJoin:function(a){this.ctx.lineJoin=d[a]},setMiterLimit:function(a){this.ctx.miterLimit=a},setDash:function(a,b){var c=this.ctx;"setLineDash"in c?(c.setLineDash(a),c.lineDashOffset=b):(c.mozDash=a,c.mozDashOffset=b)},setRenderingIntent:function(a){},
|
||||
setFlatness:function(a){},setGState:function(a){for(var b=0,c=a.length;b<c;b++){var d=a[b],e=d[1];switch(d[0]){case "LW":this.setLineWidth(e);break;case "LC":this.setLineCap(e);break;case "LJ":this.setLineJoin(e);break;case "ML":this.setMiterLimit(e);break;case "D":this.setDash(e[0],e[1]);break;case "RI":this.setRenderingIntent(e);break;case "FL":this.setFlatness(e);break;case "Font":this.setFont(e[0],e[1]);break;case "CA":this.current.strokeAlpha=d[1];break;case "ca":this.current.fillAlpha=d[1];
|
||||
this.ctx.globalAlpha=d[1];break;case "BM":e&&e.name&&"Normal"!==e.name?(d=e.name.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()}).substring(1),this.ctx.globalCompositeOperation=d,this.ctx.globalCompositeOperation!==d&&x('globalCompositeOperation "'+d+'" is not supported')):this.ctx.globalCompositeOperation="source-over"}}},save:function(){this.ctx.save();var a=this.current;this.stateStack.push(a);this.current=a.clone()},restore:function(){var a=this.stateStack.pop();a&&(this.current=a,this.ctx.restore())},
|
||||
transform:function(a,b,c,d,e,f){this.ctx.transform(a,b,c,d,e,f)},moveTo:function(a,b){this.ctx.moveTo(a,b);this.current.setCurrentPoint(a,b)},lineTo:function(a,b){this.ctx.lineTo(a,b);this.current.setCurrentPoint(a,b)},curveTo:function(a,b,c,d,e,f){this.ctx.bezierCurveTo(a,b,c,d,e,f);this.current.setCurrentPoint(e,f)},curveTo2:function(a,b,c,d){var e=this.current;this.ctx.bezierCurveTo(e.x,e.y,a,b,c,d);e.setCurrentPoint(c,d)},curveTo3:function(a,b,c,d){this.curveTo(a,b,c,d,c,d);this.current.setCurrentPoint(c,
|
||||
d)},closePath:function(){this.ctx.closePath()},rectangle:function(a,b,c,d){this.ctx.rect(a,b,c,d)},stroke:function(a){a="undefined"!==typeof a?a:!0;var b=this.ctx,c=this.current.strokeColor;0===this.current.lineWidth&&(b.lineWidth=this.getSinglePixelWidth());b.globalAlpha=this.current.strokeAlpha;c&&c.hasOwnProperty("type")&&"Pattern"===c.type?(b.save(),b.strokeStyle=c.getPattern(b,this),b.stroke(),b.restore()):b.stroke();a&&this.consumePath();b.globalAlpha=this.current.fillAlpha},closeStroke:function(){this.closePath();
|
||||
this.stroke()},fill:function(a){a="undefined"!==typeof a?a:!0;var b=this.ctx,c=this.current.fillColor,d=!1;c&&c.hasOwnProperty("type")&&"Pattern"===c.type&&(b.save(),b.fillStyle=c.getPattern(b,this),d=!0);if(this.pendingEOFill){if("mozFillRule"in this.ctx)this.ctx.mozFillRule="evenodd",this.ctx.fill(),this.ctx.mozFillRule="nonzero";else try{this.ctx.fill("evenodd")}catch(e){this.ctx.fill()}this.pendingEOFill=!1}else this.ctx.fill();d&&b.restore();a&&this.consumePath()},eoFill:function(){this.pendingEOFill=
|
||||
!0;this.fill()},fillStroke:function(){this.fill(!1);this.stroke(!1);this.consumePath()},eoFillStroke:function(){this.pendingEOFill=!0;this.fillStroke()},closeFillStroke:function(){this.closePath();this.fillStroke()},closeEOFillStroke:function(){this.pendingEOFill=!0;this.closePath();this.fillStroke()},endPath:function(){this.consumePath()},clip:function(){this.pendingClip=g},eoClip:function(){this.pendingClip=f},beginText:function(){this.current.textMatrix=ia;this.current.x=this.current.lineX=0;this.current.y=
|
||||
this.current.lineY=0},endText:function(){if("pendingTextPaths"in this){var a=this.pendingTextPaths,b=this.ctx;b.save();b.beginPath();for(var c=0;c<a.length;c++){var d=a[c];b.setTransform.apply(b,d.transform);b.translate(d.x,d.y);d.addToPath(b,d.fontSize)}b.restore();b.clip();b.beginPath();delete this.pendingTextPaths}else this.ctx.beginPath()},setCharSpacing:function(a){this.current.charSpacing=a},setWordSpacing:function(a){this.current.wordSpacing=a},setHScale:function(a){this.current.textHScale=
|
||||
a/100},setLeading:function(a){this.current.leading=-a},setFont:function(a,b){var c=this.commonObjs.get(a),d=this.current;c||m("Can't find font for "+a);d.fontMatrix=c.fontMatrix?c.fontMatrix:ba;0!==d.fontMatrix[0]&&0!==d.fontMatrix[3]||x("Invalid font matrix for font "+a);0>b?(b=-b,d.fontDirection=-1):d.fontDirection=1;this.current.font=c;this.current.fontSize=b;if(!c.coded){var d=c.black?c.bold?"bolder":"bold":c.bold?"bold":"normal",e=c.italic?"italic":"normal",c='"'+(c.loadedName||"sans-serif")+
|
||||
'", '+c.fallbackName,f=16<=b?b:16;this.current.fontSizeScale=16!=f?1:b/16;this.ctx.font=e+" "+d+" "+f+"px "+c}},setTextRenderingMode:function(a){this.current.textRenderingMode=a},setTextRise:function(a){this.current.textRise=a},moveText:function(a,b){this.current.x=this.current.lineX+=a;this.current.y=this.current.lineY+=b},setLeadingMoveText:function(a,b){this.setLeading(-b);this.moveText(a,b)},setTextMatrix:function(a,b,c,d,e,f){this.current.textMatrix=[a,b,c,d,e,f];this.current.x=this.current.lineX=
|
||||
0;this.current.y=this.current.lineY=0},nextLine:function(){this.moveText(0,this.current.leading)},applyTextTransforms:function(){var a=this.ctx,b=this.current;a.transform.apply(a,b.textMatrix);a.translate(b.x,b.y+b.textRise);0<b.fontDirection?a.scale(b.textHScale,-1):a.scale(-b.textHScale,1)},createTextGeometry:function(){var a={},b=this.current.font,c=this.ctx.mozCurrentTransform,d=c[0],e=c[1],f=c[2],g=c[3],h=c[4],c=c[5],m=0<=d?Math.sqrt(d*d+e*e):-Math.sqrt(d*d+e*e),f=0<=g?Math.sqrt(f*f+g*g):-Math.sqrt(f*
|
||||
f+g*g),d=Math.atan2(e,d);a.x=h;a.y=c;a.hScale=m;a.vScale=f;a.angle=d;a.spaceWidth=b.spaceWidth;a.fontName=b.loadedName;a.fontFamily=b.fallbackName;a.fontSize=this.current.fontSize;a.ascent=b.ascent;a.descent=b.descent;return a},paintChar:function(a,b,c){var d=this.ctx,e=this.current,f=e.font,g=e.fontSize/e.fontSizeScale,h=e.textRenderingMode,e=h&3,h=!!(h&4),m;if(f.disableFontFace||h)m=f.getPathGenerator(this.commonObjs,a);f.disableFontFace?(d.save(),d.translate(b,c),d.beginPath(),m(d,g),e!==X&&2!==
|
||||
e||d.fill(),1!==e&&2!==e||d.stroke(),d.restore()):(e!==X&&2!==e||d.fillText(a,b,c),1!==e&&2!==e||d.strokeText(a,b,c));h&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:d.mozCurrentTransform,x:b,y:c,fontSize:g,addToPath:m})},get isFontSubpixelAAEnabled(){var a=document.createElement("canvas").getContext("2d");a.scale(1.5,1);a.fillText("I",0,10);for(var a=a.getImageData(0,0,10,10).data,b=!1,c=3;c<a.length;c+=4)if(0<a[c]&&255>a[c]){b=!0;break}return U(this,"isFontSubpixelAAEnabled",
|
||||
b)},showText:function(a,b){var c=this.ctx,d=this.current,e=d.font,f=d.fontSize,g=d.fontSizeScale,h=d.charSpacing,m=d.wordSpacing,r=d.textHScale*d.fontDirection,u=d.fontMatrix||ba,M=a.length,t,x=this.textLayer&&!b?!0:!1,v=0,D=e.vertical,K=e.defaultVMetrics;if(e.coded){c.save();c.transform.apply(c,d.textMatrix);c.translate(d.x,d.y);c.scale(r,1);x&&(this.save(),c.scale(1,-1),t=this.createTextGeometry(),this.restore());for(var I=0;I<M;++I){var B=a[I];if(null===B)this.ctx.translate(m,0),d.x+=m*r;else{this.processingType3=
|
||||
B;this.save();c.scale(f,f);c.transform.apply(c,u);this.executeOperatorList(B.operatorList);this.restore();var O=(q.applyTransform([B.width,0],u)[0]*f+h)*d.fontDirection;c.translate(O,0);d.x+=O*r;v+=O}}c.restore();this.processingType3=null}else{c.save();this.applyTextTransforms();var I=d.lineWidth,u=d.textMatrix[0],y=d.textMatrix[1],u=Math.sqrt(u*u+y*y),I=0===u||0===I?this.getSinglePixelWidth():I/u;x&&(t=this.createTextGeometry());1!=g&&(c.scale(g,g),I/=g);c.lineWidth=I;for(I=u=0;I<M;++I)if(B=a[I],
|
||||
null===B)u+=d.fontDirection*m;else{var y=!1,H=B.fontChar,E=B.vmetric||K;if(D)var L=B.vmetric?E[1]:0.5*B.width,L=-L*f*d.fontMatrix[0],P=E[2]*f*d.fontMatrix[0];var O=E?-E[0]:B.width,E=O*f*d.fontMatrix[0]+h*d.fontDirection,G=B.accent,J,N;B.disabled||(D?(B=L/g,J=(u+P)/g):(B=u/g,J=0),e.remeasure&&0<O&&this.isFontSubpixelAAEnabled&&(y=1E3*c.measureText(H).width/d.fontSize*d.fontSizeScale,O/=y,y=!0,c.save(),c.scale(O,1),B/=O,G&&(N/=O)),this.paintChar(H,B,J),G&&(N=B+G.offset.x/g,H=J-G.offset.y/g,this.paintChar(G.fontChar,
|
||||
N,H)));u+=E;v+=E;y&&c.restore()}D?d.y-=u*r:d.x+=u*r;c.restore()}x&&(t.canvasWidth=v,D&&(t.angle+=Math.PI/2),this.textLayer.appendText(t));return v},showSpacedText:function(a){var b=this.ctx,c=this.current,d=c.fontSize,e=0.0010*c.textHScale*c.fontDirection,f=a.length,g,h=0,m=this.textLayer?!0:!1,q=c.font.vertical,r=0;m&&(b.save(),this.applyTextTransforms(),g=this.createTextGeometry(),b.restore());for(b=0;b<f;++b){var t=a[b];"number"==typeof t?(t=-t*d*e,q?c.y+=t:c.x+=t,m&&(r+=t)):(t=this.showText(t,
|
||||
!0),m&&(h+=r+t,r=0))}m&&(g.canvasWidth=h,q&&(g.angle+=Math.PI/2),this.textLayer.appendText(g))},nextLineShowText:function(a){this.nextLine();this.showText(a)},nextLineSetSpacingShowText:function(a,b,c){this.setWordSpacing(a);this.setCharSpacing(b);this.nextLineShowText(c)},setCharWidth:function(a,b){},setCharWidthAndBounds:function(a,b,c,d,e,f){this.rectangle(c,d,e-c,f-d);this.clip();this.endPath()},setStrokeColorSpace:function(a){this.current.strokeColorSpace=r.fromIR(a)},setFillColorSpace:function(a){this.current.fillColorSpace=
|
||||
r.fromIR(a)},setStrokeColor:function(){var a=this.current.strokeColorSpace.getRgb(arguments,0),a=q.makeCssRgb(a);this.ctx.strokeStyle=a;this.current.strokeColor=a},getColorN_Pattern:function(a,b){if("TilingPattern"==a[0]){var c=a[1],d=b.base,e;d&&(e=d.getRgb(c,0));c=new Ca(a,e,this.ctx,this.objs,this.commonObjs,this.baseTransform)}else"RadialAxial"==a[0]||"Dummy"==a[0]?c=ka.shadingFromIR(a):m("Unkown IR type "+a[0]);return c},setStrokeColorN:function(){var a=this.current.strokeColorSpace;"Pattern"==
|
||||
a.name?this.current.strokeColor=this.getColorN_Pattern(arguments,a):this.setStrokeColor.apply(this,arguments)},setFillColor:function(){var a=this.current.fillColorSpace.getRgb(arguments,0),a=q.makeCssRgb(a);this.ctx.fillStyle=a;this.current.fillColor=a},setFillColorN:function(){var a=this.current.fillColorSpace;"Pattern"==a.name?this.current.fillColor=this.getColorN_Pattern(arguments,a):this.setFillColor.apply(this,arguments)},setStrokeGray:function(a){this.current.strokeColorSpace=r.singletons.gray;
|
||||
var b=this.current.strokeColorSpace.getRgb(arguments,0),b=q.makeCssRgb(b);this.ctx.strokeStyle=b;this.current.strokeColor=b},setFillGray:function(a){this.current.fillColorSpace=r.singletons.gray;var b=this.current.fillColorSpace.getRgb(arguments,0),b=q.makeCssRgb(b);this.ctx.fillStyle=b;this.current.fillColor=b},setStrokeRGBColor:function(a,b,c){this.current.strokeColorSpace=r.singletons.rgb;var d=this.current.strokeColorSpace.getRgb(arguments,0),d=q.makeCssRgb(d);this.ctx.strokeStyle=d;this.current.strokeColor=
|
||||
d},setFillRGBColor:function(a,b,c){this.current.fillColorSpace=r.singletons.rgb;var d=this.current.fillColorSpace.getRgb(arguments,0),d=q.makeCssRgb(d);this.ctx.fillStyle=d;this.current.fillColor=d},setStrokeCMYKColor:function(a,b,c,d){this.current.strokeColorSpace=r.singletons.cmyk;var e=q.makeCssCmyk(arguments);this.ctx.strokeStyle=e;this.current.strokeColor=e},setFillCMYKColor:function(a,b,c,d){this.current.fillColorSpace=r.singletons.cmyk;var e=q.makeCssCmyk(arguments);this.ctx.fillStyle=e;this.current.fillColor=
|
||||
e},shadingFill:function(a){var b=this.ctx;this.save();a=ka.shadingFromIR(a);b.fillStyle=a.getPattern(b,this);var c=b.mozCurrentTransformInverse;if(c){var b=b.canvas,d=b.width,e=b.height,b=q.applyTransform([0,0],c);a=q.applyTransform([0,e],c);var f=q.applyTransform([d,0],c),g=q.applyTransform([d,e],c),c=Math.min(b[0],a[0],f[0],g[0]),d=Math.min(b[1],a[1],f[1],g[1]),e=Math.max(b[0],a[0],f[0],g[0]),b=Math.max(b[1],a[1],f[1],g[1]);this.ctx.fillRect(c,d,e-c,b-d)}else this.ctx.fillRect(-1E10,-1E10,2E10,
|
||||
2E10);this.restore()},beginInlineImage:function(){m("Should not call beginInlineImage")},beginImageData:function(){m("Should not call beginImageData")},paintFormXObjectBegin:function(a,b){this.save();this.baseTransformStack.push(this.baseTransform);a&&D(a)&&6==a.length&&this.transform.apply(this,a);this.baseTransform=this.ctx.mozCurrentTransform;b&&D(b)&&4==b.length&&(this.rectangle(b[0],b[1],b[2]-b[0],b[3]-b[1]),this.clip(),this.endPath())},paintFormXObjectEnd:function(){this.restore();this.baseTransform=
|
||||
this.baseTransformStack.pop()},beginGroup:function(a){this.save();var b=this.ctx;a.isolated||K("TODO: Support non-isolated groups.");a.knockout&&x("Knockout groups not supported.");var c=b.mozCurrentTransform;a.matrix&&b.transform.apply(b,a.matrix);a.bbox||m("Bounding box is required.");var d=q.getAxialAlignedBoundingBox(a.bbox,b.mozCurrentTransform),d=q.intersect(d,[0,0,b.canvas.width,b.canvas.height])||[0,0,0,0];a=Math.max(Math.ceil(d[2]-d[0]),1);var e=Math.max(Math.ceil(d[3]-d[1]),1);a=J.getCanvas("groupAt"+
|
||||
this.groupLevel,a,e,!0).context;e=d[0];d=d[1];a.translate(-e,-d);a.transform.apply(a,c);b.setTransform(1,0,0,1,0,0);b.translate(e,d);c="strokeStyle fillStyle fillRule globalAlpha lineWidth lineCap lineJoin miterLimit globalCompositeOperation font".split(" ");d=0;for(e=c.length;d<e;d++){var f=c[d];f in b&&(a[f]=b[f])}"setLineDash"in b?(a.setLineDash(b.getLineDash()),a.lineDashOffset=b.lineDashOffset):"mozDash"in b&&(a.mozDash=b.mozDash,a.mozDashOffset=b.mozDashOffset);this.ctx=a;this.setGState([["SMask",
|
||||
"None"],["BM","Normal"],["ca",1],["CA",1]]);this.groupStack.push(b);this.groupLevel++},endGroup:function(a){this.groupLevel--;a=this.ctx;this.ctx=this.groupStack.pop();"imageSmoothingEnabled"in this.ctx?this.ctx.imageSmoothingEnabled=!1:this.ctx.mozImageSmoothingEnabled=!1;this.ctx.drawImage(a.canvas,0,0);this.restore()},beginAnnotations:function(){this.save();this.current=new na},endAnnotations:function(){this.restore()},beginAnnotation:function(a,b,c){this.save();a&&D(a)&&4==a.length&&(this.rectangle(a[0],
|
||||
a[1],a[2]-a[0],a[3]-a[1]),this.clip(),this.endPath());this.transform.apply(this,b);this.transform.apply(this,c)},endAnnotation:function(){this.restore()},paintJpegXObject:function(a,b,c){var d=this.objs.get(a);d||m("Dependent image isn't ready yet");this.save();var e=this.ctx;e.scale(1/b,-1/c);e.drawImage(d,0,0,d.width,d.height,0,-c,b,c);this.imageLayer&&(d=e.mozCurrentTransformInverse,e=this.getCanvasPosition(0,0),this.imageLayer.appendImage({objId:a,left:e[0],top:e[1],width:b/d[0],height:c/d[3]}));
|
||||
this.restore()},paintImageMaskXObject:function(a){var b=this.ctx,d=a.width,e=a.height,f=this.processingType3;!f||"compiled"in f||(f.compiled=1E3>=d&&1E3>=e?sa({data:a.data,width:d,height:e}):null);f&&f.compiled?f.compiled(b):(b=J.getCanvas("maskCanvas",d,e),f=b.context,f.save(),c(f,a),f.globalCompositeOperation="source-in",a=this.current.fillColor,f.fillStyle=a&&a.hasOwnProperty("type")&&"Pattern"===a.type?a.getPattern(f,this):a,f.fillRect(0,0,d,e),f.restore(),this.paintInlineImageXObject(b.canvas))},
|
||||
paintImageMaskXObjectGroup:function(a){for(var b=this.ctx,d=0,e=a.length;d<e;d++){var f=a[d],g=f.width,h=f.height,m=J.getCanvas("maskCanvas",g,h),q=m.context;q.save();c(q,f);q.globalCompositeOperation="source-in";var r=this.current.fillColor;q.fillStyle=r&&r.hasOwnProperty("type")&&"Pattern"===r.type?r.getPattern(q,this):r;q.fillRect(0,0,g,h);q.restore();b.save();b.transform.apply(b,f.transform);b.scale(1,-1);b.drawImage(m.canvas,0,0,g,h,0,-1,1,1);b.restore()}},paintImageXObject:function(a){(a=this.objs.get(a))||
|
||||
m("Dependent image isn't ready yet");this.paintInlineImageXObject(a)},paintInlineImageXObject:function(b){var c=b.width,d=b.height,e=this.ctx;this.save();e.scale(1/c,-1/d);var f=e.mozCurrentTransformInverse,g=f[0],h=f[1],g=Math.max(Math.sqrt(g*g+h*h),1),h=f[2],m=f[3],h=Math.max(Math.sqrt(h*h+m*m),1);if(b instanceof HTMLElement||!b.data)m=b;else{var q=J.getCanvas("inlineImage",c,d),r=q.context;a(r,b);m=q.canvas}for(var u=c,t=d,x="prescale1";2<g&&1<u||2<h&&1<t;){var v=u,y=t;2<g&&1<u&&(v=Math.ceil(u/
|
||||
2),g/=u/v);2<h&&1<t&&(y=Math.ceil(t/2),h/=t/y);q=J.getCanvas(x,v,y);r=q.context;r.clearRect(0,0,v,y);r.drawImage(m,0,0,u,t,0,0,v,y);m=q.canvas;u=v;t=y;x="prescale1"===x?"prescale2":"prescale1"}e.drawImage(m,0,0,u,t,0,-d,c,d);this.imageLayer&&(e=this.getCanvasPosition(0,-d),this.imageLayer.appendImage({imgData:b,left:e[0],top:e[1],width:c/f[0],height:d/f[3]}));this.restore()},paintInlineImageXObjectGroup:function(b,c){var d=this.ctx,e=b.width,f=b.height,g=J.getCanvas("inlineImage",e,f);a(g.context,
|
||||
b);for(var h=0,m=c.length;h<m;h++){var q=c[h];d.save();d.transform.apply(d,q.transform);d.scale(1,-1);d.drawImage(g.canvas,q.x,q.y,q.w,q.h,0,-1,1,1);this.imageLayer&&(q=this.getCanvasPosition(q.x,q.y),this.imageLayer.appendImage({imgData:b,left:q[0],top:q[1],width:e,height:f}));d.restore()}},markPoint:function(a){},markPointProps:function(a,b){},beginMarkedContent:function(a){},beginMarkedContentProps:function(a,b){},endMarkedContent:function(){},beginCompat:function(){},endCompat:function(){},consumePath:function(){if(this.pendingClip){if(this.pendingClip==
|
||||
f)if("mozFillRule"in this.ctx)this.ctx.mozFillRule="evenodd",this.ctx.clip(),this.ctx.mozFillRule="nonzero";else try{this.ctx.clip("evenodd")}catch(a){this.ctx.clip()}else this.ctx.clip();this.pendingClip=null}this.ctx.beginPath()},getSinglePixelWidth:function(a){a=this.ctx.mozCurrentTransformInverse;return Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1],a[2]*a[2]+a[3]*a[3]))},getCanvasPosition:function(a,b){var c=this.ctx.mozCurrentTransform;return[c[0]*a+c[2]*b+c[4],c[1]*a+c[3]*b+c[5]]}};for(var h in y)b.prototype[y[h]]=
|
||||
b.prototype[h];return b}();PDFJS.disableFontFace=!1;var Q={insertRule:function(b){var a=document.getElementById("PDFJS_FONT_STYLE_TAG");a||(a=document.createElement("style"),a.id="PDFJS_FONT_STYLE_TAG",document.documentElement.getElementsByTagName("head")[0].appendChild(a));a=a.sheet;a.insertRule(b,a.cssRules.length)},clear:function(){var b=document.getElementById("PDFJS_FONT_STYLE_TAG");b&&b.parentNode.removeChild(b)},get loadTestFont(){return U(this,"loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))},
|
||||
loadTestFontId:0,loadingContext:{requests:[],nextRequestId:0},isSyncFontLoadingSupported:function(){if(W)return!1;var b=/Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(window.navigator.userAgent);return b&&14<=b[1]?!0:!1}(),bind:function(b,a){W&&m("bind() shall be called from main thread");for(var c=[],e=[],d=0,g=b.length;d<g;d++){var f=b[d];if(!f.attached&&!1!==f.loading){f.attached=!0;var h=f.bindDOM();h&&(c.push(h),e.push(f))}}d=Q.queueLoadingCallback(a);0<c.length&&!this.isSyncFontLoadingSupported?Q.prepareFontLoadEvent(c,
|
||||
e,d):d.complete()},queueLoadingCallback:function(b){var a=Q.loadingContext,c={id:"pdfjs-font-loading-"+a.nextRequestId++,complete:function(){c.end&&m("completeRequest() cannot be called twice");for(c.end=Date.now();0<a.requests.length&&a.requests[0].end;){var b=a.requests.shift();setTimeout(b.callback,0)}},callback:b,started:Date.now()};a.requests.push(c);return c},prepareFontLoadEvent:function(b,a,c){function e(a,b){return a.charCodeAt(b)<<24|a.charCodeAt(b+1)<<16|a.charCodeAt(b+2)<<8|a.charCodeAt(b+
|
||||
3)&255}function d(a,b,c,d){a=m.substr(0,b);b=m.substr(b+c);return a+d+b}function g(a,b){l++;30<l?(x("Load test font never loaded."),b()):(k.font="30px "+a,k.fillText(".",0,20),0<k.getImageData(0,0,1,1).data[3]?b():setTimeout(g.bind(null,a,b)))}var f,h;b=document.createElement("canvas");b.width=1;b.height=1;var k=b.getContext("2d"),l=0;b="lt"+Date.now()+this.loadTestFontId++;var m=this.loadTestFont,m=d(m,976,b.length,b),p=e(m,16);f=0;for(h=b.length-3;f<h;f+=4)p=p-1482184792+e(b,f)|0;f<b.length&&(p=
|
||||
p-1482184792+e(b+"XXX",f)|0);m=d(m,16,4,String.fromCharCode(p>>24&255)+String.fromCharCode(p>>16&255)+String.fromCharCode(p>>8&255)+String.fromCharCode(p&255));f="url(data:font/opentype;base64,"+btoa(m)+");";Q.insertRule('@font-face { font-family:"'+b+'";src:'+f+"}");p=[];f=0;for(h=a.length;f<h;f++)p.push(a[f].loadedName);p.push(b);var q=document.createElement("div");q.setAttribute("style","visibility: hidden;width: 10px; height: 10px;position: absolute; top: 0px; left: 0px;");f=0;for(h=p.length;f<
|
||||
h;++f)a=document.createElement("span"),a.textContent="Hi",a.style.fontFamily=p[f],q.appendChild(a);document.body.appendChild(q);g(b,function(){document.body.removeChild(q);c.complete()})}},Qa=function(){function b(a,b,e){this.compiledGlyphs={};if(1===arguments.length){var d=arguments[0],g;for(g in d)this[g]=d[g]}}b.prototype={bindDOM:function(){if(!this.data)return null;if(PDFJS.disableFontFace)return this.disableFontFace=!0,null;for(var a=this.data,b="",e=a.length,d=0;d<e;++d)b+=String.fromCharCode(a[d]);
|
||||
a=this.loadedName;b="url(data:"+this.mimetype+";base64,"+window.btoa(b)+");";a='@font-face { font-family:"'+a+'";src:'+b+"}";Q.insertRule(a);PDFJS.pdfBug&&"FontInspector"in t&&t.FontInspector.enabled&&t.FontInspector.fontAdded(this,b);return a},getPathGenerator:function(a,b){if(!(b in this.compiledGlyphs)){var e=a.get(this.loadedName+"_path_"+b);this.compiledGlyphs[b]=new Function("c","size",e)}return this.compiledGlyphs[b]}};return b}()}).call("undefined"===typeof window?this:window);
|
||||
PDFJS.workerSrc||"undefined"===typeof document||(PDFJS.workerSrc=function(){var E=(document.body||document.getElementsByTagName("head")[0]).lastChild.src;return E&&E.replace(/\.js$/i,".worker.js")}());
|
3682
plugins/pdfviewer/viewer/pdf.worker.js
vendored
|
@ -20,6 +20,8 @@
|
|||
|
||||
html {
|
||||
height: 100%;
|
||||
/* Font size is needed to make the activity bar the correct size. */
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
body {
|
||||
|
@ -45,8 +47,7 @@ select {
|
|||
#viewerContainer:-webkit-full-screen {
|
||||
top: 0px;
|
||||
border-top: 2px solid transparent;
|
||||
background-color: #404040;
|
||||
background-image: url(images/texture.png);
|
||||
background-color: #000;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
|
@ -56,8 +57,7 @@ select {
|
|||
#viewerContainer:-moz-full-screen {
|
||||
top: 0px;
|
||||
border-top: 2px solid transparent;
|
||||
background-color: #404040;
|
||||
background-image: url(images/texture.png);
|
||||
background-color: #000;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
|
@ -74,15 +74,13 @@ select {
|
|||
}
|
||||
|
||||
#viewerContainer:-ms-fullscreen::-ms-backdrop {
|
||||
background-color: #404040;
|
||||
background-image: url(images/texture.png);
|
||||
background-color: #000;
|
||||
}
|
||||
|
||||
#viewerContainer:fullscreen {
|
||||
top: 0px;
|
||||
border-top: 2px solid transparent;
|
||||
background-color: #404040;
|
||||
background-image: url(images/texture.png);
|
||||
background-color: #000;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
|
@ -167,6 +165,7 @@ html[dir='rtl'] .innerCenter {
|
|||
#outerContainer {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#sidebarContainer {
|
||||
|
@ -400,6 +399,7 @@ html[dir='rtl'] .secondaryToolbar {
|
|||
max-width: 200px;
|
||||
max-height: 400px;
|
||||
overflow-y: auto;
|
||||
margin-bottom: -4px;
|
||||
}
|
||||
|
||||
.doorHanger,
|
||||
|
@ -894,20 +894,25 @@ html[dir="rtl"] .secondaryToolbarButton.print::before {
|
|||
content: url(images/toolbarButton-download.png);
|
||||
}
|
||||
|
||||
.toolbarButton.bookmark {
|
||||
.toolbarButton.bookmark,
|
||||
.secondaryToolbarButton.bookmark {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
margin-top: 3px;
|
||||
padding-top: 4px;
|
||||
text-decoration: none;
|
||||
}
|
||||
.secondaryToolbarButton.bookmark {
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
#viewBookmark[href='#'] {
|
||||
.bookmark[href='#'] {
|
||||
opacity: .5;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.toolbarButton.bookmark::before {
|
||||
.toolbarButton.bookmark::before,
|
||||
.secondaryToolbarButton.bookmark::before {
|
||||
content: url(images/toolbarButton-bookmark.png);
|
||||
}
|
||||
|
||||
|
@ -944,9 +949,11 @@ html[dir="rtl"] .secondaryToolbarButton {
|
|||
padding-right: 24px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
#secondaryToolbarButtonContainer :last-child {
|
||||
margin-bottom: 0;
|
||||
html[dir="ltr"] .secondaryToolbarButton.bookmark {
|
||||
padding-left: 27px;
|
||||
}
|
||||
html[dir="rtl"] .secondaryToolbarButton.bookmark {
|
||||
padding-right: 27px;
|
||||
}
|
||||
|
||||
html[dir="ltr"] .secondaryToolbarButton > span {
|
||||
|
@ -972,6 +979,10 @@ html[dir="rtl"] .secondaryToolbarButton > span {
|
|||
content: url(images/secondaryToolbarButton-rotateCw.png);
|
||||
}
|
||||
|
||||
.secondaryToolbarButton.handTool::before {
|
||||
content: url(images/secondaryToolbarButton-handTool.png);
|
||||
}
|
||||
|
||||
.verticalToolbarSeparator {
|
||||
display: block;
|
||||
padding: 8px 0;
|
||||
|
@ -1023,6 +1034,7 @@ html[dir='rtl'] .verticalToolbarSeparator {
|
|||
}
|
||||
|
||||
.toolbarField.pageNumber {
|
||||
-moz-appearance: textfield; /* hides the spinner in moz */
|
||||
min-width: 16px;
|
||||
text-align: right;
|
||||
width: 40px;
|
||||
|
@ -1070,6 +1082,11 @@ html[dir='rtl'] .verticalToolbarSeparator {
|
|||
|
||||
.thumbnail {
|
||||
float: left;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
#thumbnailView > a:last-of-type > .thumbnail {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.thumbnail:not([data-loaded]) {
|
||||
|
@ -1190,22 +1207,6 @@ html[dir='rtl'] .outlineItem > a {
|
|||
cursor: default;
|
||||
}
|
||||
|
||||
#findScrollView {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
bottom: 10px;
|
||||
left: 10px;
|
||||
width: 280px;
|
||||
}
|
||||
|
||||
#sidebarControls {
|
||||
position:absolute;
|
||||
width: 180px;
|
||||
height: 32px;
|
||||
left: 15px;
|
||||
bottom: 35px;
|
||||
}
|
||||
|
||||
.canvasWrapper {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
@ -1417,6 +1418,10 @@ canvas {
|
|||
background: white;
|
||||
color: black;
|
||||
margin-top: 5px;
|
||||
visibility: hidden;
|
||||
position: fixed;
|
||||
right: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
#PDFBug {
|
||||
|
@ -1478,6 +1483,32 @@ canvas {
|
|||
color: black;
|
||||
}
|
||||
|
||||
.grab-to-pan-grab * {
|
||||
cursor: url("images/grab.cur"), move !important;
|
||||
cursor: -webkit-grab !important;
|
||||
cursor: -moz-grab !important;
|
||||
cursor: grab !important;
|
||||
}
|
||||
.grab-to-pan-grabbing,
|
||||
.grab-to-pan-grabbing * {
|
||||
cursor: url("images/grabbing.cur"), move !important;
|
||||
cursor: -webkit-grabbing !important;
|
||||
cursor: -moz-grabbing !important;
|
||||
cursor: grabbing !important;
|
||||
}
|
||||
.grab-to-pan-grab input,
|
||||
.grab-to-pan-grab textarea,
|
||||
.grab-to-pan-grab button,
|
||||
.grab-to-pan-grab button *,
|
||||
.grab-to-pan-grab select,
|
||||
.grab-to-pan-grab option {
|
||||
cursor: auto !important;
|
||||
}
|
||||
.grab-to-pan-grab a[href],
|
||||
.grab-to-pan-grab a[href] * {
|
||||
cursor: pointer !important;
|
||||
}
|
||||
|
||||
@page {
|
||||
margin: 0;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!DOCTYPE html>
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Copyright 2012 Mozilla Foundation
|
||||
|
||||
|
@ -31,12 +31,12 @@ limitations under the License.
|
|||
<!-- This snippet is used in production, see Makefile -->
|
||||
<link rel="resource" type="application/l10n" href="locale/locale.properties"/>
|
||||
<script type="text/javascript" src="l10n.js"></script>
|
||||
<script type="text/javascript" src="pdf.js"></script>
|
||||
<script type="text/javascript" src="pdf.min.js"></script>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" src="debugger.js"></script>
|
||||
<script type="text/javascript" src="viewer.js"></script>
|
||||
<script type="text/javascript" src="viewer.min.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
|
@ -88,27 +88,45 @@ limitations under the License.
|
|||
<span data-l10n-id="presentation_mode_label">Presentation Mode</span>
|
||||
</button>
|
||||
|
||||
<button id="secondaryOpenFile" class="secondaryToolbarButton openFile hidden" title="Open File" tabindex="19" data-l10n-id="open_file">
|
||||
<span data-l10n-id="open_file_label">Open</span>
|
||||
</button>
|
||||
|
||||
<button id="secondaryPrint" class="secondaryToolbarButton print visibleMediumView" title="Print" tabindex="20" data-l10n-id="print">
|
||||
<span data-l10n-id="print_label">Print</span>
|
||||
</button>
|
||||
|
||||
<button id="secondaryDownload" class="secondaryToolbarButton download hidden" title="Download" tabindex="21" data-l10n-id="download">
|
||||
<span data-l10n-id="download_label">Download</span>
|
||||
</button>
|
||||
|
||||
<a href="#" id="secondaryViewBookmark" class="secondaryToolbarButton bookmark hidden" title="Current view (copy or open in new window)" tabindex="22" data-l10n-id="bookmark">
|
||||
<span data-l10n-id="bookmark_label">Current View</span>
|
||||
</a>
|
||||
|
||||
<div class="horizontalToolbarSeparator visibleLargeView"></div>
|
||||
|
||||
<button id="firstPage" class="secondaryToolbarButton firstPage" title="Go to First Page" tabindex="22" data-l10n-id="first_page">
|
||||
<button id="firstPage" class="secondaryToolbarButton firstPage" title="Go to First Page" tabindex="23" data-l10n-id="first_page">
|
||||
<span data-l10n-id="first_page_label">Go to First Page</span>
|
||||
</button>
|
||||
<button id="lastPage" class="secondaryToolbarButton lastPage" title="Go to Last Page" tabindex="23" data-l10n-id="last_page">
|
||||
<button id="lastPage" class="secondaryToolbarButton lastPage" title="Go to Last Page" tabindex="24" data-l10n-id="last_page">
|
||||
<span data-l10n-id="last_page_label">Go to Last Page</span>
|
||||
</button>
|
||||
|
||||
<div class="horizontalToolbarSeparator"></div>
|
||||
|
||||
<button id="pageRotateCw" class="secondaryToolbarButton rotateCw" title="Rotate Clockwise" tabindex="24" data-l10n-id="page_rotate_cw">
|
||||
<button id="pageRotateCw" class="secondaryToolbarButton rotateCw" title="Rotate Clockwise" tabindex="25" data-l10n-id="page_rotate_cw">
|
||||
<span data-l10n-id="page_rotate_cw_label">Rotate Clockwise</span>
|
||||
</button>
|
||||
<button id="pageRotateCcw" class="secondaryToolbarButton rotateCcw" title="Rotate Counterclockwise" tabindex="25" data-l10n-id="page_rotate_ccw">
|
||||
<button id="pageRotateCcw" class="secondaryToolbarButton rotateCcw" title="Rotate Counterclockwise" tabindex="26" data-l10n-id="page_rotate_ccw">
|
||||
<span data-l10n-id="page_rotate_ccw_label">Rotate Counterclockwise</span>
|
||||
</button>
|
||||
|
||||
<div class="horizontalToolbarSeparator"></div>
|
||||
|
||||
<button id="toggleHandTool" class="secondaryToolbarButton handTool" title="Enable hand tool" tabindex="27" data-l10n-id="hand_tool_enable">
|
||||
<span data-l10n-id="hand_tool_enable_label">Enable hand tool</span>
|
||||
</button>
|
||||
</div>
|
||||
</div> <!-- secondaryToolbar -->
|
||||
|
||||
|
@ -134,7 +152,6 @@ limitations under the License.
|
|||
</div>
|
||||
<label id="pageNumberLabel" class="toolbarLabel" for="pageNumber" data-l10n-id="page_label">Page: </label>
|
||||
<input type="number" id="pageNumber" class="toolbarField pageNumber" value="1" size="4" min="1" tabindex="8">
|
||||
</input>
|
||||
<span id="numPages" class="toolbarLabel"></span>
|
||||
</div>
|
||||
<div id="toolbarViewerRight">
|
||||
|
@ -142,10 +159,22 @@ limitations under the License.
|
|||
<span data-l10n-id="presentation_mode_label">Presentation Mode</span>
|
||||
</button>
|
||||
|
||||
<button id="openFile" class="toolbarButton openFile hidden" title="Open File" tabindex="13" data-l10n-id="open_file">
|
||||
<span data-l10n-id="open_file_label">Open</span>
|
||||
</button>
|
||||
|
||||
<button id="print" class="toolbarButton print hiddenMediumView" title="Print" tabindex="14" data-l10n-id="print">
|
||||
<span data-l10n-id="print_label">Print</span>
|
||||
</button>
|
||||
|
||||
<button id="download" class="toolbarButton download hidden" title="Download" tabindex="15" data-l10n-id="download">
|
||||
<span data-l10n-id="download_label">Download</span>
|
||||
</button>
|
||||
<!-- <div class="toolbarButtonSpacer"></div> -->
|
||||
<a href="#" id="viewBookmark" class="toolbarButton bookmark hidden" title="Current view (copy or open in new window)" tabindex="16" data-l10n-id="bookmark">
|
||||
<span data-l10n-id="bookmark_label">Current View</span>
|
||||
</a>
|
||||
|
||||
<div class="verticalToolbarSeparator hiddenSmallView"></div>
|
||||
|
||||
<button id="secondaryToolbarToggle" class="toolbarButton" title="Tools" tabindex="17" data-l10n-id="tools">
|
||||
|
@ -244,6 +273,78 @@ limitations under the License.
|
|||
|
||||
</div> <!-- outerContainer -->
|
||||
<div id="printContainer"></div>
|
||||
<div id="mozPrintCallback-shim" hidden>
|
||||
<style scoped>
|
||||
#mozPrintCallback-shim {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
z-index: 9999999;
|
||||
|
||||
display: block;
|
||||
text-align: center;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
#mozPrintCallback-shim[hidden] {
|
||||
display: none;
|
||||
}
|
||||
@media print {
|
||||
#mozPrintCallback-shim {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
#mozPrintCallback-shim .mozPrintCallback-dialog-box {
|
||||
display: inline-block;
|
||||
margin: -50px auto 0;
|
||||
position: relative;
|
||||
top: 45%;
|
||||
left: 0;
|
||||
min-width: 220px;
|
||||
max-width: 400px;
|
||||
|
||||
padding: 9px;
|
||||
|
||||
border: 1px solid hsla(0, 0%, 0%, .5);
|
||||
border-radius: 2px;
|
||||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
|
||||
|
||||
background-color: #474747;
|
||||
|
||||
color: hsl(0, 0%, 85%);
|
||||
font-size: 16px;
|
||||
line-height: 20px;
|
||||
}
|
||||
#mozPrintCallback-shim .progress-row {
|
||||
clear: both;
|
||||
padding: 1em 0;
|
||||
}
|
||||
#mozPrintCallback-shim progress {
|
||||
width: 100%;
|
||||
}
|
||||
#mozPrintCallback-shim .relative-progress {
|
||||
clear: both;
|
||||
float: right;
|
||||
}
|
||||
#mozPrintCallback-shim .progress-actions {
|
||||
clear: both;
|
||||
}
|
||||
</style>
|
||||
<div class="mozPrintCallback-dialog-box">
|
||||
<!-- TODO: Localise the following strings -->
|
||||
Preparing document for printing...
|
||||
<div class="progress-row">
|
||||
<progress value="0" max="100"></progress>
|
||||
<span class="relative-progress">0%</span>
|
||||
</div>
|
||||
<div class="progress-actions">
|
||||
<input type="button" value="Cancel" class="mozPrintCallback-cancel">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
164
plugins/pdfviewer/viewer/viewer.min.js
vendored
Normal file
|
@ -0,0 +1,164 @@
|
|||
var DEFAULT_URL=null,DEFAULT_SCALE="auto",DEFAULT_SCALE_DELTA=1.1,UNKNOWN_SCALE=0,CACHE_SIZE=20,CSS_UNITS=96/72,SCROLLBAR_PADDING=40,VERTICAL_PADDING=5,MAX_AUTO_SCALE=1.25,MIN_SCALE=0.25,MAX_SCALE=4,VIEW_HISTORY_MEMORY=20,SCALE_SELECT_CONTAINER_PADDING=8,SCALE_SELECT_PADDING=22,THUMBNAIL_SCROLL_MARGIN=-19,USE_ONLY_CSS_ZOOM=!1,CLEANUP_TIMEOUT=3E4,IGNORE_CURRENT_POSITION_ON_ZOOM=!1,RenderingStates={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},FindStates={FIND_FOUND:0,FIND_NOTFOUND:1,FIND_WRAPPED:2,FIND_PENDING:3};
|
||||
PDFJS.imageResourcesPath="./images/";PDFJS.workerSrc="pdf.worker.js";
|
||||
var mozL10n=document.mozL10n||document.webL10n,CustomStyle=function(){function a(){}var b=["ms","Moz","Webkit","O"],c={};a.getProp=function(a,e){if(1==arguments.length&&"string"==typeof c[a])return c[a];e=e||document.documentElement;var g=e.style,h,f;if("string"==typeof g[a])return c[a]=a;f=a.charAt(0).toUpperCase()+a.slice(1);for(var k=0,s=b.length;k<s;k++)if(h=b[k]+f,"string"==typeof g[h])return c[a]=h;return c[a]="undefined"};a.setProp=function(a,b,c){a=this.getProp(a);"undefined"!=a&&(b.style[a]=
|
||||
c)};return a}();function getFileName(a){var b=a.indexOf("#"),c=a.indexOf("?"),b=Math.min(0<b?b:a.length,0<c?c:a.length);return a.substring(a.lastIndexOf("/",b)+1,b)}function getOutputScale(a){a=(window.devicePixelRatio||1)/(a.webkitBackingStorePixelRatio||a.mozBackingStorePixelRatio||a.msBackingStorePixelRatio||a.oBackingStorePixelRatio||a.backingStorePixelRatio||1);return{sx:a,sy:a,scaled:1!=a}}
|
||||
function scrollIntoView(a,b){var c=a.offsetParent,d=a.offsetTop+a.clientTop,e=a.offsetLeft+a.clientLeft;if(c){for(;c.clientHeight===c.scrollHeight;)if(c.dataset._scaleY&&(d/=c.dataset._scaleY,e/=c.dataset._scaleX),d+=c.offsetTop,e+=c.offsetLeft,c=c.offsetParent,!c)return;b&&(void 0!==b.top&&(d+=b.top),void 0!==b.left&&(e+=b.left,c.scrollLeft=e));c.scrollTop=d}else console.error("offsetParent is not set -- cannot scroll")}function noContextMenuHandler(a){a.preventDefault()}
|
||||
function getPDFFileNameFromURL(a){var b=/[^\/?#=]+\.pdf\b(?!.*\.pdf\b)/i;a=/^(?:([^:]+:)?\/\/[^\/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(a);if(a=b.exec(a[1])||b.exec(a[2])||b.exec(a[3]))if(a=a[0],-1!=a.indexOf("%"))try{a=b.exec(decodeURIComponent(a))[0]}catch(c){}return a||"document.pdf"}
|
||||
var ProgressBar=function(){function a(a,c){this.div=document.querySelector(a+" .progress");this.bar=this.div.parentNode;this.height=c.height||100;this.width=c.width||100;this.units=c.units||"%";this.div.style.height=this.height+this.units;this.percent=0}a.prototype={updateBar:function(){this._indeterminate?(this.div.classList.add("indeterminate"),this.div.style.width=this.width+this.units):(this.div.classList.remove("indeterminate"),this.div.style.width=this.width*this._percent/100+this.units)},get percent(){return this._percent},
|
||||
set percent(a){this._indeterminate=isNaN(a);this._percent=Math.min(Math.max(a,0),100);this.updateBar()},setWidth:function(a){a&&(a=a.parentNode.offsetWidth-a.offsetWidth,0<a&&this.bar.setAttribute("style","width: calc(100% - "+a+"px);"))},hide:function(){this.bar.classList.add("hidden");this.bar.removeAttribute("style")}};return a}(),Cache=function(a){var b=[];this.push=function(c){var d=b.indexOf(c);0<=d&&b.splice(d);b.push(c);b.length>a&&b.shift().destroy()}},isLocalStorageEnabled=function(){try{return"localStorage"in
|
||||
window&&null!==window.localStorage&&localStorage}catch(a){return!1}}(),EXPORTED_SYMBOLS=["DEFAULT_PREFERENCES"],DEFAULT_PREFERENCES={showPreviousViewOnLoad:!0,defaultZoomValue:"",ifAvailableShowOutlineOnLoad:!1},Preferences=function(){function a(){this.prefs={};this.isInitializedPromiseResolved=!1;this.initializedPromise=this.readFromStorage().then(function(a){this.isInitializedPromiseResolved=!0;a&&(this.prefs=a)}.bind(this))}a.prototype={writeToStorage:function(a){},readFromStorage:function(){return Promise.resolve()},
|
||||
reset:function(){this.isInitializedPromiseResolved&&(this.prefs={},this.writeToStorage(this.prefs))},set:function(a,c){if(this.isInitializedPromiseResolved)if(void 0===DEFAULT_PREFERENCES[a])console.error("Preferences_set: '"+a+"' is undefined.");else if(void 0===c)console.error("Preferences_set: no value is specified.");else{var d=typeof c,e=typeof DEFAULT_PREFERENCES[a];if(d!==e)if("number"===d&&"string"===e)c=c.toString();else{console.error("Preferences_set: '"+c+"' is a \""+d+'", expected a "'+
|
||||
e+'".');return}this.prefs[a]=c;this.writeToStorage(this.prefs)}},get:function(a){var c=DEFAULT_PREFERENCES[a];if(void 0===c)console.error("Preferences_get: '"+a+"' is undefined.");else return this.isInitializedPromiseResolved&&(a=this.prefs[a],void 0!==a)?a:c}};return a}();Preferences.prototype.writeToStorage=function(a){isLocalStorageEnabled&&localStorage.setItem("preferences",JSON.stringify(a))};
|
||||
Preferences.prototype.readFromStorage=function(){return new Promise(function(a){if(isLocalStorageEnabled){var b=JSON.parse(localStorage.getItem("preferences"));a(b)}})};
|
||||
(function(){function a(a){var b=document.createEvent("CustomEvent");b.initCustomEvent(a,!1,!1,"custom");window.dispatchEvent(b)}function b(){if(e)if(d(),++g<e.length){var a=e[g];"function"===typeof a.mozPrintCallback?a.mozPrintCallback({context:a.getContext("2d"),abort:c,done:b}):b()}else d(),h.call(window),setTimeout(c,20)}function c(){e&&(e=null,d(),a("afterprint"))}function d(){var a=document.getElementById("mozPrintCallback-shim");if(e){var b=Math.round(100*g/e.length),d=a.querySelector("progress"),
|
||||
h=a.querySelector(".relative-progress");d.value=b;h.textContent=b+"%";a.removeAttribute("hidden");a.onclick=c}else a.setAttribute("hidden","")}if(!("mozPrintCallback"in document.createElement("canvas"))){HTMLCanvasElement.prototype.mozPrintCallback=void 0;var e,g,h=window.print;window.print=function(){if(e)console.warn("Ignored window.print() because of a pending print job.");else try{a("beforeprint")}finally{e=document.querySelectorAll("canvas"),g=-1,b()}};var f=!!document.attachEvent;window.addEventListener("keydown",
|
||||
function(a){80===a.keyCode&&(a.ctrlKey||a.metaKey)?(window.print(),f||(a.preventDefault(),a.stopImmediatePropagation?a.stopImmediatePropagation():a.stopPropagation())):27===a.keyCode&&e&&c()},!0);f&&document.attachEvent("onkeydown",function(a){a=a||window.event;if(80===a.keyCode&&a.ctrlKey)return a.keyCode=0,!1});if("onbeforeprint"in window){var k=function(a){"custom"!==a.detail&&a.stopImmediatePropagation&&a.stopImmediatePropagation()};window.addEventListener("beforeprint",k,!1);window.addEventListener("afterprint",
|
||||
k,!1)}}})();
|
||||
var DownloadManager=function(){function a(a,b){var e=document.createElement("a");e.click?(e.href=a,e.target="_parent","download"in e&&(e.download=b),(document.body||document.documentElement).appendChild(e),e.click(),e.parentNode.removeChild(e)):(window.top===window&&a.split("#")[0]===window.location.href.split("#")[0]&&(e=-1===a.indexOf("?")?"?":"&",a=a.replace(/#|$/,e+"$&")),window.open(a,"_parent"))}function b(){}b.prototype={downloadUrl:function(b,d){PDFJS.isValidUrl(b,!0)&&a(b+"#pdfjs.action=download",d)},
|
||||
download:function(b,d,e){URL?navigator.msSaveBlob?navigator.msSaveBlob(b,e)||this.downloadUrl(d,e):(b=URL.createObjectURL(b),a(b,e)):this.downloadUrl(d,e)}};return b}(),cache=new Cache(CACHE_SIZE),currentPageNumber=1,ViewHistory=function(){function a(a){this.fingerprint=a;var c;this.isInitializedPromiseResolved=!1;this.initializedPromise=new Promise(function(a){c=a});a=function(a){this.isInitializedPromiseResolved=!0;this.initialize(a||"{}");c()}.bind(this);isLocalStorageEnabled&&a(localStorage.getItem("database"))}
|
||||
a.prototype={initialize:function(a){a=JSON.parse(a);"files"in a||(a.files=[]);a.files.length>=VIEW_HISTORY_MEMORY&&a.files.shift();for(var c,d=0,e=a.files.length;d<e;d++)if(a.files[d].fingerprint===this.fingerprint){c=d;break}"number"!==typeof c&&(c=a.files.push({fingerprint:this.fingerprint})-1);this.file=a.files[c];this.database=a},set:function(a,c){if(this.isInitializedPromiseResolved){this.file[a]=c;var d=JSON.stringify(this.database);isLocalStorageEnabled&&localStorage.setItem("database",d)}},
|
||||
get:function(a,c){return this.isInitializedPromiseResolved?this.file[a]||c:c}};return a}(),PDFFindBar={opened:!1,bar:null,toggleButton:null,findField:null,highlightAll:null,caseSensitive:null,findMsg:null,findStatusIcon:null,findPreviousButton:null,findNextButton:null,initialize:function(a){if("undefined"===typeof PDFFindController||null===PDFFindController)throw"PDFFindBar cannot be initialized without a PDFFindController instance.";this.bar=a.bar;this.toggleButton=a.toggleButton;this.findField=
|
||||
a.findField;this.highlightAll=a.highlightAllCheckbox;this.caseSensitive=a.caseSensitiveCheckbox;this.findMsg=a.findMsg;this.findStatusIcon=a.findStatusIcon;this.findPreviousButton=a.findPreviousButton;this.findNextButton=a.findNextButton;var b=this;this.toggleButton.addEventListener("click",function(){b.toggle()});this.findField.addEventListener("input",function(){b.dispatchEvent("")});this.bar.addEventListener("keydown",function(a){switch(a.keyCode){case 13:a.target===b.findField&&b.dispatchEvent("again",
|
||||
a.shiftKey);break;case 27:b.close()}});this.findPreviousButton.addEventListener("click",function(){b.dispatchEvent("again",!0)});this.findNextButton.addEventListener("click",function(){b.dispatchEvent("again",!1)});this.highlightAll.addEventListener("click",function(){b.dispatchEvent("highlightallchange")});this.caseSensitive.addEventListener("click",function(){b.dispatchEvent("casesensitivitychange")})},dispatchEvent:function(a,b){var c=document.createEvent("CustomEvent");c.initCustomEvent("find"+
|
||||
a,!0,!0,{query:this.findField.value,caseSensitive:this.caseSensitive.checked,highlightAll:this.highlightAll.checked,findPrevious:b});return window.dispatchEvent(c)},updateUIState:function(a,b){var c=!1,d="",e="";switch(a){case FindStates.FIND_PENDING:e="pending";break;case FindStates.FIND_NOTFOUND:d=mozL10n.get("find_not_found",null,"Phrase not found");c=!0;break;case FindStates.FIND_WRAPPED:d=b?mozL10n.get("find_reached_top",null,"Reached top of document, continued from bottom"):mozL10n.get("find_reached_bottom",
|
||||
null,"Reached end of document, continued from top")}c?this.findField.classList.add("notFound"):this.findField.classList.remove("notFound");this.findField.setAttribute("data-status",e);this.findMsg.textContent=d},open:function(){this.opened||(this.opened=!0,this.toggleButton.classList.add("toggled"),this.bar.classList.remove("hidden"));this.findField.select();this.findField.focus()},close:function(){this.opened&&(this.opened=!1,this.toggleButton.classList.remove("toggled"),this.bar.classList.add("hidden"),
|
||||
PDFFindController.active=!1)},toggle:function(){this.opened?this.close():this.open()}},PDFFindController={startedTextExtraction:!1,extractTextPromises:[],pendingFindMatches:{},active:!1,pageContents:[],pageMatches:[],selected:{pageIdx:-1,matchIdx:-1},offset:{pageIdx:null,matchIdx:null},resumePageIdx:null,resumeCallback:null,state:null,dirtyMatch:!1,findTimeout:null,pdfPageSource:null,integratedFind:!1,initialize:function(a){if("undefined"===typeof PDFFindBar||null===PDFFindBar)throw"PDFFindController cannot be initialized without a PDFFindController instance";
|
||||
this.pdfPageSource=a.pdfPageSource;this.integratedFind=a.integratedFind;a=["find","findagain","findhighlightallchange","findcasesensitivitychange"];this.firstPagePromise=new Promise(function(a){this.resolveFirstPage=a}.bind(this));this.handleEvent=this.handleEvent.bind(this);for(var b=0;b<a.length;b++)window.addEventListener(a[b],this.handleEvent)},reset:function(){this.startedTextExtraction=!1;this.extractTextPromises=[];this.active=!1},calcFindMatch:function(a){var b=this.pageContents[a],c=this.state.query,
|
||||
d=this.state.caseSensitive,e=c.length;if(0!==e){d||(b=b.toLowerCase(),c=c.toLowerCase());for(var d=[],g=-e;;){g=b.indexOf(c,g+e);if(-1===g)break;d.push(g)}this.pageMatches[a]=d;this.updatePage(a);this.resumePageIdx===a&&(a=this.resumeCallback,this.resumeCallback=this.resumePageIdx=null,a())}},extractText:function(){function a(c){e.pdfPageSource.pages[c].getTextContent().then(function(d){d=d.bidiTexts;for(var f="",k=0;k<d.length;k++)f+=d[k].str;e.pageContents.push(f);b[c](c);c+1<e.pdfPageSource.pages.length&&
|
||||
a(c+1)})}if(!this.startedTextExtraction){this.startedTextExtraction=!0;this.pageContents=[];for(var b=[],c=0,d=this.pdfPageSource.pdfDocument.numPages;c<d;c++)this.extractTextPromises.push(new Promise(function(a){b.push(a)}));var e=this;a(0)}},handleEvent:function(a){if(null===this.state||"findagain"!==a.type)this.dirtyMatch=!0;this.state=a.detail;this.updateUIState(FindStates.FIND_PENDING);this.firstPagePromise.then(function(){this.extractText();clearTimeout(this.findTimeout);"find"===a.type?this.findTimeout=
|
||||
setTimeout(this.nextMatch.bind(this),250):this.nextMatch()}.bind(this))},updatePage:function(a){var b=this.pdfPageSource.pages[a];this.selected.pageIdx===a&&b.scrollIntoView();b.textLayer&&b.textLayer.updateMatches()},nextMatch:function(){var a=this.state.findPrevious,b=this.pdfPageSource.page-1,c=this.pdfPageSource.pages.length;this.active=!0;if(this.dirtyMatch){this.dirtyMatch=!1;this.selected.pageIdx=this.selected.matchIdx=-1;this.offset.pageIdx=b;this.offset.matchIdx=null;this.hadMatch=!1;this.resumePageIdx=
|
||||
this.resumeCallback=null;this.pageMatches=[];for(var d=this,b=0;b<c;b++)this.updatePage(b),b in this.pendingFindMatches||(this.pendingFindMatches[b]=!0,this.extractTextPromises[b].then(function(a){delete d.pendingFindMatches[a];d.calcFindMatch(a)}))}if(""===this.state.query)this.updateUIState(FindStates.FIND_FOUND);else if(!this.resumeCallback){c=this.offset;if(null!==c.matchIdx){b=this.pageMatches[c.pageIdx].length;if(!a&&c.matchIdx+1<b||a&&0<c.matchIdx){this.hadMatch=!0;c.matchIdx=a?c.matchIdx-
|
||||
1:c.matchIdx+1;this.updateMatch(!0);return}this.advanceOffsetPage(a)}this.nextPageMatch()}},nextPageMatch:function(){null!==this.resumePageIdx&&console.error("There can only be one pending page.");var a=function(a){var b=this.offset;a=a.length;var c=this.state.findPrevious;if(a)this.hadMatch=!0,b.matchIdx=c?a-1:0,this.updateMatch(!0);else{this.advanceOffsetPage(c);if(b.wrapped&&(b.matchIdx=null,!this.hadMatch)){this.updateMatch(!1);return}this.nextPageMatch()}}.bind(this),b=this.offset.pageIdx,c=
|
||||
this.pageMatches;c[b]?a(c[b]):(this.resumeCallback=function(){a(c[b])},this.resumePageIdx=b)},advanceOffsetPage:function(a){var b=this.offset,c=this.extractTextPromises.length;b.pageIdx=a?b.pageIdx-1:b.pageIdx+1;b.matchIdx=null;if(b.pageIdx>=c||0>b.pageIdx)b.pageIdx=a?c-1:0,b.wrapped=!0},updateMatch:function(a){var b=FindStates.FIND_NOTFOUND,c=this.offset.wrapped;this.offset.wrapped=!1;a&&(a=this.selected.pageIdx,this.selected.pageIdx=this.offset.pageIdx,this.selected.matchIdx=this.offset.matchIdx,
|
||||
b=c?FindStates.FIND_WRAPPED:FindStates.FIND_FOUND,-1!==a&&a!==this.selected.pageIdx&&this.updatePage(a));this.updateUIState(b,this.state.findPrevious);-1!==this.selected.pageIdx&&this.updatePage(this.selected.pageIdx,!0)},updateUIState:function(a,b){this.integratedFind?FirefoxCom.request("updateFindControlState",{result:a,findPrevious:b}):PDFFindBar.updateUIState(a,b)}},PDFHistory={initialized:!1,initialDestination:null,initialize:function(a){function b(){var a=c._getPreviousParams(null,!0);a&&(c._pushToHistory(a,
|
||||
!1,!c.current.dest&&c.current.hash!==c.previousHash),c._updatePreviousBookmark());window.removeEventListener("beforeunload",b,!1)}if(!PDFJS.disableHistory&&!PDFView.isViewerEmbedded){this.initialized=!0;this.reInitialized=!1;this.historyUnlocked=this.allowHashChange=!0;this.previousHash=window.location.hash.substring(1);this.currentBookmark="";this.currentPage=0;this.updatePreviousBookmark=!1;this.previousBookmark="";this.previousPage=0;this.nextHashParam="";this.fingerprint=a;this.currentUid=this.uid=
|
||||
0;this.current={};a=window.history.state;this._isStateObjectDefined(a)?(a.target.dest?this.initialDestination=a.target.dest:PDFView.initialBookmark=a.target.hash,this.currentUid=a.uid,this.uid=a.uid+1,this.current=a.target):(a&&a.fingerprint&&this.fingerprint!==a.fingerprint&&(this.reInitialized=!0),this._pushOrReplaceState({fingerprint:this.fingerprint},!0));var c=this;window.addEventListener("popstate",function(a){a.preventDefault();a.stopPropagation();c.historyUnlocked&&(a.state?c._goTo(a.state):
|
||||
(c.previousHash=window.location.hash.substring(1),0===c.uid&&(a=c.previousHash&&c.currentBookmark&&c.previousHash!==c.currentBookmark?{hash:c.currentBookmark,page:c.currentPage}:{page:1},c.historyUnlocked=!1,c.allowHashChange=!1,window.history.back(),c._pushToHistory(a,!1,!0),window.history.forward(),c.historyUnlocked=!0),c._pushToHistory({hash:c.previousHash},!1,!0),c._updatePreviousBookmark()))},!1);window.addEventListener("beforeunload",b,!1);window.addEventListener("pageshow",function(a){window.addEventListener("beforeunload",
|
||||
b,!1)},!1)}},_isStateObjectDefined:function(a){return a&&0<=a.uid&&a.fingerprint&&this.fingerprint===a.fingerprint&&a.target&&a.target.hash?!0:!1},_pushOrReplaceState:function(a,b){b?window.history.replaceState(a,"",document.URL):window.history.pushState(a,"",document.URL)},get isHashChangeUnlocked(){if(!this.initialized)return!0;var a=this.allowHashChange;this.allowHashChange=!0;return a},_updatePreviousBookmark:function(){this.updatePreviousBookmark&&this.currentBookmark&&this.currentPage&&(this.previousBookmark=
|
||||
this.currentBookmark,this.previousPage=this.currentPage,this.updatePreviousBookmark=!1)},updateCurrentBookmark:function(a,b){this.initialized&&(this.currentBookmark=a.substring(1),this.currentPage=b|0,this._updatePreviousBookmark())},updateNextHashParam:function(a){this.initialized&&(this.nextHashParam=a)},push:function(a,b){if(this.initialized&&this.historyUnlocked)if(a.dest&&!a.hash&&(a.hash=this.current.hash&&this.current.dest&&this.current.dest===a.dest?this.current.hash:PDFView.getDestinationHash(a.dest).split("#")[1]),
|
||||
a.page&&(a.page|=0),b){var c=window.history.state.target;c||(this._pushToHistory(a,!1),this.previousHash=window.location.hash.substring(1));this.updatePreviousBookmark=this.nextHashParam?!1:!0;c&&this._updatePreviousBookmark()}else{if(this.nextHashParam){if(this.nextHashParam===a.hash){this.nextHashParam=null;this.updatePreviousBookmark=!0;return}this.nextHashParam=null}a.hash?this.current.hash?this.current.hash!==a.hash?this._pushToHistory(a,!0):(!this.current.page&&a.page&&this._pushToHistory(a,
|
||||
!1,!0),this.updatePreviousBookmark=!0):this._pushToHistory(a,!0):this.current.page&&a.page&&this.current.page!==a.page&&this._pushToHistory(a,!0)}},_getPreviousParams:function(a,b){if(!this.currentBookmark||!this.currentPage)return null;this.updatePreviousBookmark&&(this.updatePreviousBookmark=!1);if(0<this.uid&&(!this.previousBookmark||!this.previousPage))return null;if(!this.current.dest&&!a||b){if(this.previousBookmark===this.currentBookmark)return null}else if(this.current.page||a){if(this.previousPage===
|
||||
this.currentPage)return null}else return null;var c={hash:this.currentBookmark,page:this.currentPage};PresentationMode.active&&(c.hash=null);return c},_stateObj:function(a){return{fingerprint:this.fingerprint,uid:this.uid,target:a}},_pushToHistory:function(a,b,c){this.initialized&&(!a.hash&&a.page&&(a.hash="page="+a.page),b&&!c&&(b=this._getPreviousParams())&&this._pushToHistory(b,!1,!this.current.dest&&this.current.hash!==this.previousHash),this._pushOrReplaceState(this._stateObj(a),c||0===this.uid),
|
||||
this.currentUid=this.uid++,this.current=a,this.updatePreviousBookmark=!0)},_goTo:function(a){if(this.initialized&&this.historyUnlocked&&this._isStateObjectDefined(a)){if(!this.reInitialized&&a.uid<this.currentUid){var b=this._getPreviousParams(!0);if(b){this._pushToHistory(this.current,!1);this._pushToHistory(b,!1);this.currentUid=a.uid;window.history.back();return}}this.historyUnlocked=!1;a.target.dest?PDFView.navigateTo(a.target.dest):PDFView.setHash(a.target.hash);this.currentUid=a.uid;a.uid>this.uid&&
|
||||
(this.uid=a.uid);this.current=a.target;this.updatePreviousBookmark=!0;a=window.location.hash.substring(1);this.previousHash!==a&&(this.allowHashChange=!1);this.previousHash=a;this.historyUnlocked=!0}},back:function(){this.go(-1)},forward:function(){this.go(1)},go:function(a){if(this.initialized&&this.historyUnlocked){var b=window.history.state;-1===a&&b&&0<b.uid?window.history.back():1===a&&b&&b.uid<this.uid-1&&window.history.forward()}}},SecondaryToolbar={opened:!1,previousContainerHeight:null,newContainerHeight:null,
|
||||
initialize:function(a){this.toolbar=a.toolbar;this.presentationMode=a.presentationMode;this.buttonContainer=this.toolbar.firstElementChild;this.toggleButton=a.toggleButton;this.presentationModeButton=a.presentationModeButton;this.openFile=a.openFile;this.print=a.print;this.download=a.download;this.firstPage=a.firstPage;this.lastPage=a.lastPage;this.pageRotateCw=a.pageRotateCw;this.pageRotateCcw=a.pageRotateCcw;a=[{element:this.toggleButton,handler:this.toggle},{element:this.presentationModeButton,
|
||||
handler:this.presentationModeClick},{element:this.print,handler:this.printClick},{element:this.firstPage,handler:this.firstPageClick},{element:this.lastPage,handler:this.lastPageClick},{element:this.pageRotateCw,handler:this.pageRotateCwClick},{element:this.pageRotateCcw,handler:this.pageRotateCcwClick}];for(var b in a){var c=a[b].element;c&&c.addEventListener("click",a[b].handler.bind(this))}},presentationModeClick:function(a){this.presentationMode.request();this.close()},openFileClick:function(a){document.getElementById("fileInput").click();
|
||||
this.close(a.target)},printClick:function(a){window.print();this.close(a.target)},downloadClick:function(a){PDFView.download();this.close(a.target)},firstPageClick:function(a){PDFView.page=1},lastPageClick:function(a){PDFView.page=PDFView.pdfDocument.numPages},pageRotateCwClick:function(a){PDFView.rotatePages(90)},pageRotateCcwClick:function(a){PDFView.rotatePages(-90)},setMaxHeight:function(a){a&&this.buttonContainer&&(this.newContainerHeight=a.clientHeight,this.previousContainerHeight!==this.newContainerHeight&&
|
||||
(this.buttonContainer.setAttribute("style","max-height: "+(this.newContainerHeight-SCROLLBAR_PADDING)+"px;"),this.previousContainerHeight=this.newContainerHeight))},open:function(){this.opened||(this.opened=!0,this.toggleButton.classList.add("toggled"),this.toolbar.classList.remove("hidden"))},close:function(a){!this.opened||a&&!this.toolbar.contains(a)||(this.opened=!1,this.toolbar.classList.add("hidden"),this.toggleButton.classList.remove("toggled"))},toggle:function(){this.opened?this.close():
|
||||
this.open()}},PasswordPrompt={visible:!1,updatePassword:null,reason:null,overlayContainer:null,passwordField:null,passwordText:null,passwordSubmit:null,passwordCancel:null,initialize:function(a){this.overlayContainer=a.overlayContainer;this.passwordField=a.passwordField;this.passwordText=a.passwordText;this.passwordSubmit=a.passwordSubmit;this.passwordCancel=a.passwordCancel;this.passwordSubmit.addEventListener("click",this.verifyPassword.bind(this));this.passwordCancel.addEventListener("click",this.hide.bind(this));
|
||||
this.passwordField.addEventListener("keydown",function(a){13===a.keyCode&&this.verifyPassword()}.bind(this));this.overlayContainer.addEventListener("keydown",function(a){27===a.keyCode&&this.hide()}.bind(this))},show:function(){if(!this.visible){this.visible=!0;this.overlayContainer.classList.remove("hidden");this.passwordField.focus();var a=mozL10n.get("password_label",null,"Enter the password to open this PDF file.");this.reason===PDFJS.PasswordResponses.INCORRECT_PASSWORD&&(a=mozL10n.get("password_invalid",
|
||||
null,"Invalid password. Please try again."));this.passwordText.textContent=a}},hide:function(){this.visible&&(this.visible=!1,this.passwordField.value="",this.overlayContainer.classList.add("hidden"))},verifyPassword:function(){var a=this.passwordField.value;if(a&&0<a.length)return this.hide(),this.updatePassword(a)}},DELAY_BEFORE_HIDING_CONTROLS=3E3,SELECTOR="presentationControls",DELAY_BEFORE_RESETTING_SWITCH_IN_PROGRESS=1E3,PresentationMode={active:!1,args:null,contextMenuOpen:!1,prevCoords:{x:null,
|
||||
y:null},initialize:function(a){this.container=a.container;this.secondaryToolbar=a.secondaryToolbar;this.viewer=this.container.firstElementChild;this.firstPage=a.firstPage;this.lastPage=a.lastPage;this.pageRotateCw=a.pageRotateCw;this.pageRotateCcw=a.pageRotateCcw;this.firstPage.addEventListener("click",function(){this.contextMenuOpen=!1;this.secondaryToolbar.firstPageClick()}.bind(this));this.lastPage.addEventListener("click",function(){this.contextMenuOpen=!1;this.secondaryToolbar.lastPageClick()}.bind(this));
|
||||
this.pageRotateCw.addEventListener("click",function(){this.contextMenuOpen=!1;this.secondaryToolbar.pageRotateCwClick()}.bind(this));this.pageRotateCcw.addEventListener("click",function(){this.contextMenuOpen=!1;this.secondaryToolbar.pageRotateCcwClick()}.bind(this))},get isFullscreen(){return document.fullscreenElement||document.mozFullScreen||document.webkitIsFullScreen||document.msFullscreenElement},_setSwitchInProgress:function(){this.switchInProgress&&clearTimeout(this.switchInProgress);this.switchInProgress=
|
||||
setTimeout(function(){delete this.switchInProgress}.bind(this),DELAY_BEFORE_RESETTING_SWITCH_IN_PROGRESS);PDFView.currentPosition=null},_resetSwitchInProgress:function(){this.switchInProgress&&(clearTimeout(this.switchInProgress),delete this.switchInProgress)},request:function(){if(!PDFView.supportsFullscreen||this.isFullscreen||!this.viewer.hasChildNodes())return!1;this._setSwitchInProgress();if(this.container.requestFullscreen)this.container.requestFullscreen();else if(this.container.mozRequestFullScreen)this.container.mozRequestFullScreen();
|
||||
else if(this.container.webkitRequestFullScreen)this.container.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);else if(this.container.msRequestFullscreen)this.container.msRequestFullscreen();else return!1;this.args={page:PDFView.page,previousScale:PDFView.currentScaleValue};return!0},enter:function(){this.active=!0;this._resetSwitchInProgress();setTimeout(function(){PDFView.page=this.args.page;PDFView.setScale("page-fit",!0)}.bind(this),0);window.addEventListener("mousemove",this.mouseMove,!1);
|
||||
window.addEventListener("mousedown",this.mouseDown,!1);window.addEventListener("contextmenu",this.contextMenu,!1);this.showControls();HandTool.enterPresentationMode();this.contextMenuOpen=!1;this.container.setAttribute("contextmenu","viewerContextMenu")},exit:function(){var a=PDFView.page;setTimeout(function(){PDFView.setScale(this.args.previousScale);PDFView.page=a;this.active=!1;this.args=null}.bind(this),0);window.removeEventListener("mousemove",this.mouseMove,!1);window.removeEventListener("mousedown",
|
||||
this.mouseDown,!1);window.removeEventListener("contextmenu",this.contextMenu,!1);this.hideControls();PDFView.clearMouseScrollState();HandTool.exitPresentationMode();this.container.removeAttribute("contextmenu");this.contextMenuOpen=!1;scrollIntoView(document.getElementById("thumbnailContainer"+a))},showControls:function(){this.controlsTimeout?clearTimeout(this.controlsTimeout):this.container.classList.add(SELECTOR);this.controlsTimeout=setTimeout(function(){this.container.classList.remove(SELECTOR);
|
||||
delete this.controlsTimeout}.bind(this),DELAY_BEFORE_HIDING_CONTROLS)},hideControls:function(){this.controlsTimeout&&(this.container.classList.remove(SELECTOR),clearTimeout(this.controlsTimeout),delete this.controlsTimeout)},mouseMove:function(a){a={x:a.clientX,y:a.clientY};var b=PresentationMode.prevCoords;PresentationMode.prevCoords=a;a.x===b.x&&a.y===b.y||PresentationMode.showControls()},mouseDown:function(a){var b=PresentationMode;b.contextMenuOpen?(b.contextMenuOpen=!1,a.preventDefault()):0!==
|
||||
a.button||a.target.href&&a.target.classList.contains("internalLink")||(a.preventDefault(),PDFView.page+=a.shiftKey?-1:1)},contextMenu:function(a){PresentationMode.contextMenuOpen=!0}};(function(){function a(a){PresentationMode.isFullscreen?PresentationMode.enter():PresentationMode.exit()}window.addEventListener("fullscreenchange",a,!1);window.addEventListener("mozfullscreenchange",a,!1);window.addEventListener("webkitfullscreenchange",a,!1);window.addEventListener("MSFullscreenChange",a,!1)})();"use strict";
|
||||
var GrabToPan=function(){function a(a){this.element=a.element;this.document=a.element.ownerDocument;"function"===typeof a.ignoreTarget&&(this.ignoreTarget=a.ignoreTarget);this.onActiveChanged=a.onActiveChanged;this.activate=this.activate.bind(this);this.deactivate=this.deactivate.bind(this);this.toggle=this.toggle.bind(this);this._onmousedown=this._onmousedown.bind(this);this._onmousemove=this._onmousemove.bind(this);this._endPan=this._endPan.bind(this)}a.prototype={CSS_CLASS_GRAB:"grab-to-pan-grab",
|
||||
CSS_CLASS_GRABBING:"grab-to-pan-grabbing",activate:function(){if(!this.active&&(this.active=!0,this.element.addEventListener("mousedown",this._onmousedown,!0),this.element.classList.add(this.CSS_CLASS_GRAB),this.onActiveChanged))this.onActiveChanged(!0)},deactivate:function(){if(this.active&&(this.active=!1,this.element.removeEventListener("mousedown",this._onmousedown,!0),this._endPan(),this.element.classList.remove(this.CSS_CLASS_GRAB),this.onActiveChanged))this.onActiveChanged(!1)},toggle:function(){this.active?
|
||||
this.deactivate():this.activate()},ignoreTarget:function(a){return a[b]("a[href], a[href] *, input, textarea, button, button *, select, option")},_onmousedown:function(a){if(0===a.button&&!this.ignoreTarget(a.target)){if(a.originalTarget)try{a.originalTarget.tagName}catch(b){return}this.scrollLeftStart=this.element.scrollLeft;this.scrollTopStart=this.element.scrollTop;this.clientXStart=a.clientX;this.clientYStart=a.clientY;this.document.addEventListener("mousemove",this._onmousemove,!0);this.document.addEventListener("mouseup",
|
||||
this._endPan,!0);this.element.addEventListener("scroll",this._endPan,!0);a.preventDefault();a.stopPropagation();this.element.classList.remove(this.CSS_CLASS_GRAB);this.document.documentElement.classList.add(this.CSS_CLASS_GRABBING)}},_onmousemove:function(a){this.element.removeEventListener("scroll",this._endPan,!0);var b;b="buttons"in a&&c?!(a.buttons|1):e||g?0===a.which:void 0;b?this.document.removeEventListener("mousemove",this._onmousemove,!0):(b=a.clientX-this.clientXStart,this.element.scrollTop=
|
||||
this.scrollTopStart-(a.clientY-this.clientYStart),this.element.scrollLeft=this.scrollLeftStart-b)},_endPan:function(){this.element.removeEventListener("scroll",this._endPan,!0);this.document.removeEventListener("mousemove",this._onmousemove,!0);this.document.removeEventListener("mouseup",this._endPan,!0);this.document.documentElement.classList.remove(this.CSS_CLASS_GRABBING);this.element.classList.add(this.CSS_CLASS_GRAB)}};var b;["webkitM","mozM","msM","oM","m"].some(function(a){a+="atches";a in
|
||||
document.documentElement&&(b=a);a+="Selector";a in document.documentElement&&(b=a);return b});var c=!document.documentMode||9<document.documentMode,d=window.chrome,e=d&&(d.webstore||d.app),g=/Apple/.test(navigator.vendor)&&/Version\/([6-9]\d*|[1-5]\d+)/.test(navigator.userAgent);return a}(),HandTool={initialize:function(a){var b=a.toggleHandTool;this.handTool=new GrabToPan({element:a.container,onActiveChanged:function(a){b&&(a?(b.title=mozL10n.get("hand_tool_disable.title",null,"Disable hand tool"),
|
||||
b.firstElementChild.textContent=mozL10n.get("hand_tool_disable_label",null,"Disable hand tool")):(b.title=mozL10n.get("hand_tool_enable.title",null,"Enable hand tool"),b.firstElementChild.textContent=mozL10n.get("hand_tool_enable_label",null,"Enable hand tool")))}});b&&b.addEventListener("click",this.handTool.toggle,!1)},toggle:function(){this.handTool.toggle()},enterPresentationMode:function(){this.handTool.active&&(this.wasActive=!0,this.handTool.deactivate())},exitPresentationMode:function(){this.wasActive&&
|
||||
(this.wasActive=null,this.handTool.activate())}},PDFView={pages:[],thumbnails:[],currentScale:UNKNOWN_SCALE,currentScaleValue:null,initialBookmark:document.location.hash.substring(1),container:null,thumbnailContainer:null,initialized:!1,fellback:!1,pdfDocument:null,sidebarOpen:!1,pageViewScroll:null,thumbnailViewScroll:null,pageRotation:0,mouseScrollTimeStamp:0,mouseScrollDelta:0,lastScroll:0,previousPageNumber:1,isViewerEmbedded:window.parent!==window,idleTimeout:null,currentPosition:null,initialize:function(){var a=
|
||||
this,b=this.container=document.getElementById("viewerContainer");this.pageViewScroll={};this.watchScroll(b,this.pageViewScroll,updateViewarea);var c=this.thumbnailContainer=document.getElementById("thumbnailView");this.thumbnailViewScroll={};this.watchScroll(c,this.thumbnailViewScroll,this.renderHighestPriority.bind(this));PDFFindBar.initialize({bar:document.getElementById("findbar"),toggleButton:document.getElementById("viewFind"),findField:document.getElementById("findInput"),highlightAllCheckbox:document.getElementById("findHighlightAll"),
|
||||
caseSensitiveCheckbox:document.getElementById("findMatchCase"),findMsg:document.getElementById("findMsg"),findStatusIcon:document.getElementById("findStatusIcon"),findPreviousButton:document.getElementById("findPrevious"),findNextButton:document.getElementById("findNext")});PDFFindController.initialize({pdfPageSource:this,integratedFind:this.supportsIntegratedFind});HandTool.initialize({container:b,toggleHandTool:document.getElementById("toggleHandTool")});SecondaryToolbar.initialize({toolbar:document.getElementById("secondaryToolbar"),
|
||||
presentationMode:PresentationMode,toggleButton:document.getElementById("secondaryToolbarToggle"),presentationModeButton:document.getElementById("secondaryPresentationMode"),openFile:document.getElementById("secondaryOpenFile"),print:document.getElementById("secondaryPrint"),download:document.getElementById("secondaryDownload"),firstPage:document.getElementById("firstPage"),lastPage:document.getElementById("lastPage"),pageRotateCw:document.getElementById("pageRotateCw"),pageRotateCcw:document.getElementById("pageRotateCcw")});
|
||||
PasswordPrompt.initialize({overlayContainer:document.getElementById("overlayContainer"),passwordField:document.getElementById("password"),passwordText:document.getElementById("passwordText"),passwordSubmit:document.getElementById("passwordSubmit"),passwordCancel:document.getElementById("passwordCancel")});PresentationMode.initialize({container:b,secondaryToolbar:SecondaryToolbar,firstPage:document.getElementById("contextFirstPage"),lastPage:document.getElementById("contextLastPage"),pageRotateCw:document.getElementById("contextPageRotateCw"),
|
||||
pageRotateCcw:document.getElementById("contextPageRotateCcw")});this.initialized=!0;b.addEventListener("scroll",function(){a.lastScroll=Date.now()},!1)},getPage:function(a){return this.pdfDocument.getPage(a)},watchScroll:function(a,b,c){b.down=!0;b.lastY=a.scrollTop;a.addEventListener("scroll",function(d){d=a.scrollTop;var e=b.lastY;d>e?b.down=!0:d<e&&(b.down=!1);b.lastY=d;c()},!0)},_setScaleUpdatePages:function(a,b,c,d){this.currentScaleValue=b;if(a!==this.currentScale){b=0;for(var e=this.pages.length;b<
|
||||
e;b++)this.pages[b].update(a);this.currentScale=a;if(!d){d=this.page;var g;this.currentPosition&&!IGNORE_CURRENT_POSITION_ON_ZOOM&&(d=this.currentPosition.page,g=[null,{name:"XYZ"},this.currentPosition.left,this.currentPosition.top,null]);this.pages[d-1].scrollIntoView(g)}g=document.createEvent("UIEvents");g.initUIEvent("scalechange",!1,!1,window,0);g.scale=a;g.resetAutoSettings=c;window.dispatchEvent(g)}},setScale:function(a,b,c){if("custom"!==a){var d=parseFloat(a);if(0<d)this._setScaleUpdatePages(d,
|
||||
a,!0,c);else{var e=this.pages[this.page-1];if(e){d=(this.container.clientWidth-SCROLLBAR_PADDING)/e.width*e.scale;e=(this.container.clientHeight-VERTICAL_PADDING)/e.height*e.scale;switch(a){case "page-actual":d=1;break;case "page-width":break;case "page-height":d=e;break;case "page-fit":d=Math.min(d,e);break;case "auto":d=Math.min(MAX_AUTO_SCALE,d);break;default:console.error("pdfViewSetScale: '"+a+"' is an unknown zoom value.");return}this._setScaleUpdatePages(d,a,b,c);selectScaleOption(a)}}}},zoomIn:function(a){var b=
|
||||
this.currentScale;do b=(b*DEFAULT_SCALE_DELTA).toFixed(2),b=Math.ceil(10*b)/10,b=Math.min(MAX_SCALE,b);while(--a&&b<MAX_SCALE);this.setScale(b,!0)},zoomOut:function(a){var b=this.currentScale;do b=(b/DEFAULT_SCALE_DELTA).toFixed(2),b=Math.floor(10*b)/10,b=Math.max(MIN_SCALE,b);while(--a&&b>MIN_SCALE);this.setScale(b,!0)},set page(a){var b=this.pages,c=document.createEvent("UIEvents");c.initUIEvent("pagechange",!1,!1,window,0);0<a&&a<=b.length?(b[a-1].updateStats(),this.previousPageNumber=currentPageNumber,
|
||||
currentPageNumber=a,c.pageNumber=a,window.dispatchEvent(c),updateViewarea.inProgress||this.loading&&1===a||b[a-1].scrollIntoView()):(this.previousPageNumber=a,c.pageNumber=this.page,window.dispatchEvent(c))},get page(){return currentPageNumber},get supportsPrinting(){var a="mozPrintCallback"in document.createElement("canvas");Object.defineProperty(this,"supportsPrinting",{value:a,enumerable:!0,configurable:!0,writable:!1});return a},get supportsFullscreen(){var a=document.documentElement,a=a.requestFullscreen||
|
||||
a.mozRequestFullScreen||a.webkitRequestFullScreen||a.msRequestFullscreen;!1===document.fullscreenEnabled||!1===document.mozFullScreenEnabled||!1===document.webkitFullscreenEnabled||!1===document.msFullscreenEnabled?a=!1:this.isViewerEmbedded&&(a=!1);Object.defineProperty(this,"supportsFullscreen",{value:a,enumerable:!0,configurable:!0,writable:!1});return a},get supportsIntegratedFind(){Object.defineProperty(this,"supportsIntegratedFind",{value:!1,enumerable:!0,configurable:!0,writable:!1});return!1},
|
||||
get supportsDocumentFonts(){Object.defineProperty(this,"supportsDocumentFonts",{value:!0,enumerable:!0,configurable:!0,writable:!1});return!0},get supportsDocumentColors(){Object.defineProperty(this,"supportsDocumentColors",{value:!0,enumerable:!0,configurable:!0,writable:!1});return!0},get loadingBar(){var a=new ProgressBar("#loadingBar",{});Object.defineProperty(this,"loadingBar",{value:a,enumerable:!0,configurable:!0,writable:!1});return a},get isHorizontalScrollbarEnabled(){return PresentationMode.active?
|
||||
!1:this.container.scrollWidth>this.container.clientWidth},initPassiveLoading:function(){var a={rangeListeners:[],progressListeners:[],addRangeListener:function(a){this.rangeListeners.push(a)},addProgressListener:function(a){this.progressListeners.push(a)},onDataRange:function(a,c){for(var d=this.rangeListeners,e=0,g=d.length;e<g;++e)d[e](a,c)},onDataProgress:function(a){for(var c=this.progressListeners,d=0,e=c.length;d<e;++d)c[d](a)},requestDataRange:function(a,c){FirefoxCom.request("requestDataRange",
|
||||
{begin:a,end:c})}};window.addEventListener("message",function(b){var c=b.data;if("object"===typeof c&&"pdfjsLoadAction"in c)switch(c.pdfjsLoadAction){case "supportsRangedLoading":PDFView.open(c.pdfUrl,0,void 0,a,{length:c.length,initialData:c.data});break;case "range":a.onDataRange(c.begin,c.chunk);break;case "rangeProgress":a.onDataProgress(c.loaded);break;case "progress":PDFView.progress(c.loaded/c.total);break;case "complete":if(!c.data){PDFView.error(mozL10n.get("loading_error",null,"An error occurred while loading the PDF."),
|
||||
b);break}PDFView.open(c.data,0)}});FirefoxCom.requestSync("initPassiveLoading",null)},setTitleUsingUrl:function(a){this.url=a;try{this.setTitle(decodeURIComponent(getFileName(a))||a)}catch(b){this.setTitle(a)}},setTitle:function(a){document.title=a},open:function(a,b,c,d,e){c={password:c};"string"===typeof a?(this.setTitleUsingUrl(a),c.url=a):a&&"byteLength"in a&&(c.data=a);if(e)for(var g in e)c[g]=e[g];this.pdfDocument=null;var h=this;h.loading=!0;PDFJS.getDocument(c,d,function(a,b){PasswordPrompt.updatePassword=
|
||||
a;PasswordPrompt.reason=b;PasswordPrompt.show()},function(a){h.progress(a.loaded/a.total)}).then(function(a){h.load(a,b);h.loading=!1},function(a,b){var c=mozL10n.get("loading_error",null,"An error occurred while loading the PDF.");b&&"InvalidPDFException"===b.name&&(c=mozL10n.get("invalid_file_error",null,"Invalid or corrupted PDF file."));b&&"MissingPDFException"===b.name&&(c=mozL10n.get("missing_file_error",null,"Missing PDF file."));h.error(c,{message:a});h.loading=!1})},download:function(){function a(){d.downloadUrl(b,
|
||||
c)}var b=this.url.split("#")[0],c=getPDFFileNameFromURL(b),d=new DownloadManager;d.onerror=function(a){PDFView.error("PDF failed to download.")};this.pdfDocument?this.pdfDocument.getData().then(function(a){a=PDFJS.createBlob(a,"application/pdf");d.download(a,b,c)},a).then(null,a):a()},fallback:function(a){},navigateTo:function(a){var b="",c=this,d=function(e){c.pendingRefStr=null;var g=e instanceof Object?c.pagesRefMap[e.num+" "+e.gen+" R"]:e+1;g?(g>c.pages.length&&(g=c.pages.length),c.pages[g-1].scrollIntoView(a),
|
||||
PDFHistory.push({dest:a,hash:b,page:g})):c.pdfDocument.getPageIndex(e).then(function(a){c.pagesRefMap[e.num+" "+e.gen+" R"]=a+1;d(e)})};this.destinationsPromise.then(function(){"string"===typeof a&&(b=a,a=c.destinations[a]);a instanceof Array&&d(a[0])})},getDestinationHash:function(a){if("string"===typeof a)return PDFView.getAnchorUrl("#"+escape(a));if(a instanceof Array){var b=a[0];if(b=b instanceof Object?this.pagesRefMap[b.num+" "+b.gen+" R"]:b+1){var b=PDFView.getAnchorUrl("#page="+b),c=a[1];
|
||||
if("object"===typeof c&&"name"in c&&"XYZ"==c.name){var c=a[4]||this.currentScaleValue,d=parseFloat(c);d&&(c=100*d);b+="&zoom="+c;if(a[2]||a[3])b+=","+(a[2]||0)+","+(a[3]||0)}return b}}return""},getAnchorUrl:function(a){return a},error:function(a,b){var c=mozL10n.get("error_version_info",{version:PDFJS.version||"?",build:PDFJS.build||"?"},"PDF.js v{{version}} (build: {{build}})")+"\n";b&&(c+=mozL10n.get("error_message",{message:b.message},"Message: {{message}}"),b.stack?c+="\n"+mozL10n.get("error_stack",
|
||||
{stack:b.stack},"Stack: {{stack}}"):(b.filename&&(c+="\n"+mozL10n.get("error_file",{file:b.filename},"File: {{file}}")),b.lineNumber&&(c+="\n"+mozL10n.get("error_line",{line:b.lineNumber},"Line: {{line}}"))));var d=document.getElementById("errorWrapper");d.removeAttribute("hidden");document.getElementById("errorMessage").textContent=a;var e=document.getElementById("errorClose");e.onclick=function(){d.setAttribute("hidden","true")};var g=document.getElementById("errorMoreInfo"),h=document.getElementById("errorShowMore"),
|
||||
f=document.getElementById("errorShowLess");h.onclick=function(){g.removeAttribute("hidden");h.setAttribute("hidden","true");f.removeAttribute("hidden");g.style.height=g.scrollHeight+"px"};f.onclick=function(){g.setAttribute("hidden","true");h.removeAttribute("hidden");f.setAttribute("hidden","true")};h.oncontextmenu=noContextMenuHandler;f.oncontextmenu=noContextMenuHandler;e.oncontextmenu=noContextMenuHandler;h.removeAttribute("hidden");f.setAttribute("hidden","true");g.value=c},progress:function(a){a=
|
||||
Math.round(100*a);a>PDFView.loadingBar.percent&&(PDFView.loadingBar.percent=a)},load:function(a,b){function c(a,b){a.onAfterDraw=function(){e||(e=!0,g());b.setImage(a.canvas)}}var d=this,e=!1,g=null,h=new Promise(function(a){g=a});PDFFindController.reset();this.pdfDocument=a;document.getElementById("errorWrapper").setAttribute("hidden","true");a.dataLoaded().then(function(){PDFView.loadingBar.hide();document.getElementById("outerContainer").classList.remove("loadingInProgress")});var f=document.getElementById("thumbnailView");
|
||||
for(f.parentNode.scrollTop=0;f.hasChildNodes();)f.removeChild(f.lastChild);"_loadingInterval"in f&&clearInterval(f._loadingInterval);for(var k=document.getElementById("viewer");k.hasChildNodes();)k.removeChild(k.lastChild);var s=a.numPages,n=a.fingerprint;document.getElementById("numPages").textContent=mozL10n.get("page_of",{pageCount:s},"of {{pageCount}}");document.getElementById("pageNumber").max=s;var q=PDFView.prefs=new Preferences;PDFView.documentFingerprint=n;var t=PDFView.store=new ViewHistory(n);
|
||||
this.pageRotation=0;var u=this.pages=[],p=this.pagesRefMap={},l=this.thumbnails=[],r;this.pagesPromise=n=new Promise(function(a){r=a});var m=a.getPage(1);m.then(function(e){e=e.getViewport((b||1)*CSS_UNITS);for(var g=1;g<=s;++g){var n=e.clone(),q=new PageView(k,g,b,d.navigateTo.bind(d),n),n=new ThumbnailView(f,g,n);c(q,n);u.push(q);l.push(n)}h.then(function(){if(PDFJS.disableAutoFetch)r();else for(var b=s,c=1;c<=s;++c)a.getPage(c).then(function(a,c){var d=u[a-1];d.pdfPage||d.setPdfPage(c);p[c.ref.num+
|
||||
" "+c.ref.gen+" R"]=a;b--;b||r()}.bind(null,c))});e=document.createEvent("CustomEvent");e.initCustomEvent("documentload",!0,!0,{});window.dispatchEvent(e);PDFView.loadingBar.setWidth(k);PDFFindController.resolveFirstPage()});Promise.all([m,q.initializedPromise,t.initializedPromise]).then(function(){var a=q.get("showPreviousViewOnLoad"),c=q.get("defaultZoomValue"),e=null;if(a&&t.get("exists",!1))var a=t.get("page","1"),c=c||t.get("zoom",PDFView.currentScale),e=t.get("scrollLeft","0"),h=t.get("scrollTop",
|
||||
"0"),e="page="+a+"&zoom="+c+","+e+","+h;else c&&(e="page=1&zoom="+c);PDFHistory.initialize(d.documentFingerprint);d.setInitialView(e,b);d.isViewerEmbedded||d.container.focus()});n.then(function(){PDFView.supportsPrinting&&a.getJavaScript().then(function(a){a.length&&(console.warn("Warning: JavaScript is not supported"),PDFView.fallback(PDFJS.UNSUPPORTED_FEATURES.javaScript));for(var b=/\bprint\s*\(/g,c=0,d=a.length;c<d;c++){var e=a[c];if(e&&b.test(e)){setTimeout(function(){window.print()});break}}})});
|
||||
m=this.destinationsPromise=a.getDestinations();m.then(function(a){d.destinations=a});Promise.all([n,m,PDFView.animationStartedPromise]).then(function(){a.getOutline().then(function(a){d.outline=new DocumentOutlineView(a);document.getElementById("viewOutline").disabled=!a;a&&q.get("ifAvailableShowOutlineOnLoad")&&(d.sidebarOpen||document.getElementById("sidebarToggle").click(),d.switchSidebarView("outline"))})});a.getMetadata().then(function(b){var c=b.info;b=b.metadata;d.documentInfo=c;d.metadata=
|
||||
b;console.log("PDF "+a.fingerprint+" ["+c.PDFFormatVersion+" "+(c.Producer||"-")+" / "+(c.Creator||"-")+"]"+(PDFJS.version?" (PDF.js: "+PDFJS.version+")":""));var e;b&&b.has("dc:title")&&(e=b.get("dc:title"));!e&&c&&c.Title&&(e=c.Title);e&&d.setTitle(e+" - "+document.title);c.IsAcroFormPresent&&(console.warn("Warning: AcroForm/XFA is not supported"),PDFView.fallback(PDFJS.UNSUPPORTED_FEATURES.forms))})},setInitialView:function(a,b){this.currentScale=0;this.currentScaleValue=null;document.getElementById("pageNumber").value=
|
||||
currentPageNumber=1;this.currentPosition=null;PDFHistory.initialDestination?(this.navigateTo(PDFHistory.initialDestination),PDFHistory.initialDestination=null):this.initialBookmark?(this.setHash(this.initialBookmark),PDFHistory.push({hash:this.initialBookmark},!!this.initialBookmark),this.initialBookmark=null):a?this.setHash(a):b&&(this.setScale(b,!0),this.page=1);PDFView.currentScale===UNKNOWN_SCALE&&this.setScale(DEFAULT_SCALE,!0)},renderHighestPriority:function(){PDFView.idleTimeout&&(clearTimeout(PDFView.idleTimeout),
|
||||
PDFView.idleTimeout=null);var a=this.getVisiblePages();if(a=this.getHighestPriority(a,this.pages,this.pageViewScroll.down))this.renderView(a,"page");else{if(this.sidebarOpen&&(a=this.getVisibleThumbs(),a=this.getHighestPriority(a,this.thumbnails,this.thumbnailViewScroll.down))){this.renderView(a,"thumbnail");return}PDFView.idleTimeout=setTimeout(function(){PDFView.cleanup()},CLEANUP_TIMEOUT)}},cleanup:function(){for(var a=0,b=this.pages.length;a<b;a++)this.pages[a]&&this.pages[a].renderingState!==
|
||||
RenderingStates.FINISHED&&this.pages[a].reset();this.pdfDocument.cleanup()},getHighestPriority:function(a,b,c){var d=a.views,e=d.length;if(0===e)return!1;for(var g=0;g<e;++g){var h=d[g].view;if(!this.isViewFinished(h))return h}a=c?a.last.id:a.first.id-2;return b[a]&&!this.isViewFinished(b[a])?b[a]:!1},isViewFinished:function(a){return a.renderingState===RenderingStates.FINISHED},renderView:function(a,b){switch(a.renderingState){case RenderingStates.FINISHED:return!1;case RenderingStates.PAUSED:PDFView.highestPriorityPage=
|
||||
b+a.id;a.resume();break;case RenderingStates.RUNNING:PDFView.highestPriorityPage=b+a.id;break;case RenderingStates.INITIAL:PDFView.highestPriorityPage=b+a.id,a.draw(this.renderHighestPriority.bind(this))}return!0},setHash:function(a){if(a)if(0<=a.indexOf("="))if(a=PDFView.parseQueryString(a),"nameddest"in a)PDFHistory.updateNextHashParam(a.nameddest),PDFView.navigateTo(a.nameddest);else{var b,c;"page"in a&&(b=a.page|0||1);if("zoom"in a){c=a.zoom.split(",");var d=c[0],e=parseFloat(d);e&&(d=e/100);
|
||||
c=[null,{name:"XYZ"},1<c.length?c[1]|0:null,2<c.length?c[2]|0:null,d]}c?this.pages[(b||this.page)-1].scrollIntoView(c):b&&(this.page=b);"pagemode"in a&&(b=document.getElementById("sidebarToggle"),"thumbs"===a.pagemode||"bookmarks"===a.pagemode?(this.sidebarOpen||b.click(),this.switchSidebarView("thumbs"===a.pagemode?"thumbs":"outline")):"none"===a.pagemode&&this.sidebarOpen&&b.click())}else/^\d+$/.test(a)?this.page=a:(PDFHistory.updateNextHashParam(unescape(a)),PDFView.navigateTo(unescape(a)))},switchSidebarView:function(a){var b=
|
||||
document.getElementById("thumbnailView"),c=document.getElementById("outlineView"),d=document.getElementById("viewThumbnail"),e=document.getElementById("viewOutline");switch(a){case "thumbs":a=b.classList.contains("hidden");d.classList.add("toggled");e.classList.remove("toggled");b.classList.remove("hidden");c.classList.add("hidden");PDFView.renderHighestPriority();a&&scrollIntoView(document.getElementById("thumbnailContainer"+this.page));break;case "outline":d.classList.remove("toggled"),e.classList.add("toggled"),
|
||||
b.classList.add("hidden"),c.classList.remove("hidden"),e.getAttribute("disabled")}},getVisiblePages:function(){return this.getVisibleElements(this.container,this.pages,!PresentationMode.active)},getVisibleThumbs:function(){return this.getVisibleElements(this.thumbnailContainer,this.thumbnails)},getVisibleElements:function(a,b,c){var d=a.scrollTop,e=d+a.clientHeight,g=a.scrollLeft,h=g+a.clientWidth;a=[];for(var f,k,s,n,q,t=0,u=b.length;t<u;++t)if(f=b[t],k=f.el.offsetTop+f.el.clientTop,s=f.el.clientHeight,
|
||||
!(k+s<d)){if(k>e)break;q=f.el.offsetLeft+f.el.clientLeft;n=f.el.clientWidth;q+n<g||q>h||(n=Math.max(0,d-k)+Math.max(0,k+s-e),s=100*(s-n)/s|0,a.push({id:f.id,x:q,y:k,view:f,percent:s}))}b=a[0];d=a[a.length-1];c&&a.sort(function(a,b){var c=a.percent-b.percent;return 0.0010<Math.abs(c)?-c:a.id-b.id});return{first:b,last:d,views:a}},parseQueryString:function(a){a=a.split("&");for(var b={},c=0;c<a.length;++c){var d=a[c].split("="),e=1<d.length?d[1]:null;b[decodeURIComponent(d[0])]=decodeURIComponent(e)}return b},
|
||||
beforePrint:function(){if(this.supportsPrinting){var a=!1;if(this.pages.length)for(var b=0,c=this.pages.length;b<c;++b){if(!this.pages[b].pdfPage){a=!0;break}}else a=!0;if(a)a=mozL10n.get("printing_not_ready",null,"Warning: The PDF is not fully loaded for printing."),window.alert(a);else for(document.querySelector("body").setAttribute("data-mozPrintCallback",!0),b=0,c=this.pages.length;b<c;++b)this.pages[b].beforePrint()}else a=mozL10n.get("printing_not_supported",null,"Warning: Printing is not fully supported by this browser."),
|
||||
this.error(a)},afterPrint:function(){for(var a=document.getElementById("printContainer");a.hasChildNodes();)a.removeChild(a.lastChild)},rotatePages:function(a){var b=this.pages[this.page-1];this.pageRotation=(this.pageRotation+360+a)%360;a=0;for(var c=this.pages.length;a<c;a++){var d=this.pages[a];d.update(d.scale,this.pageRotation)}a=0;for(c=this.thumbnails.length;a<c;a++)this.thumbnails[a].update(this.pageRotation);this.setScale(this.currentScaleValue,!0,!0);this.renderHighestPriority();b&&b.scrollIntoView()},
|
||||
mouseScroll:function(a){var b=(new Date).getTime(),c=this.mouseScrollTimeStamp;b>c&&50>b-c||((0<this.mouseScrollDelta&&0>a||0>this.mouseScrollDelta&&0<a)&&this.clearMouseScrollState(),this.mouseScrollDelta+=a,120<=Math.abs(this.mouseScrollDelta)&&(a=0<this.mouseScrollDelta?-1:1,this.clearMouseScrollState(),c=this.page,1==c&&-1==a||c==this.pages.length&&1==a||(this.page+=a,this.mouseScrollTimeStamp=b)))},clearMouseScrollState:function(){this.mouseScrollDelta=this.mouseScrollTimeStamp=0}},PageView=
|
||||
function(a,b,c,d,e){function g(a,b,c){function d(a,b){a.href=PDFView.getDestinationHash(b);a.onclick=function(){b&&PDFView.navigateTo(b);return!1};b&&(a.className="internalLink")}function e(a,b){a.href=PDFView.getAnchorUrl("");a.onclick=function(){switch(b){case "GoToPage":document.getElementById("pageNumber").focus();break;case "GoBack":PDFHistory.back();break;case "GoForward":PDFHistory.forward();break;case "Find":PDFView.supportsIntegratedFind||PDFFindBar.toggle();break;case "NextPage":PDFView.page++;
|
||||
break;case "PrevPage":PDFView.page--;break;case "LastPage":PDFView.page=PDFView.pages.length;break;case "FirstPage":PDFView.page=1}return!1};a.className="internalLink"}b.getAnnotations().then(function(h){f.annotationLayer&&(a.removeChild(f.annotationLayer),f.annotationLayer=null);c=c.clone({dontFlip:!0});for(var g=0;g<h.length;g++){var l=h[g];if((l=PDFJS.Annotation.fromData(l))&&l.hasHtml()){var r=l.getHtmlElement(b.commonObjs);mozL10n.translate(r);var l=l.getData(),m=l.rect,v=b.view,m=PDFJS.Util.normalizeRect([m[0],
|
||||
v[3]-m[1]+v[1],m[2],v[3]-m[3]+v[1]]);r.style.left=m[0]+"px";r.style.top=m[1]+"px";r.style.position="absolute";v="matrix("+c.transform.join(",")+")";CustomStyle.setProp("transform",r,v);CustomStyle.setProp("transformOrigin",r,-m[0]+"px "+-m[1]+"px");"Link"!==l.subtype||l.url||(l.action?e(r,l.action):d(r,"dest"in l?l.dest:null));f.annotationLayer||(l=document.createElement("div"),l.className="annotationLayer",a.appendChild(l),f.annotationLayer=l);f.annotationLayer.appendChild(r)}}})}this.id=b;this.rotation=
|
||||
0;this.scale=c||1;this.viewport=e;this.pdfPageRotate=e.rotation;this.renderingState=RenderingStates.INITIAL;this.annotationLayer=this.zoomLayer=this.textLayer=this.resume=null;b=document.createElement("a");b.name=""+this.id;var h=this.el=document.createElement("div");h.id="pageContainer"+this.id;h.className="page";h.style.width=Math.floor(this.viewport.width)+"px";h.style.height=Math.floor(this.viewport.height)+"px";a.appendChild(b);a.appendChild(h);this.setPdfPage=function(a){this.pdfPage=a;this.pdfPageRotate=
|
||||
a.rotate;this.viewport=a.getViewport(this.scale*CSS_UNITS,(this.rotation+this.pdfPageRotate)%360);this.stats=a.stats;this.reset()};this.destroy=function(){this.zoomLayer=null;this.reset();this.pdfPage&&this.pdfPage.destroy()};this.reset=function(){this.renderTask&&this.renderTask.cancel();this.resume=null;this.renderingState=RenderingStates.INITIAL;h.style.width=Math.floor(this.viewport.width)+"px";h.style.height=Math.floor(this.viewport.height)+"px";for(var a=h.childNodes,b=h.childNodes.length-1;0<=
|
||||
b;b--){var c=a[b];this.zoomLayer&&this.zoomLayer===c||h.removeChild(c)}h.removeAttribute("data-loaded");this.annotationLayer=null;delete this.canvas;this.loadingIconDiv=document.createElement("div");this.loadingIconDiv.className="loadingIcon";h.appendChild(this.loadingIconDiv)};this.update=function(a,b){this.scale=a||this.scale;"undefined"!==typeof b&&(this.rotation=b);this.viewport=this.viewport.clone({scale:this.scale*CSS_UNITS,rotation:(this.rotation+this.pdfPageRotate)%360});USE_ONLY_CSS_ZOOM&&
|
||||
this.canvas?this.cssTransform(this.canvas):(this.canvas&&!this.zoomLayer&&(this.zoomLayer=this.canvas.parentNode,this.zoomLayer.style.position="absolute"),this.zoomLayer&&this.cssTransform(this.zoomLayer.firstChild),this.reset())};this.cssTransform=function(a){var b=this.viewport.width,c=this.viewport.height;a.style.width=a.parentNode.style.width=h.style.width=Math.floor(b)+"px";a.style.height=a.parentNode.style.height=h.style.height=Math.floor(c)+"px";var d=this.viewport.rotation-a._viewport.rotation,
|
||||
e=Math.abs(d),f=1,p=1;if(90===e||270===e)f=c/b,p=b/c;CustomStyle.setProp("transform",a,"rotate("+d+"deg) scale("+f+","+p+")");if(this.textLayer){c=Math.abs(this.viewport.rotation-this.textLayer.viewport.rotation);d=b/a.width;if(90===c||270===c)d=b/a.height;a=this.textLayer.textLayerDiv;var l,r;switch(c){case 0:l=r=0;break;case 90:l=0;r="-"+a.style.height;break;case 180:l="-"+a.style.width;r="-"+a.style.height;break;case 270:l="-"+a.style.width;r=0;break;default:console.error("Bad rotation value.")}CustomStyle.setProp("transform",
|
||||
a,"rotate("+c+"deg) scale("+d+", "+d+") translate("+l+", "+r+")");CustomStyle.setProp("transformOrigin",a,"0% 0%")}USE_ONLY_CSS_ZOOM&&this.annotationLayer&&g(h,this.pdfPage,this.viewport)};Object.defineProperty(this,"width",{get:function(){return this.viewport.width},enumerable:!0});Object.defineProperty(this,"height",{get:function(){return this.viewport.height},enumerable:!0});var f=this;this.getPagePoint=function(a,b){return this.viewport.convertToPdfPoint(a,b)};this.scrollIntoView=function(a){PresentationMode.active&&
|
||||
(a=null,PDFView.setScale(PDFView.currentScaleValue,!0,!0));if(a){var b=0,c=0,d=0,e=0,g,f;f=!!(this.rotation%180);g=(f?this.height:this.width)/this.scale/CSS_UNITS;f=(f?this.width:this.height)/this.scale/CSS_UNITS;var l=0;switch(a[1].name){case "XYZ":b=a[2];c=a[3];l=a[4];b=null!==b?b:0;c=null!==c?c:f;break;case "Fit":case "FitB":l="page-fit";break;case "FitH":case "FitBH":c=a[2];l="page-width";break;case "FitV":case "FitBV":b=a[2];d=g;e=f;l="page-height";break;case "FitR":b=a[2];c=a[3];d=a[4]-b;e=
|
||||
a[5]-c;g=(PDFView.container.clientWidth-SCROLLBAR_PADDING)/d/CSS_UNITS;f=(PDFView.container.clientHeight-SCROLLBAR_PADDING)/e/CSS_UNITS;l=Math.min(Math.abs(g),Math.abs(f));break;default:return}l&&l!==PDFView.currentScale?PDFView.setScale(l,!0,!0):PDFView.currentScale===UNKNOWN_SCALE&&PDFView.setScale(DEFAULT_SCALE,!0,!0);"page-fit"!==l||a[4]?(b=[this.viewport.convertToViewportPoint(b,c),this.viewport.convertToViewportPoint(b+d,c+e)],a=Math.min(b[0][0],b[1][0]),b=Math.min(b[0][1],b[1][1]),scrollIntoView(h,
|
||||
{left:a,top:b})):scrollIntoView(h)}else scrollIntoView(h)};this.getTextContent=function(){return PDFView.getPage(this.id).then(function(a){return a.getTextContent()})};this.draw=function(a){function b(d){v===m.renderTask&&(m.renderTask=null);if("cancelled"!==d){m.renderingState=RenderingStates.FINISHED;m.loadingIconDiv&&(h.removeChild(m.loadingIconDiv),delete m.loadingIconDiv);m.zoomLayer&&(h.removeChild(m.zoomLayer),m.zoomLayer=null);d&&PDFView.error(mozL10n.get("rendering_error",null,"An error occurred while rendering the page."),
|
||||
d);m.stats=c.stats;m.updateStats();if(m.onAfterDraw)m.onAfterDraw();cache.push(m);d=document.createEvent("CustomEvent");d.initCustomEvent("pagerender",!0,!0,{pageNumber:c.pageNumber});h.dispatchEvent(d);a()}}var c=this.pdfPage;if(!this.pagePdfPromise)if(c){this.renderingState!==RenderingStates.INITIAL&&console.error("Must be in new state before drawing");this.renderingState=RenderingStates.RUNNING;var d=this.viewport,e=document.createElement("div");e.style.width=h.style.width;e.style.height=h.style.height;
|
||||
e.classList.add("canvasWrapper");var f=document.createElement("canvas");f.id="page"+this.id;e.appendChild(f);h.appendChild(e);this.canvas=f;var e=f.getContext("2d"),p=getOutputScale(e);if(USE_ONLY_CSS_ZOOM){var l=d.clone({scale:CSS_UNITS});p.sx*=l.width/d.width;p.sy*=l.height/d.height;p.scaled=!0}f.width=Math.floor(d.width)*p.sx|0;f.height=Math.floor(d.height)*p.sy|0;f.style.width=Math.floor(d.width)+"px";f.style.height=Math.floor(d.height)+"px";f._viewport=d;d=null;PDFJS.disableTextLayer||(d=document.createElement("div"),
|
||||
d.className="textLayer",d.style.width=f.width+"px",d.style.height=f.height+"px",h.appendChild(d));var r=this.textLayer=d?new TextLayerBuilder({textLayerDiv:d,pageIndex:this.id-1,lastScrollSource:PDFView,viewport:this.viewport,isViewerInPresentationMode:PresentationMode.active}):null;e._scaleX=p.sx;e._scaleY=p.sy;p.scaled&&e.scale(p.sx,p.sy);p.scaled&&d&&(CustomStyle.setProp("transform",d,"scale("+1/p.sx+", "+1/p.sy+")"),CustomStyle.setProp("transformOrigin",d,"0% 0%"),d.dataset._scaleX=p.sx,d.dataset._scaleY=
|
||||
p.sy);var m=this,v=this.renderTask=this.pdfPage.render({canvasContext:e,viewport:this.viewport,textLayer:r,continueCallback:function(a){PDFView.highestPriorityPage!=="page"+m.id?(m.renderingState=RenderingStates.PAUSED,m.resume=function(){m.renderingState=RenderingStates.RUNNING;a()}):a()}});this.renderTask.promise.then(function(){b(null)},function(a){b(a)});r&&this.getTextContent().then(function(a){r.setTextContent(a)});g(h,c,this.viewport);h.setAttribute("data-loaded",!0)}else f=PDFView.getPage(this.id),
|
||||
f.then(function(b){delete this.pagePdfPromise;this.setPdfPage(b);this.draw(a)}.bind(this)),this.pagePdfPromise=f};this.beforePrint=function(){var a=this.pdfPage,b=a.getViewport(1),c=document.createElement("canvas");c.width=2*Math.floor(b.width);c.height=2*Math.floor(b.height);c.style.width=2*b.width+"pt";c.style.height=2*b.height+"pt";CustomStyle.setProp("transform",c,"scale(0.5, 0.5)");CustomStyle.setProp("transformOrigin",c,"0% 0%");var d=document.getElementById("printContainer"),e=document.createElement("div");
|
||||
e.style.width=b.width+"pt";e.style.height=b.height+"pt";e.appendChild(c);d.appendChild(e);var h=this;c.mozPrintCallback=function(d){var e=d.context;e.save();e.fillStyle="rgb(255, 255, 255)";e.fillRect(0,0,c.width,c.height);e.restore();e.scale(2,2);a.render({canvasContext:e,viewport:b}).promise.then(function(){d.done();h.pdfPage.destroy()},function(a){console.error(a);"abort"in d?d.abort():d.done();h.pdfPage.destroy()})}};this.updateStats=function(){this.stats&&PDFJS.pdfBug&&Stats.enabled&&Stats.add(this.id,
|
||||
this.stats)}},ThumbnailView=function(a,b,c){var d=document.createElement("a");d.href=PDFView.getAnchorUrl("#page="+b);d.title=mozL10n.get("thumb_page_title",{page:b},"Page {{page}}");d.onclick=function(){PDFView.page=b;return!1};this.pdfPage=void 0;this.viewport=c;this.pdfPageRotate=c.rotation;this.rotation=0;this.pageWidth=this.viewport.width;this.pageHeight=this.viewport.height;this.pageRatio=this.pageWidth/this.pageHeight;this.id=b;this.canvasWidth=98;this.canvasHeight=this.canvasWidth/this.pageWidth*
|
||||
this.pageHeight;this.scale=this.canvasWidth/this.pageWidth;var e=this.el=document.createElement("div");e.id="thumbnailContainer"+b;e.className="thumbnail";1===b&&e.classList.add("selected");var g=document.createElement("div");g.className="thumbnailSelectionRing";g.style.width=this.canvasWidth+"px";g.style.height=this.canvasHeight+"px";e.appendChild(g);d.appendChild(e);a.appendChild(d);this.hasImage=!1;this.renderingState=RenderingStates.INITIAL;this.setPdfPage=function(a){this.pdfPage=a;this.pdfPageRotate=
|
||||
a.rotate;this.viewport=a.getViewport(1,(this.rotation+this.pdfPageRotate)%360);this.update()};this.update=function(a){void 0!==a&&(this.rotation=a);this.viewport=this.viewport.clone({scale:1,rotation:(this.rotation+this.pdfPageRotate)%360});this.pageWidth=this.viewport.width;this.pageHeight=this.viewport.height;this.pageRatio=this.pageWidth/this.pageHeight;this.canvasHeight=this.canvasWidth/this.pageWidth*this.pageHeight;this.scale=this.canvasWidth/this.pageWidth;e.removeAttribute("data-loaded");
|
||||
g.textContent="";g.style.width=this.canvasWidth+"px";g.style.height=this.canvasHeight+"px";this.hasImage=!1;this.renderingState=RenderingStates.INITIAL;this.resume=null};this.getPageDrawContext=function(){var a=document.createElement("canvas");a.id="thumbnail"+b;a.width=this.canvasWidth;a.height=this.canvasHeight;a.className="thumbnailImage";a.setAttribute("aria-label",mozL10n.get("thumb_page_canvas",{page:b},"Thumbnail of Page {{page}}"));e.setAttribute("data-loaded",!0);g.appendChild(a);a=a.getContext("2d");
|
||||
a.save();a.fillStyle="rgb(255, 255, 255)";a.fillRect(0,0,this.canvasWidth,this.canvasHeight);a.restore();return a};this.drawingRequired=function(){return!this.hasImage};this.draw=function(a){if(this.pdfPage)if(this.renderingState!==RenderingStates.INITIAL&&console.error("Must be in new state before drawing"),this.renderingState=RenderingStates.RUNNING,this.hasImage)a();else{var b=this,c=this.getPageDrawContext(),d=this.viewport.clone({scale:this.scale});this.pdfPage.render({canvasContext:c,viewport:d,
|
||||
continueCallback:function(a){PDFView.highestPriorityPage!=="thumbnail"+b.id?(b.renderingState=RenderingStates.PAUSED,b.resume=function(){b.renderingState=RenderingStates.RUNNING;a()}):a()}}).promise.then(function(){b.renderingState=RenderingStates.FINISHED;a()},function(c){b.renderingState=RenderingStates.FINISHED;a()});this.hasImage=!0}else PDFView.getPage(this.id).then(function(b){this.setPdfPage(b);this.draw(a)}.bind(this))};this.setImage=function(a){if(!this.pdfPage)PDFView.getPage(this.id).then(function(b){this.setPdfPage(b);
|
||||
this.setImage(a)}.bind(this));else if(!this.hasImage&&a){this.renderingState=RenderingStates.FINISHED;var b=this.getPageDrawContext();b.drawImage(a,0,0,a.width,a.height,0,0,b.canvas.width,b.canvas.height);this.hasImage=!0}}},FIND_SCROLL_OFFSET_TOP=-50,FIND_SCROLL_OFFSET_LEFT=-400,TextLayerBuilder=function(a){var b=document.createDocumentFragment();this.textLayerDiv=a.textLayerDiv;this.divContentDone=this.layoutDone=!1;this.pageIdx=a.pageIndex;this.matches=[];this.lastScrollSource=a.lastScrollSource;
|
||||
this.viewport=a.viewport;this.isViewerInPresentationMode=a.isViewerInPresentationMode;"undefined"===typeof PDFFindController&&(window.PDFFindController=null);"undefined"===typeof this.lastScrollSource&&(this.lastScrollSource=null);this.beginLayout=function(){this.textDivs=[];this.renderingDone=!1};this.endLayout=function(){this.layoutDone=!0;this.insertDivContent()};this.renderLayer=function(){var a=this.textDivs,d=this.textLayerDiv,e=document.createElement("canvas").getContext("2d");if(!(1E5<a.length)){for(var g=
|
||||
0,h=a.length;g<h;g++){var f=a[g];if(!("isWhitespace"in f.dataset)){e.font=f.style.fontSize+" "+f.style.fontFamily;var k=e.measureText(f.textContent).width;0<k&&(b.appendChild(f),k="scale("+f.dataset.canvasWidth/k+", 1)",k="rotate("+f.dataset.angle+"deg) "+k,CustomStyle.setProp("transform",f,k),CustomStyle.setProp("transformOrigin",f,"0% 0%"))}}d.appendChild(b);this.renderingDone=!0;this.updateMatches()}};this.setupRenderLayoutTimer=function(){var a=this,b=null===this.lastScrollSource?0:this.lastScrollSource.lastScroll;
|
||||
200<Date.now()-b?this.renderLayer():(this.renderTimer&&clearTimeout(this.renderTimer),this.renderTimer=setTimeout(function(){a.setupRenderLayoutTimer()},200))};this.appendText=function(a){var b=document.createElement("div"),e=a.fontSize*Math.abs(a.vScale);b.dataset.canvasWidth=a.canvasWidth*Math.abs(a.hScale);b.dataset.fontName=a.fontName;b.dataset.angle=180/Math.PI*a.angle;b.style.fontSize=e+"px";b.style.fontFamily=a.fontFamily;e=a.ascent?a.ascent*e:a.descent?(1+a.descent)*e:e;b.style.left=a.x+e*
|
||||
Math.sin(a.angle)+"px";b.style.top=a.y-e*Math.cos(a.angle)+"px";this.textDivs.push(b)};this.insertDivContent=function(){if(this.layoutDone&&!this.divContentDone&&this.textContent){this.divContentDone=!0;for(var a=this.textDivs,b=this.textContent.bidiTexts,e=0;e<b.length;e++){var g=b[e],h=a[e];/\S/.test(g.str)?(h.textContent=g.str,h.dir=g.dir):h.dataset.isWhitespace=!0}this.setupRenderLayoutTimer()}};this.setTextContent=function(a){this.textContent=a;this.insertDivContent()};this.convertMatches=function(a){for(var b=
|
||||
0,e=0,g=this.textContent.bidiTexts,h=g.length-1,f=null===PDFFindController?0:PDFFindController.state.query.length,k=[],s=0;s<a.length;s++){for(var n=a[s];b!==h&&n>=e+g[b].str.length;)e+=g[b].str.length,b++;b==g.length&&console.error("Could not find matching mapping");for(var q={begin:{divIdx:b,offset:n-e}},n=n+f;b!==h&&n>e+g[b].str.length;)e+=g[b].str.length,b++;q.end={divIdx:b,offset:n-e};k.push(q)}return k};this.renderMatches=function(a){function b(a,c){var d=a.divIdx,e=h[d];e.textContent="";var f=
|
||||
g[d].str.substring(0,a.offset),f=document.createTextNode(f);if(c){var d=k&&d===s,l=document.createElement("span");l.className=c+(d?" selected":"");l.appendChild(f);e.appendChild(l)}else e.appendChild(f)}function e(a,b,c){var d=a.divIdx,e=h[d];a=g[d].str.substring(a.offset,b.offset);a=document.createTextNode(a);c?(b=document.createElement("span"),b.className=c,b.appendChild(a),e.appendChild(b)):e.appendChild(a)}if(0!==a.length){var g=this.textContent.bidiTexts,h=this.textDivs,f=null,k=null===PDFFindController?
|
||||
!1:this.pageIdx===PDFFindController.selected.pageIdx,s=null===PDFFindController?-1:PDFFindController.selected.matchIdx,n={divIdx:-1,offset:void 0},q=s,t=q+1;if(null===PDFFindController?0:PDFFindController.state.highlightAll)q=0,t=a.length;else if(!k)return;for(;q<t;q++){var u=a[q],p=u.begin,u=u.end,l=k&&q===s,r=l?" selected":"";l&&!this.isViewerInPresentationMode&&scrollIntoView(h[p.divIdx],{top:FIND_SCROLL_OFFSET_TOP,left:FIND_SCROLL_OFFSET_LEFT});f&&p.divIdx===f.divIdx?e(f,p):(null!==f&&e(f,n),
|
||||
b(p));if(p.divIdx===u.divIdx)e(p,u,"highlight"+r);else{e(p,n,"highlight begin"+r);for(f=p.divIdx+1;f<u.divIdx;f++)h[f].className="highlight middle"+r;b(u,"highlight end"+r)}f=u}f&&e(f,n)}};this.updateMatches=function(){if(this.renderingDone){for(var a=this.matches,b=this.textDivs,e=this.textContent.bidiTexts,g=-1,h=0;h<a.length;h++){for(var f=a[h],g=Math.max(g,f.begin.divIdx);g<=f.end.divIdx;g++){var k=b[g];k.textContent=e[g].str;k.className=""}g=f.end.divIdx+1}null!==PDFFindController&&PDFFindController.active&&
|
||||
(this.matches=this.convertMatches(null===PDFFindController?[]:PDFFindController.pageMatches[this.pageIdx]||[]),this.renderMatches(this.matches))}}},DocumentOutlineView=function(a){function b(a,b){a.href=PDFView.getDestinationHash(b.dest);a.onclick=function(a){PDFView.navigateTo(b.dest);return!1}}var c=document.getElementById("outlineView");for(document.getElementById("viewOutline");c.firstChild;)c.removeChild(c.firstChild);if(a)for(a=[{parent:c,items:a}];0<a.length;){var c=a.shift(),d,e=c.items.length;
|
||||
for(d=0;d<e;d++){var g=c.items[d],h=document.createElement("div");h.className="outlineItem";var f=document.createElement("a");b(f,g);f.textContent=g.title;h.appendChild(f);0<g.items.length&&(f=document.createElement("div"),f.className="outlineItems",h.appendChild(f),a.push({parent:f,items:g.items}));c.parent.appendChild(h)}}else c.classList.contains("hidden")||PDFView.switchSidebarView("thumbs")};
|
||||
document.addEventListener("DOMContentLoaded",function(a){PDFView.initialize();a=PDFView.parseQueryString(document.location.search.substring(1)).file||DEFAULT_URL;var b=document.createElement("input");b.id="fileInput";b.className="fileInput";b.setAttribute("type","file");b.oncontextmenu=noContextMenuHandler;document.body.appendChild(b);window.File&&window.FileReader&&window.FileList&&window.Blob&&(document.getElementById("fileInput").value=null);b=document.location.hash.substring(1);b=PDFView.parseQueryString(b);
|
||||
"disableWorker"in b&&(PDFJS.disableWorker="true"===b.disableWorker);"disableRange"in b&&(PDFJS.disableRange="true"===b.disableRange);"disableAutoFetch"in b&&(PDFJS.disableAutoFetch="true"===b.disableAutoFetch);"disableFontFace"in b&&(PDFJS.disableFontFace="true"===b.disableFontFace);"disableHistory"in b&&(PDFJS.disableHistory="true"===b.disableHistory);"useOnlyCssZoom"in b&&(USE_ONLY_CSS_ZOOM="true"===b.useOnlyCssZoom);"verbosity"in b&&(PDFJS.verbosity=b.verbosity|0);"ignoreCurrentPositionOnZoom"in
|
||||
b&&(IGNORE_CURRENT_POSITION_ON_ZOOM="true"===b.ignoreCurrentPositionOnZoom);var c=navigator.language;"locale"in b&&(c=b.locale);mozL10n.setLanguage(c);if("textLayer"in b)switch(b.textLayer){case "off":PDFJS.disableTextLayer=!0;break;case "visible":case "shadow":case "hover":document.getElementById("viewer").classList.add("textLayer-"+b.textLayer)}"pdfBug"in b&&(PDFJS.pdfBug=!0,b=b.pdfBug.split(","),PDFBug.enable(b),PDFBug.init());PDFView.supportsPrinting||(document.getElementById("print").classList.add("hidden"),
|
||||
document.getElementById("secondaryPrint").classList.add("hidden"));PDFView.supportsFullscreen||(document.getElementById("presentationMode").classList.add("hidden"),document.getElementById("secondaryPresentationMode").classList.add("hidden"));PDFView.supportsIntegratedFind&&document.getElementById("viewFind").classList.add("hidden");PDFJS.UnsupportedManager.listen(PDFView.fallback.bind(PDFView));document.getElementById("scaleSelect").oncontextmenu=noContextMenuHandler;var d=document.getElementById("mainContainer"),
|
||||
e=document.getElementById("outerContainer");d.addEventListener("transitionend",function(a){a.target==d&&(a=document.createEvent("UIEvents"),a.initUIEvent("resize",!1,!1,window,0),window.dispatchEvent(a),e.classList.remove("sidebarMoving"))},!0);document.getElementById("sidebarToggle").addEventListener("click",function(){this.classList.toggle("toggled");e.classList.add("sidebarMoving");e.classList.toggle("sidebarOpen");PDFView.sidebarOpen=e.classList.contains("sidebarOpen");PDFView.renderHighestPriority()});
|
||||
document.getElementById("viewThumbnail").addEventListener("click",function(){PDFView.switchSidebarView("thumbs")});document.getElementById("viewOutline").addEventListener("click",function(){PDFView.switchSidebarView("outline")});document.getElementById("previous").addEventListener("click",function(){PDFView.page--});document.getElementById("next").addEventListener("click",function(){PDFView.page++});document.getElementById("zoomIn").addEventListener("click",function(){PDFView.zoomIn()});document.getElementById("zoomOut").addEventListener("click",
|
||||
function(){PDFView.zoomOut()});document.getElementById("pageNumber").addEventListener("click",function(){this.select()});document.getElementById("pageNumber").addEventListener("change",function(){PDFView.page=this.value|0;this.value!==(this.value|0).toString()&&(this.value=PDFView.page)});document.getElementById("scaleSelect").addEventListener("change",function(){PDFView.setScale(this.value)});document.getElementById("presentationMode").addEventListener("click",SecondaryToolbar.presentationModeClick.bind(SecondaryToolbar));
|
||||
document.getElementById("print").addEventListener("click",SecondaryToolbar.printClick.bind(SecondaryToolbar));PDFView.open(a,0)},!0);
|
||||
function updateViewarea(){if(PDFView.initialized){var a=PDFView.getVisiblePages(),b=a.views;if(0!==b.length){PDFView.renderHighestPriority();for(var c=PDFView.page,a=a.first,d=0,e=b.length,g=!1;d<e;++d){var h=b[d];if(100>h.percent)break;if(h.id===PDFView.page){g=!0;break}}g||(c=b[0].id);updateViewarea.inProgress=!0;PDFView.page=c;updateViewarea.inProgress=!1;var b=PDFView.currentScale,c=PDFView.currentScaleValue,f=parseFloat(c)===b?Math.round(1E4*b)/100:c,k=a.id,b="#page="+k+("&zoom="+f),c=PDFView.container,
|
||||
a=PDFView.pages[k-1].getPagePoint(c.scrollLeft-a.x,c.scrollTop-a.y),s=Math.round(a[0]),n=Math.round(a[1]),b=b+(","+s+","+n);PDFView.currentPosition=PresentationMode.active||PresentationMode.switchInProgress?null:{page:k,left:s,top:n};var q=PDFView.store;q.initializedPromise.then(function(){q.set("exists",!0);q.set("page",k);q.set("zoom",f);q.set("scrollLeft",s);q.set("scrollTop",n)});a=PDFView.getAnchorUrl(b);document.getElementById("viewBookmark").href=a;document.getElementById("secondaryViewBookmark").href=
|
||||
a;PDFHistory.updateCurrentBookmark(b,k)}}}window.addEventListener("resize",function(a){PDFView.initialized&&(document.getElementById("pageWidthOption").selected||document.getElementById("pageFitOption").selected||document.getElementById("pageAutoOption").selected)&&PDFView.setScale(document.getElementById("scaleSelect").value);updateViewarea();SecondaryToolbar.setMaxHeight(PDFView.container)});window.addEventListener("hashchange",function(a){PDFHistory.isHashChangeUnlocked&&PDFView.setHash(document.location.hash.substring(1))});
|
||||
window.addEventListener("change",function(a){var b=a.target.files;b&&0!==b.length&&(a=new FileReader,a.onload=function(a){a=new Uint8Array(a.target.result);PDFView.open(a,0)},b=b[0],a.readAsArrayBuffer(b),PDFView.setTitleUsingUrl(b.name),document.getElementById("viewBookmark").setAttribute("hidden","true"),document.getElementById("secondaryViewBookmark").setAttribute("hidden","true"),document.getElementById("download").setAttribute("hidden","true"),document.getElementById("secondaryDownload").setAttribute("hidden",
|
||||
"true"))},!0);function selectScaleOption(a){for(var b=document.getElementById("scaleSelect").options,c=!1,d=0;d<b.length;d++){var e=b[d];e.value!=a?e.selected=!1:c=e.selected=!0}return c}
|
||||
window.addEventListener("localized",function(a){document.getElementsByTagName("html")[0].dir=mozL10n.getDirection();PDFView.animationStartedPromise.then(function(){var a=document.getElementById("scaleSelectContainer");if(0<a.clientWidth){var c=document.getElementById("scaleSelect");c.setAttribute("style","min-width: inherit;");var d=c.clientWidth+SCALE_SELECT_CONTAINER_PADDING;c.setAttribute("style","min-width: "+(d+SCALE_SELECT_PADDING)+"px;");a.setAttribute("style","min-width: "+d+"px; max-width: "+
|
||||
d+"px;")}SecondaryToolbar.setMaxHeight(PDFView.container)})},!0);
|
||||
window.addEventListener("scalechange",function(a){document.getElementById("zoomOut").disabled=a.scale===MIN_SCALE;document.getElementById("zoomIn").disabled=a.scale===MAX_SCALE;var b=document.getElementById("customScaleOption");b.selected=!1;!a.resetAutoSettings&&(document.getElementById("pageWidthOption").selected||document.getElementById("pageFitOption").selected||document.getElementById("pageAutoOption").selected)||selectScaleOption(""+a.scale)||(b.textContent=Math.round(1E4*a.scale)/100+"%",b.selected=
|
||||
!0);updateViewarea()},!0);
|
||||
window.addEventListener("pagechange",function(a){a=a.pageNumber;if(PDFView.previousPageNumber!==a){document.getElementById("pageNumber").value=a;var b=document.querySelector(".thumbnail.selected");b&&b.classList.remove("selected");b=document.getElementById("thumbnailContainer"+a);b.classList.add("selected");var c=PDFView.getVisibleThumbs(),d=c.views.length;if(0<d){var e=c.first.id,c=1<d?c.last.id:e;(a<=e||a>=c)&&scrollIntoView(b,{top:THUMBNAIL_SCROLL_MARGIN})}}document.getElementById("previous").disabled=1>=
|
||||
a;document.getElementById("next").disabled=a>=PDFView.pages.length},!0);window.addEventListener("DOMMouseScroll",function(a){a.ctrlKey?(a.preventDefault(),a=a.detail,PDFView[0<a?"zoomOut":"zoomIn"](Math.abs(a))):PresentationMode.active&&PDFView.mouseScroll(-40*a.detail)},!1);window.addEventListener("click",function(a){PresentationMode.active?0===a.button&&a.preventDefault():SecondaryToolbar.opened&&PDFView.container.contains(a.target)&&SecondaryToolbar.close()},!1);
|
||||
window.addEventListener("keydown",function(a){if(!PasswordPrompt.visible){var b=!1,c=(a.ctrlKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.metaKey?8:0);if(1===c||8===c||5===c||12===c)switch(a.keyCode){case 70:PDFView.supportsIntegratedFind||(PDFFindBar.open(),b=!0);break;case 71:PDFView.supportsIntegratedFind||(PDFFindBar.dispatchEvent("again",5===c||12===c),b=!0);break;case 61:case 107:case 187:case 171:PDFView.zoomIn();b=!0;break;case 173:case 109:case 189:PDFView.zoomOut();b=!0;break;case 48:case 96:setTimeout(function(){PDFView.setScale(DEFAULT_SCALE,
|
||||
!0)}),b=!1}if(3===c||10===c)switch(a.keyCode){case 80:SecondaryToolbar.presentationModeClick();b=!0;break;case 71:document.getElementById("pageNumber").select(),b=!0}if(b)a.preventDefault();else{var d=document.activeElement||document.querySelector(":focus");if(!d||"INPUT"!==d.tagName.toUpperCase()&&"TEXTAREA"!==d.tagName.toUpperCase()&&"SELECT"!==d.tagName.toUpperCase()||27===a.keyCode){for(var e=document.getElementById("toolbar");d;){if(d===e&&!PresentationMode.active)return;d=d.parentNode}if(0===
|
||||
c)switch(a.keyCode){case 38:case 33:case 8:if(!PresentationMode.active&&"page-fit"!==PDFView.currentScaleValue)break;case 37:if(PDFView.isHorizontalScrollbarEnabled)break;case 75:case 80:PDFView.page--;b=!0;break;case 27:SecondaryToolbar.opened&&(SecondaryToolbar.close(),b=!0);!PDFView.supportsIntegratedFind&&PDFFindBar.opened&&(PDFFindBar.close(),b=!0);break;case 40:case 34:case 32:if(!PresentationMode.active&&"page-fit"!==PDFView.currentScaleValue)break;case 39:if(PDFView.isHorizontalScrollbarEnabled)break;
|
||||
case 74:case 78:PDFView.page++;b=!0;break;case 36:PresentationMode.active&&(PDFView.page=1,b=!0);break;case 35:PresentationMode.active&&(PDFView.page=PDFView.pdfDocument.numPages,b=!0);break;case 72:PresentationMode.active||HandTool.toggle();break;case 82:PDFView.rotatePages(90)}if(4===c)switch(a.keyCode){case 32:if(!PresentationMode.active&&"page-fit"!==PDFView.currentScaleValue)break;PDFView.page--;b=!0;break;case 82:PDFView.rotatePages(-90)}if(2===c)switch(a.keyCode){case 37:PresentationMode.active&&
|
||||
(PDFHistory.back(),b=!0);break;case 39:PresentationMode.active&&(PDFHistory.forward(),b=!0)}b&&(a.preventDefault(),PDFView.clearMouseScrollState())}}}});window.addEventListener("beforeprint",function(a){PDFView.beforePrint()});window.addEventListener("afterprint",function(a){PDFView.afterPrint()});
|
||||
(function(){var a=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){a()};PDFView.animationStartedPromise=new Promise(function(b){a(function(){b()})})})();
|