mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 16:55:40 +00:00
Bug 1662118 - Update pdf.js to version 2.6.336. r=bdahl
Differential Revision: https://phabricator.services.mozilla.com/D88856
This commit is contained in:
parent
2107e42238
commit
d912656d9c
@ -137,17 +137,20 @@ print_progress_close=Cancel
|
||||
# (the _label strings are alt text for the buttons, the .title strings are
|
||||
# tooltips)
|
||||
toggle_sidebar.title=Toggle Sidebar
|
||||
toggle_sidebar_notification.title=Toggle Sidebar (document contains outline/attachments)
|
||||
toggle_sidebar_notification2.title=Toggle Sidebar (document contains outline/attachments/layers)
|
||||
toggle_sidebar_label=Toggle Sidebar
|
||||
document_outline.title=Show Document Outline (double-click to expand/collapse all items)
|
||||
document_outline_label=Document Outline
|
||||
attachments.title=Show Attachments
|
||||
attachments_label=Attachments
|
||||
layers.title=Show Layers (double-click to reset all layers to the default state)
|
||||
layers_label=Layers
|
||||
thumbs.title=Show Thumbnails
|
||||
thumbs_label=Thumbnails
|
||||
findbar.title=Find in Document
|
||||
findbar_label=Find
|
||||
|
||||
additional_layers=Additional Layers
|
||||
# LOCALIZATION NOTE (page_canvas): "{{page}}" will be replaced by the page number.
|
||||
page_canvas=Page {{page}}
|
||||
# Thumbnails panel item (tooltip and alt text for images)
|
||||
|
@ -1,5 +1,5 @@
|
||||
This is the PDF.js project output, https://github.com/mozilla/pdf.js
|
||||
|
||||
Current extension version is: 2.6.324
|
||||
Current extension version is: 2.6.336
|
||||
|
||||
Taken from upstream commit: eb3654e2
|
||||
Taken from upstream commit: aa27e7fb
|
||||
|
@ -335,8 +335,8 @@ var _text_layer = __w_pdfjs_require__(20);
|
||||
|
||||
var _svg = __w_pdfjs_require__(21);
|
||||
|
||||
const pdfjsVersion = '2.6.324';
|
||||
const pdfjsBuild = 'eb3654e2';
|
||||
const pdfjsVersion = '2.6.336';
|
||||
const pdfjsBuild = 'aa27e7fb';
|
||||
;
|
||||
|
||||
/***/ }),
|
||||
@ -1912,7 +1912,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {
|
||||
|
||||
return worker.messageHandler.sendWithPromise("GetDocRequest", {
|
||||
docId,
|
||||
apiVersion: '2.6.324',
|
||||
apiVersion: '2.6.336',
|
||||
source: {
|
||||
data: source.data,
|
||||
url: source.url,
|
||||
@ -3837,9 +3837,9 @@ const InternalRenderTask = function InternalRenderTaskClosure() {
|
||||
return InternalRenderTask;
|
||||
}();
|
||||
|
||||
const version = '2.6.324';
|
||||
const version = '2.6.336';
|
||||
exports.version = version;
|
||||
const build = 'eb3654e2';
|
||||
const build = 'aa27e7fb';
|
||||
exports.build = build;
|
||||
|
||||
/***/ }),
|
||||
@ -8028,7 +8028,8 @@ class OptionalContentConfig {
|
||||
constructor(data) {
|
||||
this.name = null;
|
||||
this.creator = null;
|
||||
this.groups = new Map();
|
||||
this._order = null;
|
||||
this._groups = new Map();
|
||||
|
||||
if (data === null) {
|
||||
return;
|
||||
@ -8036,34 +8037,35 @@ class OptionalContentConfig {
|
||||
|
||||
this.name = data.name;
|
||||
this.creator = data.creator;
|
||||
this._order = data.order;
|
||||
|
||||
for (const group of data.groups) {
|
||||
this.groups.set(group.id, new OptionalContentGroup(group.name, group.intent));
|
||||
this._groups.set(group.id, new OptionalContentGroup(group.name, group.intent));
|
||||
}
|
||||
|
||||
if (data.baseState === "OFF") {
|
||||
for (const group of this.groups) {
|
||||
for (const group of this._groups) {
|
||||
group.visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
for (const on of data.on) {
|
||||
this.groups.get(on).visible = true;
|
||||
this._groups.get(on).visible = true;
|
||||
}
|
||||
|
||||
for (const off of data.off) {
|
||||
this.groups.get(off).visible = false;
|
||||
this._groups.get(off).visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
isVisible(group) {
|
||||
if (group.type === "OCG") {
|
||||
if (!this.groups.has(group.id)) {
|
||||
if (!this._groups.has(group.id)) {
|
||||
(0, _util.warn)(`Optional content group not found: ${group.id}`);
|
||||
return true;
|
||||
}
|
||||
|
||||
return this.groups.get(group.id).visible;
|
||||
return this._groups.get(group.id).visible;
|
||||
} else if (group.type === "OCMD") {
|
||||
if (group.expression) {
|
||||
(0, _util.warn)("Visibility expression not supported yet.");
|
||||
@ -8071,12 +8073,12 @@ class OptionalContentConfig {
|
||||
|
||||
if (!group.policy || group.policy === "AnyOn") {
|
||||
for (const id of group.ids) {
|
||||
if (!this.groups.has(id)) {
|
||||
if (!this._groups.has(id)) {
|
||||
(0, _util.warn)(`Optional content group not found: ${id}`);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (this.groups.get(id).visible) {
|
||||
if (this._groups.get(id).visible) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -8084,12 +8086,12 @@ class OptionalContentConfig {
|
||||
return false;
|
||||
} else if (group.policy === "AllOn") {
|
||||
for (const id of group.ids) {
|
||||
if (!this.groups.has(id)) {
|
||||
if (!this._groups.has(id)) {
|
||||
(0, _util.warn)(`Optional content group not found: ${id}`);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!this.groups.get(id).visible) {
|
||||
if (!this._groups.get(id).visible) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -8097,12 +8099,12 @@ class OptionalContentConfig {
|
||||
return true;
|
||||
} else if (group.policy === "AnyOff") {
|
||||
for (const id of group.ids) {
|
||||
if (!this.groups.has(id)) {
|
||||
if (!this._groups.has(id)) {
|
||||
(0, _util.warn)(`Optional content group not found: ${id}`);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!this.groups.get(id).visible) {
|
||||
if (!this._groups.get(id).visible) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -8110,12 +8112,12 @@ class OptionalContentConfig {
|
||||
return false;
|
||||
} else if (group.policy === "AllOff") {
|
||||
for (const id of group.ids) {
|
||||
if (!this.groups.has(id)) {
|
||||
if (!this._groups.has(id)) {
|
||||
(0, _util.warn)(`Optional content group not found: ${id}`);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (this.groups.get(id).visible) {
|
||||
if (this._groups.get(id).visible) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -8131,6 +8133,39 @@ class OptionalContentConfig {
|
||||
return true;
|
||||
}
|
||||
|
||||
setVisibility(id, visible = true) {
|
||||
if (!this._groups.has(id)) {
|
||||
(0, _util.warn)(`Optional content group not found: ${id}`);
|
||||
return;
|
||||
}
|
||||
|
||||
this._groups.get(id).visible = !!visible;
|
||||
}
|
||||
|
||||
getOrder() {
|
||||
if (!this._groups.size) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (this._order) {
|
||||
return this._order.slice();
|
||||
}
|
||||
|
||||
return Array.from(this._groups.keys());
|
||||
}
|
||||
|
||||
getGroups() {
|
||||
if (!this._groups.size) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return Object.fromEntries(this._groups);
|
||||
}
|
||||
|
||||
getGroup(id) {
|
||||
return this._groups.get(id) || null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.OptionalContentConfig = OptionalContentConfig;
|
||||
|
131
toolkit/components/pdfjs/content/build/pdf.worker.js
vendored
131
toolkit/components/pdfjs/content/build/pdf.worker.js
vendored
@ -135,8 +135,8 @@ Object.defineProperty(exports, "WorkerMessageHandler", {
|
||||
|
||||
var _worker = __w_pdfjs_require__(1);
|
||||
|
||||
const pdfjsVersion = '2.6.324';
|
||||
const pdfjsBuild = 'eb3654e2';
|
||||
const pdfjsVersion = '2.6.336';
|
||||
const pdfjsBuild = 'aa27e7fb';
|
||||
|
||||
/***/ }),
|
||||
/* 1 */
|
||||
@ -231,7 +231,7 @@ class WorkerMessageHandler {
|
||||
var WorkerTasks = [];
|
||||
const verbosity = (0, _util.getVerbosityLevel)();
|
||||
const apiVersion = docParams.apiVersion;
|
||||
const workerVersion = '2.6.324';
|
||||
const workerVersion = '2.6.336';
|
||||
|
||||
if (apiVersion !== workerVersion) {
|
||||
throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`);
|
||||
@ -4046,12 +4046,92 @@ class Catalog {
|
||||
return onParsed;
|
||||
}
|
||||
|
||||
function parseOrder(refs, nestedLevels = 0) {
|
||||
if (!Array.isArray(refs)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const order = [];
|
||||
|
||||
for (const value of refs) {
|
||||
if ((0, _primitives.isRef)(value) && contentGroupRefs.includes(value)) {
|
||||
parsedOrderRefs.put(value);
|
||||
order.push(value.toString());
|
||||
continue;
|
||||
}
|
||||
|
||||
const nestedOrder = parseNestedOrder(value, nestedLevels);
|
||||
|
||||
if (nestedOrder) {
|
||||
order.push(nestedOrder);
|
||||
}
|
||||
}
|
||||
|
||||
if (nestedLevels > 0) {
|
||||
return order;
|
||||
}
|
||||
|
||||
const hiddenGroups = [];
|
||||
|
||||
for (const groupRef of contentGroupRefs) {
|
||||
if (parsedOrderRefs.has(groupRef)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
hiddenGroups.push(groupRef.toString());
|
||||
}
|
||||
|
||||
if (hiddenGroups.length) {
|
||||
order.push({
|
||||
name: null,
|
||||
order: hiddenGroups
|
||||
});
|
||||
}
|
||||
|
||||
return order;
|
||||
}
|
||||
|
||||
function parseNestedOrder(ref, nestedLevels) {
|
||||
if (++nestedLevels > MAX_NESTED_LEVELS) {
|
||||
(0, _util.warn)("parseNestedOrder - reached MAX_NESTED_LEVELS.");
|
||||
return null;
|
||||
}
|
||||
|
||||
const value = xref.fetchIfRef(ref);
|
||||
|
||||
if (!Array.isArray(value)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const nestedName = xref.fetchIfRef(value[0]);
|
||||
|
||||
if (typeof nestedName !== "string") {
|
||||
return null;
|
||||
}
|
||||
|
||||
const nestedOrder = parseOrder(value.slice(1), nestedLevels);
|
||||
|
||||
if (!nestedOrder || !nestedOrder.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return {
|
||||
name: (0, _util.stringToPDFString)(nestedName),
|
||||
order: nestedOrder
|
||||
};
|
||||
}
|
||||
|
||||
const xref = this.xref,
|
||||
parsedOrderRefs = new _primitives.RefSet(),
|
||||
MAX_NESTED_LEVELS = 10;
|
||||
return {
|
||||
name: (0, _util.isString)(config.get("Name")) ? (0, _util.stringToPDFString)(config.get("Name")) : null,
|
||||
creator: (0, _util.isString)(config.get("Creator")) ? (0, _util.stringToPDFString)(config.get("Creator")) : null,
|
||||
baseState: (0, _primitives.isName)(config.get("BaseState")) ? config.get("BaseState").name : null,
|
||||
on: parseOnOff(config.get("ON")),
|
||||
off: parseOnOff(config.get("OFF"))
|
||||
off: parseOnOff(config.get("OFF")),
|
||||
order: parseOrder(config.get("Order")),
|
||||
groups: null
|
||||
};
|
||||
}
|
||||
|
||||
@ -27312,7 +27392,7 @@ var Font = function FontClosure() {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (platformId === 0 && encodingId === 0) {
|
||||
if (platformId === 0 && (encodingId === 0 || encodingId === 1 || encodingId === 3)) {
|
||||
useTable = true;
|
||||
} else if (platformId === 1 && encodingId === 0) {
|
||||
useTable = true;
|
||||
@ -28392,14 +28472,13 @@ var Font = function FontClosure() {
|
||||
var cmapEncodingId = cmapTable.encodingId;
|
||||
var cmapMappings = cmapTable.mappings;
|
||||
var cmapMappingsLength = cmapMappings.length;
|
||||
let baseEncoding = [];
|
||||
|
||||
if (properties.hasEncoding && (cmapPlatformId === 3 && cmapEncodingId === 1 || cmapPlatformId === 1 && cmapEncodingId === 0) || cmapPlatformId === -1 && cmapEncodingId === -1 && !!(0, _encodings.getEncoding)(properties.baseEncodingName)) {
|
||||
var baseEncoding = [];
|
||||
|
||||
if (properties.baseEncodingName === "MacRomanEncoding" || properties.baseEncodingName === "WinAnsiEncoding") {
|
||||
baseEncoding = (0, _encodings.getEncoding)(properties.baseEncodingName);
|
||||
}
|
||||
if (properties.hasEncoding && (properties.baseEncodingName === "MacRomanEncoding" || properties.baseEncodingName === "WinAnsiEncoding")) {
|
||||
baseEncoding = (0, _encodings.getEncoding)(properties.baseEncodingName);
|
||||
}
|
||||
|
||||
if (properties.hasEncoding && !this.isSymbolicFont && (cmapPlatformId === 3 && cmapEncodingId === 1 || cmapPlatformId === 1 && cmapEncodingId === 0)) {
|
||||
var glyphsUnicodeMap = (0, _glyphlist.getGlyphsUnicode)();
|
||||
|
||||
for (let charCode = 0; charCode < 256; charCode++) {
|
||||
@ -28426,31 +28505,16 @@ var Font = function FontClosure() {
|
||||
unicodeOrCharCode = _encodings.MacRomanEncoding.indexOf(standardGlyphName);
|
||||
}
|
||||
|
||||
var found = false;
|
||||
|
||||
for (let i = 0; i < cmapMappingsLength; ++i) {
|
||||
if (cmapMappings[i].charCode !== unicodeOrCharCode) {
|
||||
continue;
|
||||
}
|
||||
|
||||
charCodeToGlyphId[charCode] = cmapMappings[i].glyphId;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!found && properties.glyphNames) {
|
||||
var glyphId = properties.glyphNames.indexOf(glyphName);
|
||||
|
||||
if (glyphId === -1 && standardGlyphName !== glyphName) {
|
||||
glyphId = properties.glyphNames.indexOf(standardGlyphName);
|
||||
}
|
||||
|
||||
if (glyphId > 0 && hasGlyph(glyphId)) {
|
||||
charCodeToGlyphId[charCode] = glyphId;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (cmapPlatformId === 0 && cmapEncodingId === 0) {
|
||||
} else if (cmapPlatformId === 0) {
|
||||
for (let i = 0; i < cmapMappingsLength; ++i) {
|
||||
charCodeToGlyphId[cmapMappings[i].charCode] = cmapMappings[i].glyphId;
|
||||
}
|
||||
@ -28465,6 +28529,19 @@ var Font = function FontClosure() {
|
||||
charCodeToGlyphId[charCode] = cmapMappings[i].glyphId;
|
||||
}
|
||||
}
|
||||
|
||||
if (properties.glyphNames && baseEncoding.length) {
|
||||
for (let i = 0; i < 256; ++i) {
|
||||
if (charCodeToGlyphId[i] === undefined && baseEncoding[i]) {
|
||||
glyphName = baseEncoding[i];
|
||||
const glyphId = properties.glyphNames.indexOf(glyphName);
|
||||
|
||||
if (glyphId > 0 && hasGlyph(glyphId)) {
|
||||
charCodeToGlyphId[i] = glyphId;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (charCodeToGlyphId.length === 0) {
|
||||
|
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4.233 4.233" height="16" width="16" fill="rgba(255,255,255,1)"><path d="M.15 2.992c-.198.1-.2.266-.002.365l1.604.802a.93.93 0 00.729-.001l1.602-.801c.198-.1.197-.264 0-.364l-.695-.348c-1.306.595-2.542 0-2.542 0m-.264.53l.658-.329c.6.252 1.238.244 1.754 0l.659.329-1.536.768zM.15 1.935c-.198.1-.198.265 0 .364l1.604.802a.926.926 0 00.727 0l1.603-.802c.198-.099.198-.264 0-.363l-.694-.35c-1.14.56-2.546.001-2.546.001m-.264.53l.664-.332c.52.266 1.261.235 1.75.002l.659.33-1.537.768zM.15.877c-.198.099-.198.264 0 .363l1.604.802a.926.926 0 00.727 0l1.603-.802c.198-.099.198-.264 0-.363L2.481.075a.926.926 0 00-.727 0zm.43.182L2.117.29l1.538.769-1.538.768z"/></svg>
|
After Width: | Height: | Size: 712 B |
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4.233 4.233" height="16" width="16"><path d="M.15 2.992c-.198.1-.2.266-.002.365l1.604.802a.93.93 0 00.729-.001l1.602-.801c.198-.1.197-.264 0-.364l-.695-.348c-1.306.595-2.542 0-2.542 0m-.264.53l.658-.329c.6.252 1.238.244 1.754 0l.659.329-1.536.768zM.15 1.935c-.198.1-.198.265 0 .364l1.604.802a.926.926 0 00.727 0l1.603-.802c.198-.099.198-.264 0-.363l-.694-.35c-1.14.56-2.546.001-2.546.001m-.264.53l.664-.332c.52.266 1.261.235 1.75.002l.659.33-1.537.768zM.15.877c-.198.099-.198.264 0 .363l1.604.802a.926.926 0 00.727 0l1.603-.802c.198-.099.198-.264 0-.363L2.481.075a.926.926 0 00-.727 0zm.43.182L2.117.29l1.538.769-1.538.768z"/></svg>
|
After Width: | Height: | Size: 685 B |
@ -391,6 +391,8 @@
|
||||
--body-bg-color: rgba(237, 237, 240, 1);
|
||||
--errorWrapper-bg-color: rgba(255, 74, 74, 1);
|
||||
--progressBar-color: rgba(10, 132, 255, 1);
|
||||
--progressBar-indeterminate-bg-color: rgba(221, 221, 222, 1);
|
||||
--progressBar-indeterminate-blend-color: rgba(116, 177, 239, 1);
|
||||
--scrollbar-color: auto;
|
||||
--scrollbar-bg-color: auto;
|
||||
|
||||
@ -435,6 +437,7 @@
|
||||
--toolbarButton-viewThumbnail-icon: url(images/toolbarButton-viewThumbnail.svg);
|
||||
--toolbarButton-viewOutline-icon: url(images/toolbarButton-viewOutline.svg);
|
||||
--toolbarButton-viewAttachments-icon: url(images/toolbarButton-viewAttachments.svg);
|
||||
--toolbarButton-viewLayers-icon: url(images/toolbarButton-viewLayers.svg);
|
||||
--toolbarButton-search-icon: url(images/toolbarButton-search.svg);
|
||||
--findbarButton-previous-icon: url(images/findbarButton-previous.svg);
|
||||
--findbarButton-next-icon: url(images/findbarButton-next.svg);
|
||||
@ -459,6 +462,8 @@
|
||||
--body-bg-color: rgba(42, 42, 46, 1);
|
||||
--errorWrapper-bg-color: rgba(199, 17, 17, 1);
|
||||
--progressBar-color: rgba(0, 96, 223, 1);
|
||||
--progressBar-indeterminate-bg-color: rgba(40, 40, 43, 1);
|
||||
--progressBar-indeterminate-blend-color: rgba(20, 68, 133, 1);
|
||||
--scrollbar-color: rgba(121, 121, 123, 1);
|
||||
--scrollbar-bg-color: rgba(35, 35, 39, 1);
|
||||
|
||||
@ -503,6 +508,7 @@
|
||||
--toolbarButton-viewThumbnail-icon: url(images/toolbarButton-viewThumbnail-dark.svg);
|
||||
--toolbarButton-viewOutline-icon: url(images/toolbarButton-viewOutline-dark.svg);
|
||||
--toolbarButton-viewAttachments-icon: url(images/toolbarButton-viewAttachments-dark.svg);
|
||||
--toolbarButton-viewLayers-icon: url(images/toolbarButton-viewLayers-dark.svg);
|
||||
--toolbarButton-search-icon: url(images/toolbarButton-search-dark.svg);
|
||||
--findbarButton-previous-icon: url(images/findbarButton-previous-dark.svg);
|
||||
--findbarButton-next-icon: url(images/findbarButton-next-dark.svg);
|
||||
@ -758,7 +764,7 @@ html[dir='rtl'] #toolbarContainer, .findbar, .secondaryToolbar {
|
||||
width: 100%;
|
||||
height: 4px;
|
||||
background-color: var(--body-bg-color);
|
||||
border-top: 1px solid var(--toolbar-border-color);
|
||||
border-bottom: 1px solid var(--toolbar-border-color);
|
||||
}
|
||||
|
||||
#loadingBar .progress {
|
||||
@ -778,7 +784,7 @@ html[dir='rtl'] #toolbarContainer, .findbar, .secondaryToolbar {
|
||||
}
|
||||
|
||||
#loadingBar .progress.indeterminate {
|
||||
background-color: var(--progressBar-color);
|
||||
background-color: var(--progressBar-indeterminate-bg-color);
|
||||
transition: none;
|
||||
}
|
||||
|
||||
@ -789,10 +795,10 @@ html[dir='rtl'] #toolbarContainer, .findbar, .secondaryToolbar {
|
||||
height: 100%;
|
||||
width: calc(100% + 150px);
|
||||
background: repeating-linear-gradient(135deg,
|
||||
rgba(187, 187, 187, 1) 0, rgba(153, 153, 153, 1) 5px,
|
||||
rgba(153, 153, 153, 1) 45px, rgba(221, 221, 221, 1) 55px,
|
||||
rgba(221, 221, 221, 1) 95px, rgba(187, 187, 187, 1) 100px);
|
||||
animation: progressIndeterminate 950ms linear infinite;
|
||||
var(--progressBar-indeterminate-blend-color) 0, var(--progressBar-indeterminate-bg-color) 5px,
|
||||
var(--progressBar-indeterminate-bg-color) 45px, var(--progressBar-color) 55px,
|
||||
var(--progressBar-color) 95px, var(--progressBar-indeterminate-blend-color) 100px);
|
||||
animation: progressIndeterminate 1s linear infinite;
|
||||
}
|
||||
|
||||
.findbar, .secondaryToolbar {
|
||||
@ -824,10 +830,10 @@ html[dir='rtl'] #toolbarContainer, .findbar, .secondaryToolbar {
|
||||
height: auto;
|
||||
}
|
||||
html[dir='ltr'] .findbar {
|
||||
left: 63px;
|
||||
left: 64px;
|
||||
}
|
||||
html[dir='rtl'] .findbar {
|
||||
right: 63px;
|
||||
right: 64px;
|
||||
}
|
||||
|
||||
html[dir='ltr'] .findbar .splitToolbarButton {
|
||||
@ -884,11 +890,15 @@ html[dir='rtl'] .findbar .splitToolbarButton > .findNext {
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
|
||||
.findbar input[type="checkbox"] {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.findbar label {
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.findbar .toolbarLabel:hover, .findbar label:hover,
|
||||
.findbar label:hover,
|
||||
.findbar input:focus + label {
|
||||
background-color: var(--button-hover-color);
|
||||
}
|
||||
@ -929,10 +939,10 @@ html[dir='rtl'] #findInput[data-status="pending"] {
|
||||
background-color: var(--doorhanger-bg-color);
|
||||
}
|
||||
html[dir='ltr'] .secondaryToolbar {
|
||||
right: 3px;
|
||||
right: 4px;
|
||||
}
|
||||
html[dir='rtl'] .secondaryToolbar {
|
||||
left: 3px;
|
||||
left: 4px;
|
||||
}
|
||||
|
||||
#secondaryToolbarButtonContainer {
|
||||
@ -1407,6 +1417,10 @@ html[dir="rtl"] #viewOutline.toolbarButton::before {
|
||||
content: var(--toolbarButton-viewAttachments-icon);
|
||||
}
|
||||
|
||||
#viewLayers.toolbarButton::before {
|
||||
content: var(--toolbarButton-viewLayers-icon);
|
||||
}
|
||||
|
||||
#viewFind.toolbarButton::before {
|
||||
content: var(--toolbarButton-search-icon);
|
||||
}
|
||||
@ -1673,7 +1687,8 @@ a:focus > .thumbnail > .thumbnailSelectionRing,
|
||||
}
|
||||
|
||||
#outlineView,
|
||||
#attachmentsView {
|
||||
#attachmentsView,
|
||||
#layersView {
|
||||
position: absolute;
|
||||
width: calc(100% - 8px);
|
||||
top: 0;
|
||||
@ -1716,6 +1731,16 @@ html[dir='rtl'] .treeItem > a {
|
||||
padding: 2px 4px 5px 0;
|
||||
}
|
||||
|
||||
#layersView .treeItem > a > * {
|
||||
cursor: pointer;
|
||||
}
|
||||
html[dir='ltr'] #layersView .treeItem > a > label {
|
||||
padding-left: 4px;
|
||||
}
|
||||
html[dir='rtl'] #layersView .treesItem > a > label {
|
||||
padding-right: 4px;
|
||||
}
|
||||
|
||||
.treeItemToggler {
|
||||
position: relative;
|
||||
height: 0;
|
||||
@ -2162,10 +2187,10 @@ html[dir='rtl'] #documentPropertiesOverlay .row > * {
|
||||
width: 0;
|
||||
}
|
||||
html[dir='ltr'] .findbar {
|
||||
left: 38px;
|
||||
left: 34px;
|
||||
}
|
||||
html[dir='rtl'] .findbar {
|
||||
right: 38px;
|
||||
right: 34px;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -54,6 +54,9 @@ See https://github.com/adobe-type-tools/cmap-resources
|
||||
<button id="viewAttachments" class="toolbarButton" title="Show Attachments" tabindex="4" data-l10n-id="attachments">
|
||||
<span data-l10n-id="attachments_label">Attachments</span>
|
||||
</button>
|
||||
<button id="viewLayers" class="toolbarButton" title="Show Layers (double-click to reset all layers to the default state)" tabindex="5" data-l10n-id="layers">
|
||||
<span data-l10n-id="layers_label">Layers</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="sidebarContent">
|
||||
@ -63,6 +66,8 @@ See https://github.com/adobe-type-tools/cmap-resources
|
||||
</div>
|
||||
<div id="attachmentsView" class="hidden">
|
||||
</div>
|
||||
<div id="layersView" class="hidden">
|
||||
</div>
|
||||
</div>
|
||||
<div id="sidebarResizer" class="hidden"></div>
|
||||
</div> <!-- sidebarContainer -->
|
||||
|
@ -120,9 +120,9 @@ let pdfjsWebApp, pdfjsWebAppOptions;
|
||||
pdfjsWebAppOptions = __webpack_require__(3);
|
||||
}
|
||||
{
|
||||
__webpack_require__(34);
|
||||
__webpack_require__(35);
|
||||
|
||||
__webpack_require__(37);
|
||||
__webpack_require__(38);
|
||||
}
|
||||
;
|
||||
;
|
||||
@ -188,9 +188,11 @@ function getViewerConfiguration() {
|
||||
thumbnailButton: document.getElementById("viewThumbnail"),
|
||||
outlineButton: document.getElementById("viewOutline"),
|
||||
attachmentsButton: document.getElementById("viewAttachments"),
|
||||
layersButton: document.getElementById("viewLayers"),
|
||||
thumbnailView: document.getElementById("thumbnailView"),
|
||||
outlineView: document.getElementById("outlineView"),
|
||||
attachmentsView: document.getElementById("attachmentsView")
|
||||
attachmentsView: document.getElementById("attachmentsView"),
|
||||
layersView: document.getElementById("layersView")
|
||||
},
|
||||
sidebarResizer: {
|
||||
outerContainer: document.getElementById("outerContainer"),
|
||||
@ -302,25 +304,27 @@ var _pdf_find_controller = __webpack_require__(16);
|
||||
|
||||
var _pdf_history = __webpack_require__(18);
|
||||
|
||||
var _pdf_link_service = __webpack_require__(19);
|
||||
var _pdf_layer_viewer = __webpack_require__(19);
|
||||
|
||||
var _pdf_outline_viewer = __webpack_require__(20);
|
||||
var _pdf_link_service = __webpack_require__(20);
|
||||
|
||||
var _pdf_presentation_mode = __webpack_require__(21);
|
||||
var _pdf_outline_viewer = __webpack_require__(21);
|
||||
|
||||
var _pdf_sidebar_resizer = __webpack_require__(22);
|
||||
var _pdf_presentation_mode = __webpack_require__(22);
|
||||
|
||||
var _pdf_thumbnail_viewer = __webpack_require__(23);
|
||||
var _pdf_sidebar_resizer = __webpack_require__(23);
|
||||
|
||||
var _pdf_viewer = __webpack_require__(25);
|
||||
var _pdf_thumbnail_viewer = __webpack_require__(24);
|
||||
|
||||
var _secondary_toolbar = __webpack_require__(30);
|
||||
var _pdf_viewer = __webpack_require__(26);
|
||||
|
||||
var _toolbar = __webpack_require__(32);
|
||||
var _secondary_toolbar = __webpack_require__(31);
|
||||
|
||||
var _toolbar = __webpack_require__(33);
|
||||
|
||||
var _viewer_compatibility = __webpack_require__(4);
|
||||
|
||||
var _view_history = __webpack_require__(33);
|
||||
var _view_history = __webpack_require__(34);
|
||||
|
||||
const DEFAULT_SCALE_DELTA = 1.1;
|
||||
const DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT = 5000;
|
||||
@ -403,6 +407,7 @@ const PDFViewerApplication = {
|
||||
pdfSidebarResizer: null,
|
||||
pdfOutlineViewer: null,
|
||||
pdfAttachmentViewer: null,
|
||||
pdfLayerViewer: null,
|
||||
pdfCursorTools: null,
|
||||
store: null,
|
||||
downloadManager: null,
|
||||
@ -590,6 +595,7 @@ const PDFViewerApplication = {
|
||||
pdfLinkService.setViewer(this.pdfViewer);
|
||||
this.pdfThumbnailViewer = new _pdf_thumbnail_viewer.PDFThumbnailViewer({
|
||||
container: appConfig.sidebar.thumbnailView,
|
||||
eventBus,
|
||||
renderingQueue: pdfRenderingQueue,
|
||||
linkService: pdfLinkService,
|
||||
l10n: this.l10n
|
||||
@ -634,6 +640,11 @@ const PDFViewerApplication = {
|
||||
eventBus,
|
||||
downloadManager
|
||||
});
|
||||
this.pdfLayerViewer = new _pdf_layer_viewer.PDFLayerViewer({
|
||||
container: appConfig.sidebar.layersView,
|
||||
eventBus,
|
||||
l10n: this.l10n
|
||||
});
|
||||
this.pdfSidebar = new _pdf_sidebar.PDFSidebar({
|
||||
elements: appConfig.sidebar,
|
||||
pdfViewer: this.pdfViewer,
|
||||
@ -841,6 +852,7 @@ const PDFViewerApplication = {
|
||||
this.pdfSidebar.reset();
|
||||
this.pdfOutlineViewer.reset();
|
||||
this.pdfAttachmentViewer.reset();
|
||||
this.pdfLayerViewer.reset();
|
||||
|
||||
if (this.pdfHistory) {
|
||||
this.pdfHistory.reset();
|
||||
@ -1270,6 +1282,12 @@ const PDFViewerApplication = {
|
||||
attachments
|
||||
});
|
||||
});
|
||||
pdfViewer.optionalContentConfigPromise.then(optionalContentConfig => {
|
||||
this.pdfLayerViewer.render({
|
||||
optionalContentConfig,
|
||||
pdfDocument
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
this._initializePageLabels(pdfDocument);
|
||||
@ -1577,7 +1595,8 @@ const PDFViewerApplication = {
|
||||
|
||||
const printResolution = _app_options.AppOptions.get("printResolution");
|
||||
|
||||
const printService = PDFPrintServiceFactory.instance.createPrintService(this.pdfDocument, pagesOverview, printContainer, printResolution, this.l10n);
|
||||
const optionalContentConfigPromise = this.pdfViewer.optionalContentConfigPromise;
|
||||
const printService = PDFPrintServiceFactory.instance.createPrintService(this.pdfDocument, pagesOverview, printContainer, printResolution, optionalContentConfigPromise, this.l10n);
|
||||
this.printService = printService;
|
||||
this.forceRendering();
|
||||
printService.layout();
|
||||
@ -1680,6 +1699,8 @@ const PDFViewerApplication = {
|
||||
|
||||
eventBus._on("rotateccw", webViewerRotateCcw);
|
||||
|
||||
eventBus._on("optionalcontentconfig", webViewerOptionalContentConfig);
|
||||
|
||||
eventBus._on("switchscrollmode", webViewerSwitchScrollMode);
|
||||
|
||||
eventBus._on("scrollmodechanged", webViewerScrollModeChanged);
|
||||
@ -1808,6 +1829,8 @@ const PDFViewerApplication = {
|
||||
|
||||
eventBus._off("rotateccw", webViewerRotateCcw);
|
||||
|
||||
eventBus._off("optionalcontentconfig", webViewerOptionalContentConfig);
|
||||
|
||||
eventBus._off("switchscrollmode", webViewerSwitchScrollMode);
|
||||
|
||||
eventBus._off("scrollmodechanged", webViewerScrollModeChanged);
|
||||
@ -2013,6 +2036,10 @@ function webViewerPageMode({
|
||||
view = _pdf_sidebar.SidebarView.ATTACHMENTS;
|
||||
break;
|
||||
|
||||
case "layers":
|
||||
view = _pdf_sidebar.SidebarView.LAYERS;
|
||||
break;
|
||||
|
||||
case "none":
|
||||
view = _pdf_sidebar.SidebarView.NONE;
|
||||
break;
|
||||
@ -2224,6 +2251,10 @@ function webViewerRotateCcw() {
|
||||
PDFViewerApplication.rotatePages(-90);
|
||||
}
|
||||
|
||||
function webViewerOptionalContentConfig(evt) {
|
||||
PDFViewerApplication.pdfViewer.optionalContentConfigPromise = evt.promise;
|
||||
}
|
||||
|
||||
function webViewerSwitchScrollMode(evt) {
|
||||
PDFViewerApplication.pdfViewer.scrollMode = evt.mode;
|
||||
}
|
||||
@ -2739,6 +2770,7 @@ function apiPageModeToSidebarView(mode) {
|
||||
return _pdf_sidebar.SidebarView.ATTACHMENTS;
|
||||
|
||||
case "UseOC":
|
||||
return _pdf_sidebar.SidebarView.LAYERS;
|
||||
}
|
||||
|
||||
return _pdf_sidebar.SidebarView.NONE;
|
||||
@ -4278,9 +4310,11 @@ class PDFSidebar {
|
||||
this.thumbnailButton = elements.thumbnailButton;
|
||||
this.outlineButton = elements.outlineButton;
|
||||
this.attachmentsButton = elements.attachmentsButton;
|
||||
this.layersButton = elements.layersButton;
|
||||
this.thumbnailView = elements.thumbnailView;
|
||||
this.outlineView = elements.outlineView;
|
||||
this.attachmentsView = elements.attachmentsView;
|
||||
this.layersView = elements.layersView;
|
||||
this.eventBus = eventBus;
|
||||
this.l10n = l10n;
|
||||
this._disableNotification = disableNotification;
|
||||
@ -4296,6 +4330,7 @@ class PDFSidebar {
|
||||
this.switchView(SidebarView.THUMBS);
|
||||
this.outlineButton.disabled = false;
|
||||
this.attachmentsButton.disabled = false;
|
||||
this.layersButton.disabled = false;
|
||||
}
|
||||
|
||||
get visibleView() {
|
||||
@ -4314,6 +4349,10 @@ class PDFSidebar {
|
||||
return this.isOpen && this.active === SidebarView.ATTACHMENTS;
|
||||
}
|
||||
|
||||
get isLayersViewVisible() {
|
||||
return this.isOpen && this.active === SidebarView.LAYERS;
|
||||
}
|
||||
|
||||
setInitialView(view = SidebarView.NONE) {
|
||||
if (this.isInitialViewSet) {
|
||||
return;
|
||||
@ -4370,6 +4409,13 @@ class PDFSidebar {
|
||||
|
||||
break;
|
||||
|
||||
case SidebarView.LAYERS:
|
||||
if (this.layersButton.disabled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
console.error(`PDFSidebar._switchView: "${view}" is not a valid view.`);
|
||||
return false;
|
||||
@ -4379,9 +4425,11 @@ class PDFSidebar {
|
||||
this.thumbnailButton.classList.toggle("toggled", view === SidebarView.THUMBS);
|
||||
this.outlineButton.classList.toggle("toggled", view === SidebarView.OUTLINE);
|
||||
this.attachmentsButton.classList.toggle("toggled", view === SidebarView.ATTACHMENTS);
|
||||
this.layersButton.classList.toggle("toggled", view === SidebarView.LAYERS);
|
||||
this.thumbnailView.classList.toggle("hidden", view !== SidebarView.THUMBS);
|
||||
this.outlineView.classList.toggle("hidden", view !== SidebarView.OUTLINE);
|
||||
this.attachmentsView.classList.toggle("hidden", view !== SidebarView.ATTACHMENTS);
|
||||
this.layersView.classList.toggle("hidden", view !== SidebarView.LAYERS);
|
||||
|
||||
if (forceOpen && !this.isOpen) {
|
||||
this.open();
|
||||
@ -4486,7 +4534,7 @@ class PDFSidebar {
|
||||
return;
|
||||
}
|
||||
|
||||
this.l10n.get("toggle_sidebar_notification.title", null, "Toggle Sidebar (document contains outline/attachments)").then(msg => {
|
||||
this.l10n.get("toggle_sidebar_notification2.title", null, "Toggle Sidebar (document contains outline/attachments/layers)").then(msg => {
|
||||
this.toggleButton.title = msg;
|
||||
});
|
||||
|
||||
@ -4504,6 +4552,10 @@ class PDFSidebar {
|
||||
case SidebarView.ATTACHMENTS:
|
||||
this.attachmentsButton.classList.add(UI_NOTIFICATION_CLASS);
|
||||
break;
|
||||
|
||||
case SidebarView.LAYERS:
|
||||
this.layersButton.classList.add(UI_NOTIFICATION_CLASS);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -4521,6 +4573,10 @@ class PDFSidebar {
|
||||
case SidebarView.ATTACHMENTS:
|
||||
this.attachmentsButton.classList.remove(UI_NOTIFICATION_CLASS);
|
||||
break;
|
||||
|
||||
case SidebarView.LAYERS:
|
||||
this.layersButton.classList.remove(UI_NOTIFICATION_CLASS);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
@ -4567,6 +4623,14 @@ class PDFSidebar {
|
||||
this.attachmentsButton.addEventListener("click", () => {
|
||||
this.switchView(SidebarView.ATTACHMENTS);
|
||||
});
|
||||
this.layersButton.addEventListener("click", () => {
|
||||
this.switchView(SidebarView.LAYERS);
|
||||
});
|
||||
this.layersButton.addEventListener("dblclick", () => {
|
||||
this.eventBus.dispatch("resetlayers", {
|
||||
source: this
|
||||
});
|
||||
});
|
||||
|
||||
const onTreeLoaded = (count, button, view) => {
|
||||
button.disabled = !count;
|
||||
@ -4586,6 +4650,10 @@ class PDFSidebar {
|
||||
onTreeLoaded(evt.attachmentsCount, this.attachmentsButton, SidebarView.ATTACHMENTS);
|
||||
});
|
||||
|
||||
this.eventBus._on("layersloaded", evt => {
|
||||
onTreeLoaded(evt.layersCount, this.layersButton, SidebarView.LAYERS);
|
||||
});
|
||||
|
||||
this.eventBus._on("presentationmodechanged", evt => {
|
||||
if (!evt.active && !evt.switchInProgress && this.isThumbnailViewVisible) {
|
||||
this._updateThumbnailViewer();
|
||||
@ -6942,6 +7010,199 @@ function isDestArraysEqual(firstDest, secondDest) {
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.PDFLayerViewer = void 0;
|
||||
|
||||
var _base_tree_viewer = __webpack_require__(13);
|
||||
|
||||
class PDFLayerViewer extends _base_tree_viewer.BaseTreeViewer {
|
||||
constructor(options) {
|
||||
super(options);
|
||||
this.l10n = options.l10n;
|
||||
|
||||
this.eventBus._on("resetlayers", this._resetLayers.bind(this));
|
||||
|
||||
this.eventBus._on("togglelayerstree", this._toggleAllTreeItems.bind(this));
|
||||
}
|
||||
|
||||
reset() {
|
||||
super.reset();
|
||||
this._optionalContentConfig = null;
|
||||
this._pdfDocument = null;
|
||||
}
|
||||
|
||||
_dispatchEvent(layersCount) {
|
||||
this.eventBus.dispatch("layersloaded", {
|
||||
source: this,
|
||||
layersCount
|
||||
});
|
||||
}
|
||||
|
||||
_bindLink(element, {
|
||||
groupId,
|
||||
input
|
||||
}) {
|
||||
const setVisibility = () => {
|
||||
this._optionalContentConfig.setVisibility(groupId, input.checked);
|
||||
|
||||
this.eventBus.dispatch("optionalcontentconfig", {
|
||||
source: this,
|
||||
promise: Promise.resolve(this._optionalContentConfig)
|
||||
});
|
||||
};
|
||||
|
||||
element.onclick = evt => {
|
||||
if (evt.target === input) {
|
||||
setVisibility();
|
||||
return true;
|
||||
} else if (evt.target !== element) {
|
||||
return true;
|
||||
}
|
||||
|
||||
input.checked = !input.checked;
|
||||
setVisibility();
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
async _setNestedName(element, {
|
||||
name = null
|
||||
}) {
|
||||
if (typeof name === "string") {
|
||||
element.textContent = this._normalizeTextContent(name);
|
||||
return;
|
||||
}
|
||||
|
||||
element.textContent = await this.l10n.get("additional_layers", null, "Additional Layers");
|
||||
element.style.fontStyle = "italic";
|
||||
}
|
||||
|
||||
_addToggleButton(div, {
|
||||
name = null
|
||||
}) {
|
||||
super._addToggleButton(div, name === null);
|
||||
}
|
||||
|
||||
_toggleAllTreeItems() {
|
||||
if (!this._optionalContentConfig) {
|
||||
return;
|
||||
}
|
||||
|
||||
super._toggleAllTreeItems();
|
||||
}
|
||||
|
||||
render({
|
||||
optionalContentConfig,
|
||||
pdfDocument
|
||||
}) {
|
||||
if (this._optionalContentConfig) {
|
||||
this.reset();
|
||||
}
|
||||
|
||||
this._optionalContentConfig = optionalContentConfig || null;
|
||||
this._pdfDocument = pdfDocument || null;
|
||||
const groups = optionalContentConfig && optionalContentConfig.getOrder();
|
||||
|
||||
if (!groups) {
|
||||
this._dispatchEvent(0);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const fragment = document.createDocumentFragment(),
|
||||
queue = [{
|
||||
parent: fragment,
|
||||
groups
|
||||
}];
|
||||
let layersCount = 0,
|
||||
hasAnyNesting = false;
|
||||
|
||||
while (queue.length > 0) {
|
||||
const levelData = queue.shift();
|
||||
|
||||
for (const groupId of levelData.groups) {
|
||||
const div = document.createElement("div");
|
||||
div.className = "treeItem";
|
||||
const element = document.createElement("a");
|
||||
div.appendChild(element);
|
||||
|
||||
if (typeof groupId === "object") {
|
||||
hasAnyNesting = true;
|
||||
|
||||
this._addToggleButton(div, groupId);
|
||||
|
||||
this._setNestedName(element, groupId);
|
||||
|
||||
const itemsDiv = document.createElement("div");
|
||||
itemsDiv.className = "treeItems";
|
||||
div.appendChild(itemsDiv);
|
||||
queue.push({
|
||||
parent: itemsDiv,
|
||||
groups: groupId.order
|
||||
});
|
||||
} else {
|
||||
const group = optionalContentConfig.getGroup(groupId);
|
||||
const input = document.createElement("input");
|
||||
|
||||
this._bindLink(element, {
|
||||
groupId,
|
||||
input
|
||||
});
|
||||
|
||||
input.type = "checkbox";
|
||||
input.id = groupId;
|
||||
input.checked = group.visible;
|
||||
const label = document.createElement("label");
|
||||
label.setAttribute("for", groupId);
|
||||
label.textContent = this._normalizeTextContent(group.name);
|
||||
element.appendChild(input);
|
||||
element.appendChild(label);
|
||||
layersCount++;
|
||||
}
|
||||
|
||||
levelData.parent.appendChild(div);
|
||||
}
|
||||
}
|
||||
|
||||
if (hasAnyNesting) {
|
||||
this.container.classList.add("treeWithDeepNesting");
|
||||
this._lastToggleIsShow = fragment.querySelectorAll(".treeItemsHidden").length === 0;
|
||||
}
|
||||
|
||||
this.container.appendChild(fragment);
|
||||
|
||||
this._dispatchEvent(layersCount);
|
||||
}
|
||||
|
||||
async _resetLayers() {
|
||||
if (!this._optionalContentConfig) {
|
||||
return;
|
||||
}
|
||||
|
||||
const optionalContentConfig = await this._pdfDocument.getOptionalContentConfig();
|
||||
this.eventBus.dispatch("optionalcontentconfig", {
|
||||
source: this,
|
||||
promise: Promise.resolve(optionalContentConfig)
|
||||
});
|
||||
this.render({
|
||||
optionalContentConfig,
|
||||
pdfDocument: this._pdfDocument
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.PDFLayerViewer = PDFLayerViewer;
|
||||
|
||||
/***/ }),
|
||||
/* 20 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
@ -7375,7 +7636,7 @@ class SimpleLinkService {
|
||||
exports.SimpleLinkService = SimpleLinkService;
|
||||
|
||||
/***/ }),
|
||||
/* 20 */
|
||||
/* 21 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
@ -7542,7 +7803,7 @@ class PDFOutlineViewer extends _base_tree_viewer.BaseTreeViewer {
|
||||
exports.PDFOutlineViewer = PDFOutlineViewer;
|
||||
|
||||
/***/ }),
|
||||
/* 21 */
|
||||
/* 22 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
@ -7947,7 +8208,7 @@ class PDFPresentationMode {
|
||||
exports.PDFPresentationMode = PDFPresentationMode;
|
||||
|
||||
/***/ }),
|
||||
/* 22 */
|
||||
/* 23 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
@ -8090,7 +8351,7 @@ class PDFSidebarResizer {
|
||||
exports.PDFSidebarResizer = PDFSidebarResizer;
|
||||
|
||||
/***/ }),
|
||||
/* 23 */
|
||||
/* 24 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
@ -8103,7 +8364,7 @@ exports.PDFThumbnailViewer = void 0;
|
||||
|
||||
var _ui_utils = __webpack_require__(2);
|
||||
|
||||
var _pdf_thumbnail_view = __webpack_require__(24);
|
||||
var _pdf_thumbnail_view = __webpack_require__(25);
|
||||
|
||||
const THUMBNAIL_SCROLL_MARGIN = -19;
|
||||
const THUMBNAIL_SELECTED_CLASS = "selected";
|
||||
@ -8111,6 +8372,7 @@ const THUMBNAIL_SELECTED_CLASS = "selected";
|
||||
class PDFThumbnailViewer {
|
||||
constructor({
|
||||
container,
|
||||
eventBus,
|
||||
linkService,
|
||||
renderingQueue,
|
||||
l10n = _ui_utils.NullL10n
|
||||
@ -8122,6 +8384,10 @@ class PDFThumbnailViewer {
|
||||
this.scroll = (0, _ui_utils.watchScroll)(this.container, this._scrollUpdated.bind(this));
|
||||
|
||||
this._resetView();
|
||||
|
||||
eventBus._on("optionalcontentconfigchanged", () => {
|
||||
this._setImageDisabled = true;
|
||||
});
|
||||
}
|
||||
|
||||
_scrollUpdated() {
|
||||
@ -8219,7 +8485,9 @@ class PDFThumbnailViewer {
|
||||
this._currentPageNumber = 1;
|
||||
this._pageLabels = null;
|
||||
this._pagesRotation = 0;
|
||||
this._optionalContentConfigPromise = null;
|
||||
this._pagesRequests = new WeakMap();
|
||||
this._setImageDisabled = false;
|
||||
this.container.textContent = "";
|
||||
}
|
||||
|
||||
@ -8236,19 +8504,28 @@ class PDFThumbnailViewer {
|
||||
return;
|
||||
}
|
||||
|
||||
pdfDocument.getPage(1).then(firstPdfPage => {
|
||||
const firstPagePromise = pdfDocument.getPage(1);
|
||||
const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig();
|
||||
firstPagePromise.then(firstPdfPage => {
|
||||
this._optionalContentConfigPromise = optionalContentConfigPromise;
|
||||
const pagesCount = pdfDocument.numPages;
|
||||
const viewport = firstPdfPage.getViewport({
|
||||
scale: 1
|
||||
});
|
||||
|
||||
const checkSetImageDisabled = () => {
|
||||
return this._setImageDisabled;
|
||||
};
|
||||
|
||||
for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) {
|
||||
const thumbnail = new _pdf_thumbnail_view.PDFThumbnailView({
|
||||
container: this.container,
|
||||
id: pageNum,
|
||||
defaultViewport: viewport.clone(),
|
||||
optionalContentConfigPromise,
|
||||
linkService: this.linkService,
|
||||
renderingQueue: this.renderingQueue,
|
||||
checkSetImageDisabled,
|
||||
disableCanvasToImageConversion: false,
|
||||
l10n: this.l10n
|
||||
});
|
||||
@ -8347,7 +8624,7 @@ class PDFThumbnailViewer {
|
||||
exports.PDFThumbnailViewer = PDFThumbnailViewer;
|
||||
|
||||
/***/ }),
|
||||
/* 24 */
|
||||
/* 25 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
@ -8411,8 +8688,10 @@ class PDFThumbnailView {
|
||||
container,
|
||||
id,
|
||||
defaultViewport,
|
||||
optionalContentConfigPromise,
|
||||
linkService,
|
||||
renderingQueue,
|
||||
checkSetImageDisabled,
|
||||
disableCanvasToImageConversion = false,
|
||||
l10n = _ui_utils.NullL10n
|
||||
}) {
|
||||
@ -8423,11 +8702,17 @@ class PDFThumbnailView {
|
||||
this.rotation = 0;
|
||||
this.viewport = defaultViewport;
|
||||
this.pdfPageRotate = defaultViewport.rotation;
|
||||
this._optionalContentConfigPromise = optionalContentConfigPromise || null;
|
||||
this.linkService = linkService;
|
||||
this.renderingQueue = renderingQueue;
|
||||
this.renderTask = null;
|
||||
this.renderingState = _pdf_rendering_queue.RenderingStates.INITIAL;
|
||||
this.resume = null;
|
||||
|
||||
this._checkSetImageDisabled = checkSetImageDisabled || function () {
|
||||
return false;
|
||||
};
|
||||
|
||||
this.disableCanvasToImageConversion = disableCanvasToImageConversion;
|
||||
this.pageWidth = this.viewport.width;
|
||||
this.pageHeight = this.viewport.height;
|
||||
@ -8652,7 +8937,8 @@ class PDFThumbnailView {
|
||||
|
||||
const renderContext = {
|
||||
canvasContext: ctx,
|
||||
viewport: drawViewport
|
||||
viewport: drawViewport,
|
||||
optionalContentConfigPromise: this._optionalContentConfigPromise
|
||||
};
|
||||
const renderTask = this.renderTask = pdfPage.render(renderContext);
|
||||
renderTask.onContinue = renderContinueCallback;
|
||||
@ -8665,6 +8951,10 @@ class PDFThumbnailView {
|
||||
}
|
||||
|
||||
setImage(pageView) {
|
||||
if (this._checkSetImageDisabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.renderingState !== _pdf_rendering_queue.RenderingStates.INITIAL) {
|
||||
return;
|
||||
}
|
||||
@ -8761,7 +9051,7 @@ class PDFThumbnailView {
|
||||
exports.PDFThumbnailView = PDFThumbnailView;
|
||||
|
||||
/***/ }),
|
||||
/* 25 */
|
||||
/* 26 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
@ -8772,7 +9062,7 @@ Object.defineProperty(exports, "__esModule", {
|
||||
});
|
||||
exports.PDFViewer = void 0;
|
||||
|
||||
var _base_viewer = __webpack_require__(26);
|
||||
var _base_viewer = __webpack_require__(27);
|
||||
|
||||
var _pdfjsLib = __webpack_require__(5);
|
||||
|
||||
@ -8848,7 +9138,7 @@ class PDFViewer extends _base_viewer.BaseViewer {
|
||||
exports.PDFViewer = PDFViewer;
|
||||
|
||||
/***/ }),
|
||||
/* 26 */
|
||||
/* 27 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
@ -8863,15 +9153,15 @@ var _ui_utils = __webpack_require__(2);
|
||||
|
||||
var _pdf_rendering_queue = __webpack_require__(8);
|
||||
|
||||
var _annotation_layer_builder = __webpack_require__(27);
|
||||
var _annotation_layer_builder = __webpack_require__(28);
|
||||
|
||||
var _pdfjsLib = __webpack_require__(5);
|
||||
|
||||
var _pdf_page_view = __webpack_require__(28);
|
||||
var _pdf_page_view = __webpack_require__(29);
|
||||
|
||||
var _pdf_link_service = __webpack_require__(19);
|
||||
var _pdf_link_service = __webpack_require__(20);
|
||||
|
||||
var _text_layer_builder = __webpack_require__(29);
|
||||
var _text_layer_builder = __webpack_require__(30);
|
||||
|
||||
const DEFAULT_CACHE_SIZE = 10;
|
||||
|
||||
@ -9173,6 +9463,7 @@ class BaseViewer {
|
||||
const pagesCount = pdfDocument.numPages;
|
||||
const firstPagePromise = pdfDocument.getPage(1);
|
||||
const annotationStorage = pdfDocument.annotationStorage;
|
||||
const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig();
|
||||
|
||||
this._pagesCapability.promise.then(() => {
|
||||
this.eventBus.dispatch("pagesloaded", {
|
||||
@ -9210,6 +9501,7 @@ class BaseViewer {
|
||||
firstPagePromise.then(firstPdfPage => {
|
||||
this._firstPageCapability.resolve(firstPdfPage);
|
||||
|
||||
this._optionalContentConfigPromise = optionalContentConfigPromise;
|
||||
const scale = this.currentScale;
|
||||
const viewport = firstPdfPage.getViewport({
|
||||
scale: scale * _ui_utils.CSS_UNITS
|
||||
@ -9222,8 +9514,9 @@ class BaseViewer {
|
||||
eventBus: this.eventBus,
|
||||
id: pageNum,
|
||||
scale,
|
||||
annotationStorage,
|
||||
defaultViewport: viewport.clone(),
|
||||
annotationStorage,
|
||||
optionalContentConfigPromise,
|
||||
renderingQueue: this.renderingQueue,
|
||||
textLayerFactory,
|
||||
textLayerMode: this.textLayerMode,
|
||||
@ -9335,6 +9628,7 @@ class BaseViewer {
|
||||
this._buffer = new PDFPageViewBuffer(DEFAULT_CACHE_SIZE);
|
||||
this._location = null;
|
||||
this._pagesRotation = 0;
|
||||
this._optionalContentConfigPromise = null;
|
||||
this._pagesRequests = new WeakMap();
|
||||
this._firstPageCapability = (0, _pdfjsLib.createPromiseCapability)();
|
||||
this._onePageRenderedCapability = (0, _pdfjsLib.createPromiseCapability)();
|
||||
@ -9862,6 +10156,44 @@ class BaseViewer {
|
||||
});
|
||||
}
|
||||
|
||||
get optionalContentConfigPromise() {
|
||||
if (!this.pdfDocument) {
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
|
||||
if (!this._optionalContentConfigPromise) {
|
||||
return this.pdfDocument.getOptionalContentConfig();
|
||||
}
|
||||
|
||||
return this._optionalContentConfigPromise;
|
||||
}
|
||||
|
||||
set optionalContentConfigPromise(promise) {
|
||||
if (!(promise instanceof Promise)) {
|
||||
throw new Error(`Invalid optionalContentConfigPromise: ${promise}`);
|
||||
}
|
||||
|
||||
if (!this.pdfDocument) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this._optionalContentConfigPromise) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._optionalContentConfigPromise = promise;
|
||||
|
||||
for (const pageView of this._pages) {
|
||||
pageView.update(pageView.scale, pageView.rotation, promise);
|
||||
}
|
||||
|
||||
this.update();
|
||||
this.eventBus.dispatch("optionalcontentconfigchanged", {
|
||||
source: this,
|
||||
promise
|
||||
});
|
||||
}
|
||||
|
||||
get scrollMode() {
|
||||
return this._scrollMode;
|
||||
}
|
||||
@ -9970,7 +10302,7 @@ class BaseViewer {
|
||||
exports.BaseViewer = BaseViewer;
|
||||
|
||||
/***/ }),
|
||||
/* 27 */
|
||||
/* 28 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
@ -9985,7 +10317,7 @@ var _pdfjsLib = __webpack_require__(5);
|
||||
|
||||
var _ui_utils = __webpack_require__(2);
|
||||
|
||||
var _pdf_link_service = __webpack_require__(19);
|
||||
var _pdf_link_service = __webpack_require__(20);
|
||||
|
||||
class AnnotationLayerBuilder {
|
||||
constructor({
|
||||
@ -10085,7 +10417,7 @@ class DefaultAnnotationLayerFactory {
|
||||
exports.DefaultAnnotationLayerFactory = DefaultAnnotationLayerFactory;
|
||||
|
||||
/***/ }),
|
||||
/* 28 */
|
||||
/* 29 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
@ -10117,8 +10449,9 @@ class PDFPageView {
|
||||
this.rotation = 0;
|
||||
this.scale = options.scale || _ui_utils.DEFAULT_SCALE;
|
||||
this.viewport = defaultViewport;
|
||||
this._annotationStorage = options.annotationStorage || null;
|
||||
this.pdfPageRotate = defaultViewport.rotation;
|
||||
this._annotationStorage = options.annotationStorage || null;
|
||||
this._optionalContentConfigPromise = options.optionalContentConfigPromise || null;
|
||||
this.hasRestrictedScaling = false;
|
||||
this.textLayerMode = Number.isInteger(options.textLayerMode) ? options.textLayerMode : _ui_utils.TextLayerMode.ENABLE;
|
||||
this.imageResourcesPath = options.imageResourcesPath || "";
|
||||
@ -10252,13 +10585,17 @@ class PDFPageView {
|
||||
div.appendChild(this.loadingIconDiv);
|
||||
}
|
||||
|
||||
update(scale, rotation) {
|
||||
update(scale, rotation, optionalContentConfigPromise = null) {
|
||||
this.scale = scale || this.scale;
|
||||
|
||||
if (typeof rotation !== "undefined") {
|
||||
this.rotation = rotation;
|
||||
}
|
||||
|
||||
if (optionalContentConfigPromise instanceof Promise) {
|
||||
this._optionalContentConfigPromise = optionalContentConfigPromise;
|
||||
}
|
||||
|
||||
const totalRotation = (this.rotation + this.pdfPageRotate) % 360;
|
||||
this.viewport = this.viewport.clone({
|
||||
scale: this.scale * _ui_utils.CSS_UNITS,
|
||||
@ -10621,7 +10958,8 @@ class PDFPageView {
|
||||
transform,
|
||||
viewport: this.viewport,
|
||||
enableWebGL: this.enableWebGL,
|
||||
renderInteractiveForms: this.renderInteractiveForms
|
||||
renderInteractiveForms: this.renderInteractiveForms,
|
||||
optionalContentConfigPromise: this._optionalContentConfigPromise
|
||||
};
|
||||
const renderTask = this.pdfPage.render(renderContext);
|
||||
|
||||
@ -10671,7 +11009,7 @@ class PDFPageView {
|
||||
exports.PDFPageView = PDFPageView;
|
||||
|
||||
/***/ }),
|
||||
/* 29 */
|
||||
/* 30 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
@ -11033,7 +11371,7 @@ class DefaultTextLayerFactory {
|
||||
exports.DefaultTextLayerFactory = DefaultTextLayerFactory;
|
||||
|
||||
/***/ }),
|
||||
/* 30 */
|
||||
/* 31 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
@ -11048,7 +11386,7 @@ var _ui_utils = __webpack_require__(2);
|
||||
|
||||
var _pdf_cursor_tools = __webpack_require__(6);
|
||||
|
||||
var _pdf_single_page_viewer = __webpack_require__(31);
|
||||
var _pdf_single_page_viewer = __webpack_require__(32);
|
||||
|
||||
class SecondaryToolbar {
|
||||
constructor(options, mainContainer, eventBus) {
|
||||
@ -11351,7 +11689,7 @@ class SecondaryToolbar {
|
||||
exports.SecondaryToolbar = SecondaryToolbar;
|
||||
|
||||
/***/ }),
|
||||
/* 31 */
|
||||
/* 32 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
@ -11362,7 +11700,7 @@ Object.defineProperty(exports, "__esModule", {
|
||||
});
|
||||
exports.PDFSinglePageViewer = void 0;
|
||||
|
||||
var _base_viewer = __webpack_require__(26);
|
||||
var _base_viewer = __webpack_require__(27);
|
||||
|
||||
var _pdfjsLib = __webpack_require__(5);
|
||||
|
||||
@ -11473,7 +11811,7 @@ class PDFSinglePageViewer extends _base_viewer.BaseViewer {
|
||||
exports.PDFSinglePageViewer = PDFSinglePageViewer;
|
||||
|
||||
/***/ }),
|
||||
/* 32 */
|
||||
/* 33 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
@ -11743,7 +12081,7 @@ class Toolbar {
|
||||
exports.Toolbar = Toolbar;
|
||||
|
||||
/***/ }),
|
||||
/* 33 */
|
||||
/* 34 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
@ -11839,7 +12177,7 @@ class ViewHistory {
|
||||
exports.ViewHistory = ViewHistory;
|
||||
|
||||
/***/ }),
|
||||
/* 34 */
|
||||
/* 35 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
@ -11850,13 +12188,13 @@ Object.defineProperty(exports, "__esModule", {
|
||||
});
|
||||
exports.FirefoxCom = exports.DownloadManager = void 0;
|
||||
|
||||
__webpack_require__(35);
|
||||
__webpack_require__(36);
|
||||
|
||||
var _app = __webpack_require__(1);
|
||||
|
||||
var _pdfjsLib = __webpack_require__(5);
|
||||
|
||||
var _preferences = __webpack_require__(36);
|
||||
var _preferences = __webpack_require__(37);
|
||||
|
||||
var _ui_utils = __webpack_require__(2);
|
||||
|
||||
@ -12211,7 +12549,7 @@ document.mozL10n.setExternalLocalizerServices({
|
||||
});
|
||||
|
||||
/***/ }),
|
||||
/* 35 */
|
||||
/* 36 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
@ -12334,7 +12672,7 @@ document.mozL10n.setExternalLocalizerServices({
|
||||
})(void 0);
|
||||
|
||||
/***/ }),
|
||||
/* 36 */
|
||||
/* 37 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
@ -12484,7 +12822,7 @@ class BasePreferences {
|
||||
exports.BasePreferences = BasePreferences;
|
||||
|
||||
/***/ }),
|
||||
/* 37 */
|
||||
/* 38 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
@ -12501,7 +12839,7 @@ var _app = __webpack_require__(1);
|
||||
|
||||
var _pdfjsLib = __webpack_require__(5);
|
||||
|
||||
function composePage(pdfDocument, pageNumber, size, printContainer, printResolution) {
|
||||
function composePage(pdfDocument, pageNumber, size, printContainer, printResolution, optionalContentConfigPromise) {
|
||||
const canvas = document.createElement("canvas");
|
||||
const PRINT_UNITS = printResolution / 72.0;
|
||||
canvas.width = Math.floor(size.width * PRINT_UNITS);
|
||||
@ -12527,7 +12865,8 @@ function composePage(pdfDocument, pageNumber, size, printContainer, printResolut
|
||||
rotation: size.rotation
|
||||
}),
|
||||
intent: "print",
|
||||
annotationStorage: pdfDocument.annotationStorage
|
||||
annotationStorage: pdfDocument.annotationStorage,
|
||||
optionalContentConfigPromise
|
||||
};
|
||||
return pdfPage.render(renderContext).promise;
|
||||
}).then(function () {
|
||||
@ -12544,11 +12883,12 @@ function composePage(pdfDocument, pageNumber, size, printContainer, printResolut
|
||||
};
|
||||
}
|
||||
|
||||
function FirefoxPrintService(pdfDocument, pagesOverview, printContainer, printResolution) {
|
||||
function FirefoxPrintService(pdfDocument, pagesOverview, printContainer, printResolution, optionalContentConfigPromise = null) {
|
||||
this.pdfDocument = pdfDocument;
|
||||
this.pagesOverview = pagesOverview;
|
||||
this.printContainer = printContainer;
|
||||
this._printResolution = printResolution || 150;
|
||||
this._optionalContentConfigPromise = optionalContentConfigPromise || pdfDocument.getOptionalContentConfig();
|
||||
}
|
||||
|
||||
FirefoxPrintService.prototype = {
|
||||
@ -12557,13 +12897,14 @@ FirefoxPrintService.prototype = {
|
||||
pdfDocument,
|
||||
pagesOverview,
|
||||
printContainer,
|
||||
_printResolution
|
||||
_printResolution,
|
||||
_optionalContentConfigPromise
|
||||
} = this;
|
||||
const body = document.querySelector("body");
|
||||
body.setAttribute("data-pdfjsprinting", true);
|
||||
|
||||
for (let i = 0, ii = pagesOverview.length; i < ii; ++i) {
|
||||
composePage(pdfDocument, i + 1, pagesOverview[i], printContainer, _printResolution);
|
||||
composePage(pdfDocument, i + 1, pagesOverview[i], printContainer, _printResolution, _optionalContentConfigPromise);
|
||||
}
|
||||
},
|
||||
|
||||
@ -12581,8 +12922,8 @@ _app.PDFPrintServiceFactory.instance = {
|
||||
return (0, _pdfjsLib.shadow)(this, "supportsPrinting", value);
|
||||
},
|
||||
|
||||
createPrintService(pdfDocument, pagesOverview, printContainer, printResolution) {
|
||||
return new FirefoxPrintService(pdfDocument, pagesOverview, printContainer, printResolution);
|
||||
createPrintService(pdfDocument, pagesOverview, printContainer, printResolution, optionalContentConfigPromise) {
|
||||
return new FirefoxPrintService(pdfDocument, pagesOverview, printContainer, printResolution, optionalContentConfigPromise);
|
||||
}
|
||||
|
||||
};
|
||||
|
@ -20,7 +20,7 @@ origin:
|
||||
|
||||
# Human-readable identifier for this version/release
|
||||
# Generally "version NNN", "tag SSS", "bookmark SSS"
|
||||
release: version 2.6.324
|
||||
release: version 2.6.336
|
||||
|
||||
# The package's license, where possible using the mnemonic from
|
||||
# https://spdx.org/licenses/
|
||||
|
Loading…
Reference in New Issue
Block a user