diff options
author | Michael Catanzaro <mcatanzaro@gnome.org> | 2021-03-08 16:22:26 -0600 |
---|---|---|
committer | Alexander Mikhaylenko <alexm@gnome.org> | 2021-04-05 09:51:56 +0000 |
commit | 65cd370618646f54f250eeabb4d215e41d95e0e7 (patch) | |
tree | 0d6aa68a4f2b0d6de37c9e0895832d8b607ad3f0 | |
parent | 6b84771a1ba0df4ff356bd9cc9e6175dcfd5b569 (diff) | |
download | epiphany-65cd370618646f54f250eeabb4d215e41d95e0e7.tar.gz |
Update to PDF.js 2.6.347
This removes all Epiphany customizations, so it will not actually work.
Epiphany customizations will be reapplied in the next commit.
246 files changed, 12373 insertions, 7221 deletions
diff --git a/third-party/pdfjs/build/pdf.js b/third-party/pdfjs/build/pdf.js index a2ee957dd..8d59e6dd9 100644 --- a/third-party/pdfjs/build/pdf.js +++ b/third-party/pdfjs/build/pdf.js @@ -325,36 +325,36 @@ var _api = __w_pdfjs_require__(5); var _util = __w_pdfjs_require__(2); -var _annotation_layer = __w_pdfjs_require__(16); +var _annotation_layer = __w_pdfjs_require__(19); -var _api_compatibility = __w_pdfjs_require__(7); +var _api_compatibility = __w_pdfjs_require__(9); -var _worker_options = __w_pdfjs_require__(10); +var _worker_options = __w_pdfjs_require__(12); -var _text_layer = __w_pdfjs_require__(17); +var _text_layer = __w_pdfjs_require__(20); -var _svg = __w_pdfjs_require__(18); +var _svg = __w_pdfjs_require__(21); -const pdfjsVersion = '2.5.207'; -const pdfjsBuild = '0974d6052'; +const pdfjsVersion = '2.6.347'; +const pdfjsBuild = '3be9c65f'; { const { isNodeJS } = __w_pdfjs_require__(4); if (isNodeJS) { - const PDFNodeStream = __w_pdfjs_require__(19).PDFNodeStream; + const PDFNodeStream = __w_pdfjs_require__(22).PDFNodeStream; (0, _api.setPDFNetworkStreamFactory)(params => { return new PDFNodeStream(params); }); } else { - const PDFNetworkStream = __w_pdfjs_require__(22).PDFNetworkStream; + const PDFNetworkStream = __w_pdfjs_require__(25).PDFNetworkStream; let PDFFetchStream; if ((0, _display_utils.isFetchSupported)()) { - PDFFetchStream = __w_pdfjs_require__(23).PDFFetchStream; + PDFFetchStream = __w_pdfjs_require__(26).PDFFetchStream; } (0, _api.setPDFNetworkStreamFactory)(params => { @@ -383,7 +383,7 @@ exports.isFetchSupported = isFetchSupported; exports.isValidFetchUrl = isValidFetchUrl; exports.loadScript = loadScript; exports.deprecated = deprecated; -exports.PDFDateString = exports.StatTimer = exports.DOMSVGFactory = exports.DOMCMapReaderFactory = exports.DOMCanvasFactory = exports.DEFAULT_LINK_REL = exports.LinkTarget = exports.RenderingCancelledException = exports.PageViewport = void 0; +exports.PDFDateString = exports.StatTimer = exports.DOMSVGFactory = exports.DOMCMapReaderFactory = exports.BaseCMapReaderFactory = exports.DOMCanvasFactory = exports.BaseCanvasFactory = exports.DEFAULT_LINK_REL = exports.LinkTarget = exports.RenderingCancelledException = exports.PageViewport = void 0; var _util = __w_pdfjs_require__(2); @@ -391,20 +391,15 @@ const DEFAULT_LINK_REL = "noopener noreferrer nofollow"; exports.DEFAULT_LINK_REL = DEFAULT_LINK_REL; const SVG_NS = "http://www.w3.org/2000/svg"; -class DOMCanvasFactory { - create(width, height) { - if (width <= 0 || height <= 0) { - throw new Error("Invalid canvas size"); +class BaseCanvasFactory { + constructor() { + if (this.constructor === BaseCanvasFactory) { + (0, _util.unreachable)("Cannot initialize BaseCanvasFactory."); } + } - const canvas = document.createElement("canvas"); - const context = canvas.getContext("2d"); - canvas.width = width; - canvas.height = height; - return { - canvas, - context - }; + create(width, height) { + (0, _util.unreachable)("Abstract method `create` called."); } reset(canvasAndContext, width, height) { @@ -433,13 +428,45 @@ class DOMCanvasFactory { } +exports.BaseCanvasFactory = BaseCanvasFactory; + +class DOMCanvasFactory extends BaseCanvasFactory { + constructor({ + ownerDocument = globalThis.document + } = {}) { + super(); + this._document = ownerDocument; + } + + create(width, height) { + if (width <= 0 || height <= 0) { + throw new Error("Invalid canvas size"); + } + + const canvas = this._document.createElement("canvas"); + + const context = canvas.getContext("2d"); + canvas.width = width; + canvas.height = height; + return { + canvas, + context + }; + } + +} + exports.DOMCanvasFactory = DOMCanvasFactory; -class DOMCMapReaderFactory { +class BaseCMapReaderFactory { constructor({ baseUrl = null, isCompressed = false }) { + if (this.constructor === BaseCMapReaderFactory) { + (0, _util.unreachable)("Cannot initialize BaseCMapReaderFactory."); + } + this.baseUrl = baseUrl; this.isCompressed = isCompressed; } @@ -457,7 +484,21 @@ class DOMCMapReaderFactory { const url = this.baseUrl + name + (this.isCompressed ? ".bcmap" : ""); const compressionType = this.isCompressed ? _util.CMapCompressionType.BINARY : _util.CMapCompressionType.NONE; + return this._fetchData(url, compressionType).catch(reason => { + throw new Error(`Unable to load ${this.isCompressed ? "binary " : ""}CMap at: ${url}`); + }); + } + + _fetchData(url, compressionType) { + (0, _util.unreachable)("Abstract method `_fetchData` called."); + } +} + +exports.BaseCMapReaderFactory = BaseCMapReaderFactory; + +class DOMCMapReaderFactory extends BaseCMapReaderFactory { + _fetchData(url, compressionType) { if (isFetchSupported() && isValidFetchUrl(url, document.baseURI)) { return fetch(url).then(async response => { if (!response.ok) { @@ -476,8 +517,6 @@ class DOMCMapReaderFactory { cMapData, compressionType }; - }).catch(reason => { - throw new Error(`Unable to load ${this.isCompressed ? "binary " : ""}` + `CMap at: ${url}`); }); } @@ -516,8 +555,6 @@ class DOMCMapReaderFactory { }; request.send(null); - }).catch(reason => { - throw new Error(`Unable to load ${this.isCompressed ? "binary " : ""}` + `CMap at: ${url}`); }); } @@ -882,12 +919,13 @@ exports.arraysToBytes = arraysToBytes; exports.assert = assert; exports.bytesToString = bytesToString; exports.createPromiseCapability = createPromiseCapability; +exports.escapeString = escapeString; +exports.getModificationDate = getModificationDate; exports.getVerbosityLevel = getVerbosityLevel; exports.info = info; exports.isArrayBuffer = isArrayBuffer; exports.isArrayEqual = isArrayEqual; exports.isBool = isBool; -exports.isEmptyObj = isEmptyObj; exports.isNum = isNum; exports.isString = isString; exports.isSameOrigin = isSameOrigin; @@ -1186,7 +1224,8 @@ const UNSUPPORTED_FEATURES = { errorOperatorList: "errorOperatorList", errorFontToUnicode: "errorFontToUnicode", errorFontLoadNative: "errorFontLoadNative", - errorFontGetPath: "errorFontGetPath" + errorFontGetPath: "errorFontGetPath", + errorMarkedContent: "errorMarkedContent" }; exports.UNSUPPORTED_FEATURES = UNSUPPORTED_FEATURES; const PasswordResponses = { @@ -1601,6 +1640,10 @@ function stringToPDFString(str) { return strBuf.join(""); } +function escapeString(str) { + return str.replace(/([\(\)\\])/g, "\\$1"); +} + function stringToUTF8String(str) { return decodeURIComponent(escape(str)); } @@ -1609,14 +1652,6 @@ function utf8StringToString(str) { return unescape(encodeURIComponent(str)); } -function isEmptyObj(obj) { - for (const key in obj) { - return false; - } - - return true; -} - function isBool(v) { return typeof v === "boolean"; } @@ -1643,6 +1678,11 @@ function isArrayEqual(arr1, arr2) { }); } +function getModificationDate(date = new Date(Date.now())) { + const buffer = [date.getUTCFullYear().toString(), (date.getUTCMonth() + 1).toString().padStart(2, "0"), (date.getUTCDate() + 1).toString().padStart(2, "0"), date.getUTCHours().toString().padStart(2, "0"), date.getUTCMinutes().toString().padStart(2, "0"), date.getUTCSeconds().toString().padStart(2, "0")]; + return buffer.join(""); +} + function createPromiseCapability() { const capability = Object.create(null); let isSettled = false; @@ -1717,7 +1757,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.isNodeJS = void 0; -const isNodeJS = typeof process === "object" && process + "" === "[object process]" && !process.versions.nw && !process.versions.electron; +const isNodeJS = typeof process === "object" && process + "" === "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser"); exports.isNodeJS = isNodeJS; /***/ }), @@ -1740,24 +1780,32 @@ var _display_utils = __w_pdfjs_require__(1); var _font_loader = __w_pdfjs_require__(6); -var _api_compatibility = __w_pdfjs_require__(7); +var _node_utils = __w_pdfjs_require__(7); + +var _annotation_storage = __w_pdfjs_require__(8); -var _canvas = __w_pdfjs_require__(8); +var _api_compatibility = __w_pdfjs_require__(9); -var _worker_options = __w_pdfjs_require__(10); +var _canvas = __w_pdfjs_require__(10); + +var _worker_options = __w_pdfjs_require__(12); var _is_node = __w_pdfjs_require__(4); -var _message_handler = __w_pdfjs_require__(11); +var _message_handler = __w_pdfjs_require__(13); + +var _metadata = __w_pdfjs_require__(14); -var _metadata = __w_pdfjs_require__(12); +var _optional_content_config = __w_pdfjs_require__(16); -var _transport_stream = __w_pdfjs_require__(14); +var _transport_stream = __w_pdfjs_require__(17); -var _webgl = __w_pdfjs_require__(15); +var _webgl = __w_pdfjs_require__(18); const DEFAULT_RANGE_CHUNK_SIZE = 65536; const RENDERING_CANCELLED_TIMEOUT = 100; +const DefaultCanvasFactory = _is_node.isNodeJS ? _node_utils.NodeCanvasFactory : _display_utils.DOMCanvasFactory; +const DefaultCMapReaderFactory = _is_node.isNodeJS ? _node_utils.NodeCMapReaderFactory : _display_utils.DOMCMapReaderFactory; let createPDFNetworkStream; function setPDFNetworkStreamFactory(pdfNetworkStreamFactory) { @@ -1826,7 +1874,7 @@ function getDocument(src) { } params.rangeChunkSize = params.rangeChunkSize || DEFAULT_RANGE_CHUNK_SIZE; - params.CMapReaderFactory = params.CMapReaderFactory || _display_utils.DOMCMapReaderFactory; + params.CMapReaderFactory = params.CMapReaderFactory || DefaultCMapReaderFactory; params.ignoreErrors = params.stopAtErrors !== true; params.fontExtraProperties = params.fontExtraProperties === true; params.pdfBug = params.pdfBug === true; @@ -1843,6 +1891,10 @@ function getDocument(src) { params.disableFontFace = _api_compatibility.apiCompatibilityParams.disableFontFace || false; } + if (typeof params.ownerDocument === "undefined") { + params.ownerDocument = globalThis.document; + } + if (typeof params.disableRange !== "boolean") { params.disableRange = false; } @@ -1927,7 +1979,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) { return worker.messageHandler.sendWithPromise("GetDocRequest", { docId, - apiVersion: '2.5.207', + apiVersion: '2.6.347', source: { data: source.data, url: source.url, @@ -2068,6 +2120,10 @@ class PDFDocumentProxy { this._transport = transport; } + get annotationStorage() { + return (0, _util.shadow)(this, "annotationStorage", new _annotation_storage.AnnotationStorage()); + } + get numPages() { return this._pdfInfo.numPages; } @@ -2112,13 +2168,6 @@ class PDFDocumentProxy { return this._transport.getOpenAction(); } - getOpenActionDestination() { - (0, _display_utils.deprecated)("getOpenActionDestination, use getOpenAction instead."); - return this.getOpenAction().then(function (openAction) { - return openAction && openAction.dest ? openAction.dest : null; - }); - } - getAttachments() { return this._transport.getAttachments(); } @@ -2131,6 +2180,10 @@ class PDFDocumentProxy { return this._transport.getOutline(); } + getOptionalContentConfig() { + return this._transport.getOptionalContentConfig(); + } + getPermissions() { return this._transport.getPermissions(); } @@ -2167,14 +2220,19 @@ class PDFDocumentProxy { return this._transport.loadingTask; } + saveDocument(annotationStorage) { + return this._transport.saveDocument(annotationStorage); + } + } exports.PDFDocumentProxy = PDFDocumentProxy; class PDFPageProxy { - constructor(pageIndex, pageInfo, transport, pdfBug = false) { + constructor(pageIndex, pageInfo, transport, ownerDocument, pdfBug = false) { this._pageIndex = pageIndex; this._pageInfo = pageInfo; + this._ownerDocument = ownerDocument; this._transport = transport; this._stats = pdfBug ? new _display_utils.StatTimer() : null; this._pdfBug = pdfBug; @@ -2182,7 +2240,7 @@ class PDFPageProxy { this.objs = new PDFObjects(); this.cleanupAfterRender = false; this.pendingCleanup = false; - this.intentStates = Object.create(null); + this._intentStates = new Map(); this.destroyed = false; } @@ -2243,7 +2301,9 @@ class PDFPageProxy { transform = null, imageLayer = null, canvasFactory = null, - background = null + background = null, + annotationStorage = null, + optionalContentConfigPromise = null }) { if (this._stats) { this._stats.time("Overall"); @@ -2252,18 +2312,26 @@ class PDFPageProxy { const renderingIntent = intent === "print" ? "print" : "display"; this.pendingCleanup = false; - if (!this.intentStates[renderingIntent]) { - this.intentStates[renderingIntent] = Object.create(null); + if (!optionalContentConfigPromise) { + optionalContentConfigPromise = this._transport.getOptionalContentConfig(); } - const intentState = this.intentStates[renderingIntent]; + let intentState = this._intentStates.get(renderingIntent); + + if (!intentState) { + intentState = Object.create(null); + + this._intentStates.set(renderingIntent, intentState); + } if (intentState.streamReaderCancelTimeout) { clearTimeout(intentState.streamReaderCancelTimeout); intentState.streamReaderCancelTimeout = null; } - const canvasFactoryInstance = canvasFactory || new _display_utils.DOMCanvasFactory(); + const canvasFactoryInstance = canvasFactory || new DefaultCanvasFactory({ + ownerDocument: this._ownerDocument + }); const webGLContext = new _webgl.WebGLContext({ enable: enableWebGL }); @@ -2283,7 +2351,8 @@ class PDFPageProxy { this._pumpOperatorList({ pageIndex: this._pageIndex, intent: renderingIntent, - renderInteractiveForms: renderInteractiveForms === true + renderInteractiveForms: renderInteractiveForms === true, + annotationStorage: annotationStorage && annotationStorage.getAll() || null }); } @@ -2343,7 +2412,7 @@ class PDFPageProxy { intentState.renderTasks.push(internalRenderTask); const renderTask = internalRenderTask.task; - intentState.displayReadyCapability.promise.then(transparency => { + Promise.all([intentState.displayReadyCapability.promise, optionalContentConfigPromise]).then(([transparency, optionalContentConfig]) => { if (this.pendingCleanup) { complete(); return; @@ -2353,7 +2422,10 @@ class PDFPageProxy { this._stats.time("Rendering"); } - internalRenderTask.initializeGraphics(transparency); + internalRenderTask.initializeGraphics({ + transparency, + optionalContentConfig + }); internalRenderTask.operatorListChanged(); }).catch(complete); return renderTask; @@ -2373,15 +2445,18 @@ class PDFPageProxy { const renderingIntent = "oplist"; - if (!this.intentStates[renderingIntent]) { - this.intentStates[renderingIntent] = Object.create(null); + let intentState = this._intentStates.get(renderingIntent); + + if (!intentState) { + intentState = Object.create(null); + + this._intentStates.set(renderingIntent, intentState); } - const intentState = this.intentStates[renderingIntent]; let opListTask; if (!intentState.opListReadCapability) { - opListTask = {}; + opListTask = Object.create(null); opListTask.operatorListChanged = operatorListChanged; intentState.opListReadCapability = (0, _util.createPromiseCapability)(); intentState.renderTasks = []; @@ -2456,9 +2531,8 @@ class PDFPageProxy { this.destroyed = true; this._transport.pageCache[this._pageIndex] = null; const waitOn = []; - Object.keys(this.intentStates).forEach(intent => { - const intentState = this.intentStates[intent]; + for (const [intent, intentState] of this._intentStates) { this._abortOperatorList({ intentState, reason: new Error("Page was destroyed."), @@ -2466,15 +2540,15 @@ class PDFPageProxy { }); if (intent === "oplist") { - return; + continue; } - intentState.renderTasks.forEach(function (renderTask) { - const renderCompleted = renderTask.capability.promise.catch(function () {}); - waitOn.push(renderCompleted); - renderTask.cancel(); - }); - }); + for (const internalRenderTask of intentState.renderTasks) { + waitOn.push(internalRenderTask.completed); + internalRenderTask.cancel(); + } + } + this.objs.clear(); this.annotationsPromise = null; this.pendingCleanup = false; @@ -2487,16 +2561,21 @@ class PDFPageProxy { } _tryCleanup(resetStats = false) { - if (!this.pendingCleanup || Object.keys(this.intentStates).some(intent => { - const intentState = this.intentStates[intent]; - return intentState.renderTasks.length !== 0 || !intentState.operatorList.lastChunk; - })) { + if (!this.pendingCleanup) { return false; } - Object.keys(this.intentStates).forEach(intent => { - delete this.intentStates[intent]; - }); + for (const { + renderTasks, + operatorList + } of this._intentStates.values()) { + if (renderTasks.length !== 0 || !operatorList.lastChunk) { + return false; + } + } + + this._intentStates.clear(); + this.objs.clear(); this.annotationsPromise = null; @@ -2509,7 +2588,7 @@ class PDFPageProxy { } _startRenderPage(transparency, intent) { - const intentState = this.intentStates[intent]; + const intentState = this._intentStates.get(intent); if (!intentState) { return; @@ -2547,7 +2626,9 @@ class PDFPageProxy { const readableStream = this._transport.messageHandler.sendWithStream("GetOperatorList", args); const reader = readableStream.getReader(); - const intentState = this.intentStates[args.intent]; + + const intentState = this._intentStates.get(args.intent); + intentState.streamReader = reader; const pump = () => { @@ -2634,14 +2715,14 @@ class PDFPageProxy { return; } - Object.keys(this.intentStates).some(intent => { - if (this.intentStates[intent] === intentState) { - delete this.intentStates[intent]; - return true; + for (const [intent, curIntentState] of this._intentStates) { + if (curIntentState === intentState) { + this._intentStates.delete(intent); + + break; } + } - return false; - }); this.cleanup(); } @@ -3058,7 +3139,8 @@ class WorkerTransport { this.commonObjs = new PDFObjects(); this.fontLoader = new _font_loader.FontLoader({ docId: loadingTask.docId, - onUnsupportedFeature: this._onUnsupportedFeature.bind(this) + onUnsupportedFeature: this._onUnsupportedFeature.bind(this), + ownerDocument: params.ownerDocument }); this._params = params; this.CMapReaderFactory = new params.CMapReaderFactory({ @@ -3151,6 +3233,14 @@ class WorkerTransport { sink.onCancel = reason => { this._fullReader.cancel(reason); + + sink.ready.catch(readyReason => { + if (this.destroyed) { + return; + } + + throw readyReason; + }); }; }); messageHandler.on("ReaderHeadersReady", data => { @@ -3209,6 +3299,13 @@ class WorkerTransport { sink.onCancel = reason => { rangeReader.cancel(reason); + sink.ready.catch(readyReason => { + if (this.destroyed) { + return; + } + + throw readyReason; + }); }; }); messageHandler.on("GetDoc", ({ @@ -3243,6 +3340,11 @@ class WorkerTransport { break; } + if (!(reason instanceof Error)) { + const msg = "DocException - expected a valid Error."; + (0, _util.warn)(msg); + } + loadingTask._capability.reject(reason); }); messageHandler.on("PasswordRequest", exception => { @@ -3339,7 +3441,6 @@ class WorkerTransport { break; case "FontPath": - case "FontType3Res": case "Image": this.commonObjs.resolve(id, exportedData); break; @@ -3448,7 +3549,7 @@ class WorkerTransport { throw new Error("Transport destroyed"); } - const page = new PDFPageProxy(pageIndex, pageInfo, this, this._params.pdfBug); + const page = new PDFPageProxy(pageIndex, pageInfo, this, this._params.ownerDocument, this._params.pdfBug); this.pageCache[pageIndex] = page; return page; }); @@ -3471,6 +3572,18 @@ class WorkerTransport { }); } + saveDocument(annotationStorage) { + return this.messageHandler.sendWithPromise("SaveDocument", { + numPages: this._numPages, + annotationStorage: annotationStorage && annotationStorage.getAll() || null, + filename: this._fullReader ? this._fullReader.filename : null + }).finally(() => { + if (annotationStorage) { + annotationStorage.resetModified(); + } + }); + } + getDestinations() { return this.messageHandler.sendWithPromise("GetDestinations", null); } @@ -3517,6 +3630,12 @@ class WorkerTransport { return this.messageHandler.sendWithPromise("GetOutline", null); } + getOptionalContentConfig() { + return this.messageHandler.sendWithPromise("GetOptionalContentConfig", null).then(results => { + return new _optional_content_config.OptionalContentConfig(results); + }); + } + getPermissions() { return this.messageHandler.sendWithPromise("GetPermissions", null); } @@ -3671,7 +3790,14 @@ const InternalRenderTask = function InternalRenderTaskClosure() { this._canvas = params.canvasContext.canvas; } - initializeGraphics(transparency = false) { + get completed() { + return this.capability.promise.catch(function () {}); + } + + initializeGraphics({ + transparency = false, + optionalContentConfig + }) { if (this.cancelled) { return; } @@ -3697,7 +3823,7 @@ const InternalRenderTask = function InternalRenderTaskClosure() { imageLayer, background } = this.params; - this.gfx = new _canvas.CanvasGraphics(canvasContext, this.commonObjs, this.objs, this.canvasFactory, this.webGLContext, imageLayer); + this.gfx = new _canvas.CanvasGraphics(canvasContext, this.commonObjs, this.objs, this.canvasFactory, this.webGLContext, imageLayer, optionalContentConfig); this.gfx.beginDrawing({ transform, viewport, @@ -3798,9 +3924,9 @@ const InternalRenderTask = function InternalRenderTaskClosure() { return InternalRenderTask; }(); -const version = '2.5.207'; +const version = '2.6.347'; exports.version = version; -const build = '0974d6052'; +const build = '3be9c65f'; exports.build = build; /***/ }), @@ -3820,7 +3946,8 @@ var _util = __w_pdfjs_require__(2); class BaseFontLoader { constructor({ docId, - onUnsupportedFeature + onUnsupportedFeature, + ownerDocument = globalThis.document }) { if (this.constructor === BaseFontLoader) { (0, _util.unreachable)("Cannot initialize BaseFontLoader."); @@ -3828,22 +3955,25 @@ class BaseFontLoader { this.docId = docId; this._onUnsupportedFeature = onUnsupportedFeature; + this._document = ownerDocument; this.nativeFontFaces = []; this.styleElement = null; } addNativeFontFace(nativeFontFace) { this.nativeFontFaces.push(nativeFontFace); - document.fonts.add(nativeFontFace); + + this._document.fonts.add(nativeFontFace); } insertRule(rule) { let styleElement = this.styleElement; if (!styleElement) { - styleElement = this.styleElement = document.createElement("style"); + styleElement = this.styleElement = this._document.createElement("style"); styleElement.id = `PDFJS_FONT_STYLE_TAG_${this.docId}`; - document.documentElement.getElementsByTagName("head")[0].appendChild(styleElement); + + this._document.documentElement.getElementsByTagName("head")[0].appendChild(styleElement); } const styleSheet = styleElement.sheet; @@ -3851,8 +3981,8 @@ class BaseFontLoader { } clear() { - this.nativeFontFaces.forEach(function (nativeFontFace) { - document.fonts.delete(nativeFontFace); + this.nativeFontFaces.forEach(nativeFontFace => { + this._document.fonts.delete(nativeFontFace); }); this.nativeFontFaces.length = 0; @@ -3913,7 +4043,7 @@ class BaseFontLoader { } get isFontLoadingAPISupported() { - const supported = typeof document !== "undefined" && !!document.fonts; + const supported = typeof this._document !== "undefined" && !!this._document.fonts; return (0, _util.shadow)(this, "isFontLoadingAPISupported", supported); } @@ -3935,8 +4065,8 @@ let FontLoader; exports.FontLoader = FontLoader; { exports.FontLoader = FontLoader = class GenericFontLoader extends BaseFontLoader { - constructor(docId) { - super(docId); + constructor(params) { + super(params); this.loadingContext = { requests: [], nextRequestId: 0 @@ -4002,7 +4132,9 @@ exports.FontLoader = FontLoader; } let i, ii; - const canvas = document.createElement("canvas"); + + const canvas = this._document.createElement("canvas"); + canvas.width = 1; canvas.height = 1; const ctx = canvas.getContext("2d"); @@ -4056,22 +4188,27 @@ exports.FontLoader = FontLoader; } names.push(loadTestFontId); - const div = document.createElement("div"); + + const div = this._document.createElement("div"); + div.style.visibility = "hidden"; div.style.width = div.style.height = "10px"; div.style.position = "absolute"; div.style.top = div.style.left = "0px"; for (i = 0, ii = names.length; i < ii; ++i) { - const span = document.createElement("span"); + const span = this._document.createElement("span"); + span.textContent = "Hi"; span.style.fontFamily = names[i]; div.appendChild(span); } - document.body.appendChild(div); - isFontReady(loadTestFontId, function () { - document.body.removeChild(div); + this._document.body.appendChild(div); + + isFontReady(loadTestFontId, () => { + this._document.body.removeChild(div); + request.complete(); }); } @@ -4200,6 +4337,152 @@ exports.FontFaceObject = FontFaceObject; Object.defineProperty(exports, "__esModule", { value: true }); +exports.NodeCMapReaderFactory = exports.NodeCanvasFactory = void 0; + +var _display_utils = __w_pdfjs_require__(1); + +var _is_node = __w_pdfjs_require__(4); + +var _util = __w_pdfjs_require__(2); + +let NodeCanvasFactory = class { + constructor() { + (0, _util.unreachable)("Not implemented: NodeCanvasFactory"); + } + +}; +exports.NodeCanvasFactory = NodeCanvasFactory; +let NodeCMapReaderFactory = class { + constructor() { + (0, _util.unreachable)("Not implemented: NodeCMapReaderFactory"); + } + +}; +exports.NodeCMapReaderFactory = NodeCMapReaderFactory; + +if (_is_node.isNodeJS) { + exports.NodeCanvasFactory = NodeCanvasFactory = class extends _display_utils.BaseCanvasFactory { + create(width, height) { + if (width <= 0 || height <= 0) { + throw new Error("Invalid canvas size"); + } + + const Canvas = require("canvas"); + + const canvas = Canvas.createCanvas(width, height); + return { + canvas, + context: canvas.getContext("2d") + }; + } + + }; + exports.NodeCMapReaderFactory = NodeCMapReaderFactory = class extends _display_utils.BaseCMapReaderFactory { + _fetchData(url, compressionType) { + return new Promise((resolve, reject) => { + const fs = require("fs"); + + fs.readFile(url, (error, data) => { + if (error || !data) { + reject(new Error(error)); + return; + } + + resolve({ + cMapData: new Uint8Array(data), + compressionType + }); + }); + }); + } + + }; +} + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __w_pdfjs_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.AnnotationStorage = void 0; + +class AnnotationStorage { + constructor() { + this._storage = new Map(); + this._modified = false; + this.onSetModified = null; + this.onResetModified = null; + } + + getOrCreateValue(key, defaultValue) { + if (this._storage.has(key)) { + return this._storage.get(key); + } + + this._storage.set(key, defaultValue); + + return defaultValue; + } + + setValue(key, value) { + if (this._storage.get(key) !== value) { + this._setModified(); + } + + this._storage.set(key, value); + } + + getAll() { + if (this._storage.size === 0) { + return null; + } + + return Object.fromEntries(this._storage); + } + + get size() { + return this._storage.size; + } + + _setModified() { + if (!this._modified) { + this._modified = true; + + if (typeof this.onSetModified === "function") { + this.onSetModified(); + } + } + } + + resetModified() { + if (this._modified) { + this._modified = false; + + if (typeof this.onResetModified === "function") { + this.onResetModified(); + } + } + } + +} + +exports.AnnotationStorage = AnnotationStorage; + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __w_pdfjs_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.apiCompatibilityParams = void 0; var _is_node = __w_pdfjs_require__(4); @@ -4216,7 +4499,7 @@ const apiCompatibilityParams = Object.freeze(compatibilityParams); exports.apiCompatibilityParams = apiCompatibilityParams; /***/ }), -/* 8 */ +/* 10 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -4229,7 +4512,7 @@ exports.CanvasGraphics = void 0; var _util = __w_pdfjs_require__(2); -var _pattern_helper = __w_pdfjs_require__(9); +var _pattern_helper = __w_pdfjs_require__(11); var MIN_FONT_SIZE = 16; var MAX_FONT_SIZE = 100; @@ -4574,6 +4857,7 @@ var CanvasExtraState = function CanvasExtraStateClosure() { this.lineWidth = 1; this.activeSMask = null; this.resumeSMaskCtx = null; + this.transferMaps = null; } CanvasExtraState.prototype = { @@ -4592,7 +4876,7 @@ var CanvasGraphics = function CanvasGraphicsClosure() { var EXECUTION_TIME = 15; var EXECUTION_STEPS = 10; - function CanvasGraphics(canvasCtx, commonObjs, objs, canvasFactory, webGLContext, imageLayer) { + function CanvasGraphics(canvasCtx, commonObjs, objs, canvasFactory, webGLContext, imageLayer, optionalContentConfig) { this.ctx = canvasCtx; this.current = new CanvasExtraState(); this.stateStack = []; @@ -4613,6 +4897,9 @@ var CanvasGraphics = function CanvasGraphicsClosure() { this.smaskStack = []; this.smaskCounter = 0; this.tempSMask = null; + this.contentVisible = true; + this.markedContentStack = []; + this.optionalContentConfig = optionalContentConfig; this.cachedCanvases = new CachedCanvases(this.canvasFactory); if (canvasCtx) { @@ -4622,7 +4909,7 @@ var CanvasGraphics = function CanvasGraphicsClosure() { this._cachedGetSinglePixelWidth = null; } - function putBinaryImageData(ctx, imgData) { + function putBinaryImageData(ctx, imgData, transferMaps = null) { if (typeof ImageData !== "undefined" && imgData instanceof ImageData) { ctx.putImageData(imgData, 0, 0); return; @@ -4639,6 +4926,25 @@ var CanvasGraphics = function CanvasGraphicsClosure() { var src = imgData.data; var dest = chunkImgData.data; var i, j, thisChunkHeight, elemsInThisChunk; + let transferMapRed, transferMapGreen, transferMapBlue, transferMapGray; + + if (transferMaps) { + switch (transferMaps.length) { + case 1: + transferMapRed = transferMaps[0]; + transferMapGreen = transferMaps[0]; + transferMapBlue = transferMaps[0]; + transferMapGray = transferMaps[0]; + break; + + case 4: + transferMapRed = transferMaps[0]; + transferMapGreen = transferMaps[1]; + transferMapBlue = transferMaps[2]; + transferMapGray = transferMaps[3]; + break; + } + } if (imgData.kind === _util.ImageKind.GRAYSCALE_1BPP) { var srcLength = src.byteLength; @@ -4648,13 +4954,19 @@ var CanvasGraphics = function CanvasGraphicsClosure() { var white = 0xffffffff; var black = _util.IsLittleEndianCached.value ? 0xff000000 : 0x000000ff; + if (transferMapGray) { + if (transferMapGray[0] === 0xff && transferMapGray[0xff] === 0) { + [white, black] = [black, white]; + } + } + for (i = 0; i < totalChunks; i++) { thisChunkHeight = i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight; destPos = 0; for (j = 0; j < thisChunkHeight; j++) { var srcDiff = srcLength - srcPos; - var k = 0; + let k = 0; var kEnd = srcDiff > fullSrcDiff ? width : srcDiff * 8 - 7; var kEndUnrolled = kEnd & ~7; var mask = 0; @@ -4690,12 +5002,30 @@ var CanvasGraphics = function CanvasGraphicsClosure() { ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); } } else if (imgData.kind === _util.ImageKind.RGBA_32BPP) { + const hasTransferMaps = !!(transferMapRed || transferMapGreen || transferMapBlue); j = 0; elemsInThisChunk = width * FULL_CHUNK_HEIGHT * 4; for (i = 0; i < fullChunks; i++) { dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk)); srcPos += elemsInThisChunk; + + if (hasTransferMaps) { + for (let k = 0; k < elemsInThisChunk; k += 4) { + if (transferMapRed) { + dest[k + 0] = transferMapRed[dest[k + 0]]; + } + + if (transferMapGreen) { + dest[k + 1] = transferMapGreen[dest[k + 1]]; + } + + if (transferMapBlue) { + dest[k + 2] = transferMapBlue[dest[k + 2]]; + } + } + } + ctx.putImageData(chunkImgData, 0, j); j += FULL_CHUNK_HEIGHT; } @@ -4703,9 +5033,27 @@ var CanvasGraphics = function CanvasGraphicsClosure() { if (i < totalChunks) { elemsInThisChunk = width * partialChunkHeight * 4; dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk)); + + if (hasTransferMaps) { + for (let k = 0; k < elemsInThisChunk; k += 4) { + if (transferMapRed) { + dest[k + 0] = transferMapRed[dest[k + 0]]; + } + + if (transferMapGreen) { + dest[k + 1] = transferMapGreen[dest[k + 1]]; + } + + if (transferMapBlue) { + dest[k + 2] = transferMapBlue[dest[k + 2]]; + } + } + } + ctx.putImageData(chunkImgData, 0, j); } } else if (imgData.kind === _util.ImageKind.RGB_24BPP) { + const hasTransferMaps = !!(transferMapRed || transferMapGreen || transferMapBlue); thisChunkHeight = FULL_CHUNK_HEIGHT; elemsInThisChunk = width * thisChunkHeight; @@ -4724,6 +5072,22 @@ var CanvasGraphics = function CanvasGraphicsClosure() { dest[destPos++] = 255; } + if (hasTransferMaps) { + for (let k = 0; k < destPos; k += 4) { + if (transferMapRed) { + dest[k + 0] = transferMapRed[dest[k + 0]]; + } + + if (transferMapGreen) { + dest[k + 1] = transferMapGreen[dest[k + 1]]; + } + + if (transferMapBlue) { + dest[k + 2] = transferMapBlue[dest[k + 2]]; + } + } + } + ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); } } else { @@ -5106,6 +5470,9 @@ var CanvasGraphics = function CanvasGraphicsClosure() { this.tempSMask = null; break; + + case "TR": + this.current.transferMaps = value; } } }, @@ -5207,22 +5574,22 @@ var CanvasGraphics = function CanvasGraphicsClosure() { var width = args[j++]; var height = args[j++]; - if (width === 0) { + if (width === 0 && ctx.lineWidth < this.getSinglePixelWidth()) { width = this.getSinglePixelWidth(); } - if (height === 0) { + if (height === 0 && ctx.lineWidth < this.getSinglePixelWidth()) { height = this.getSinglePixelWidth(); } var xw = x + width; var yh = y + height; - this.ctx.moveTo(x, y); - this.ctx.lineTo(xw, y); - this.ctx.lineTo(xw, yh); - this.ctx.lineTo(x, yh); - this.ctx.lineTo(x, y); - this.ctx.closePath(); + ctx.moveTo(x, y); + ctx.lineTo(xw, y); + ctx.lineTo(xw, yh); + ctx.lineTo(x, yh); + ctx.lineTo(x, y); + ctx.closePath(); break; case _util.OPS.moveTo: @@ -5275,19 +5642,21 @@ var CanvasGraphics = function CanvasGraphicsClosure() { var strokeColor = this.current.strokeColor; ctx.globalAlpha = this.current.strokeAlpha; - if (strokeColor && strokeColor.hasOwnProperty("type") && strokeColor.type === "Pattern") { - ctx.save(); - const transform = ctx.mozCurrentTransform; + if (this.contentVisible) { + if (strokeColor && strokeColor.hasOwnProperty("type") && strokeColor.type === "Pattern") { + ctx.save(); + const transform = ctx.mozCurrentTransform; - const scale = _util.Util.singularValueDecompose2dScale(transform)[0]; + const scale = _util.Util.singularValueDecompose2dScale(transform)[0]; - ctx.strokeStyle = strokeColor.getPattern(ctx, this); - ctx.lineWidth = Math.max(this.getSinglePixelWidth() * MIN_WIDTH_FACTOR, this.current.lineWidth * scale); - ctx.stroke(); - ctx.restore(); - } else { - ctx.lineWidth = Math.max(this.getSinglePixelWidth() * MIN_WIDTH_FACTOR, this.current.lineWidth); - ctx.stroke(); + ctx.strokeStyle = strokeColor.getPattern(ctx, this); + ctx.lineWidth = Math.max(this.getSinglePixelWidth() * MIN_WIDTH_FACTOR, this.current.lineWidth * scale); + ctx.stroke(); + ctx.restore(); + } else { + ctx.lineWidth = Math.max(this.getSinglePixelWidth() * MIN_WIDTH_FACTOR, this.current.lineWidth); + ctx.stroke(); + } } if (consumePath) { @@ -5318,11 +5687,13 @@ var CanvasGraphics = function CanvasGraphicsClosure() { needRestore = true; } - if (this.pendingEOFill) { - ctx.fill("evenodd"); - this.pendingEOFill = false; - } else { - ctx.fill(); + if (this.contentVisible) { + if (this.pendingEOFill) { + ctx.fill("evenodd"); + this.pendingEOFill = false; + } else { + ctx.fill(); + } } if (needRestore) { @@ -5667,15 +6038,15 @@ var CanvasGraphics = function CanvasGraphicsClosure() { } } - if (glyph.isInFont || font.missingFile) { + if (this.contentVisible && (glyph.isInFont || font.missingFile)) { if (simpleFillText && !accent) { ctx.fillText(character, scaledX, scaledY); } else { this.paintChar(character, scaledX, scaledY, patternTransform); if (accent) { - scaledAccentX = scaledX + accent.offset.x / fontSizeScale; - scaledAccentY = scaledY - accent.offset.y / fontSizeScale; + scaledAccentX = scaledX + fontSize * accent.offset.x / fontSizeScale; + scaledAccentY = scaledY - fontSize * accent.offset.y / fontSizeScale; this.paintChar(accent.fontChar, scaledAccentX, scaledAccentY, patternTransform); } } @@ -5747,12 +6118,14 @@ var CanvasGraphics = function CanvasGraphicsClosure() { continue; } - this.processingType3 = glyph; - this.save(); - ctx.scale(fontSize, fontSize); - ctx.transform.apply(ctx, fontMatrix); - this.executeOperatorList(operatorList); - this.restore(); + if (this.contentVisible) { + this.processingType3 = glyph; + this.save(); + ctx.scale(fontSize, fontSize); + ctx.transform.apply(ctx, fontMatrix); + this.executeOperatorList(operatorList); + this.restore(); + } var transformed = _util.Util.applyTransform([glyph.width, 0], fontMatrix); @@ -5809,6 +6182,10 @@ var CanvasGraphics = function CanvasGraphicsClosure() { this.current.patternFill = false; }, shadingFill: function CanvasGraphics_shadingFill(patternIR) { + if (!this.contentVisible) { + return; + } + var ctx = this.ctx; this.save(); var pattern = (0, _pattern_helper.getShadingPatternFromIR)(patternIR); @@ -5846,6 +6223,10 @@ var CanvasGraphics = function CanvasGraphicsClosure() { (0, _util.unreachable)("Should not call beginImageData"); }, paintFormXObjectBegin: function CanvasGraphics_paintFormXObjectBegin(matrix, bbox) { + if (!this.contentVisible) { + return; + } + this.save(); this.baseTransformStack.push(this.baseTransform); @@ -5864,10 +6245,18 @@ var CanvasGraphics = function CanvasGraphicsClosure() { } }, paintFormXObjectEnd: function CanvasGraphics_paintFormXObjectEnd() { + if (!this.contentVisible) { + return; + } + this.restore(); this.baseTransform = this.baseTransformStack.pop(); }, beginGroup: function CanvasGraphics_beginGroup(group) { + if (!this.contentVisible) { + return; + } + this.save(); var currentCtx = this.ctx; @@ -5949,6 +6338,10 @@ var CanvasGraphics = function CanvasGraphicsClosure() { this.current.activeSMask = null; }, endGroup: function CanvasGraphics_endGroup(group) { + if (!this.contentVisible) { + return; + } + this.groupLevel--; var groupCtx = this.ctx; this.ctx = this.groupStack.pop(); @@ -5997,6 +6390,10 @@ var CanvasGraphics = function CanvasGraphicsClosure() { this.restore(); }, paintImageMaskXObject: function CanvasGraphics_paintImageMaskXObject(img) { + if (!this.contentVisible) { + return; + } + var ctx = this.ctx; var width = img.width, height = img.height; @@ -6031,7 +6428,12 @@ var CanvasGraphics = function CanvasGraphicsClosure() { maskCtx.restore(); this.paintInlineImageXObject(maskCanvas.canvas); }, - paintImageMaskXObjectRepeat: function CanvasGraphics_paintImageMaskXObjectRepeat(imgData, scaleX, scaleY, positions) { + + paintImageMaskXObjectRepeat(imgData, scaleX, skewX = 0, skewY = 0, scaleY, positions) { + if (!this.contentVisible) { + return; + } + var width = imgData.width; var height = imgData.height; var fillColor = this.current.fillColor; @@ -6048,13 +6450,18 @@ var CanvasGraphics = function CanvasGraphicsClosure() { for (var i = 0, ii = positions.length; i < ii; i += 2) { ctx.save(); - ctx.transform(scaleX, 0, 0, scaleY, positions[i], positions[i + 1]); + ctx.transform(scaleX, skewX, skewY, scaleY, positions[i], positions[i + 1]); ctx.scale(1, -1); ctx.drawImage(maskCanvas.canvas, 0, 0, width, height, 0, -1, 1, 1); ctx.restore(); } }, + paintImageMaskXObjectGroup: function CanvasGraphics_paintImageMaskXObjectGroup(images) { + if (!this.contentVisible) { + return; + } + var ctx = this.ctx; var fillColor = this.current.fillColor; var isPatternFill = this.current.patternFill; @@ -6079,6 +6486,10 @@ var CanvasGraphics = function CanvasGraphicsClosure() { } }, paintImageXObject: function CanvasGraphics_paintImageXObject(objId) { + if (!this.contentVisible) { + return; + } + const imgData = objId.startsWith("g_") ? this.commonObjs.get(objId) : this.objs.get(objId); if (!imgData) { @@ -6089,6 +6500,10 @@ var CanvasGraphics = function CanvasGraphicsClosure() { this.paintInlineImageXObject(imgData); }, paintImageXObjectRepeat: function CanvasGraphics_paintImageXObjectRepeat(objId, scaleX, scaleY, positions) { + if (!this.contentVisible) { + return; + } + const imgData = objId.startsWith("g_") ? this.commonObjs.get(objId) : this.objs.get(objId); if (!imgData) { @@ -6113,6 +6528,10 @@ var CanvasGraphics = function CanvasGraphicsClosure() { this.paintInlineImageXObjectGroup(imgData, map); }, paintInlineImageXObject: function CanvasGraphics_paintInlineImageXObject(imgData) { + if (!this.contentVisible) { + return; + } + var width = imgData.width; var height = imgData.height; var ctx = this.ctx; @@ -6132,7 +6551,7 @@ var CanvasGraphics = function CanvasGraphicsClosure() { } else { tmpCanvas = this.cachedCanvases.getCanvas("inlineImage", width, height); var tmpCtx = tmpCanvas.context; - putBinaryImageData(tmpCtx, imgData); + putBinaryImageData(tmpCtx, imgData, this.current.transferMaps); imgToPaint = tmpCanvas.canvas; } @@ -6180,12 +6599,16 @@ var CanvasGraphics = function CanvasGraphicsClosure() { this.restore(); }, paintInlineImageXObjectGroup: function CanvasGraphics_paintInlineImageXObjectGroup(imgData, map) { + if (!this.contentVisible) { + return; + } + var ctx = this.ctx; var w = imgData.width; var h = imgData.height; var tmpCanvas = this.cachedCanvases.getCanvas("inlineImage", w, h); var tmpCtx = tmpCanvas.context; - putBinaryImageData(tmpCtx, imgData); + putBinaryImageData(tmpCtx, imgData, this.current.transferMaps); for (var i = 0, ii = map.length; i < ii; i++) { var entry = map[i]; @@ -6209,16 +6632,36 @@ var CanvasGraphics = function CanvasGraphicsClosure() { } }, paintSolidColorImageMask: function CanvasGraphics_paintSolidColorImageMask() { + if (!this.contentVisible) { + return; + } + this.ctx.fillRect(0, 0, 1, 1); }, - paintXObject: function CanvasGraphics_paintXObject() { - (0, _util.warn)("Unsupported 'paintXObject' command."); - }, markPoint: function CanvasGraphics_markPoint(tag) {}, markPointProps: function CanvasGraphics_markPointProps(tag, properties) {}, - beginMarkedContent: function CanvasGraphics_beginMarkedContent(tag) {}, - beginMarkedContentProps: function CanvasGraphics_beginMarkedContentProps(tag, properties) {}, - endMarkedContent: function CanvasGraphics_endMarkedContent() {}, + beginMarkedContent: function CanvasGraphics_beginMarkedContent(tag) { + this.markedContentStack.push({ + visible: true + }); + }, + beginMarkedContentProps: function CanvasGraphics_beginMarkedContentProps(tag, properties) { + if (tag === "OC") { + this.markedContentStack.push({ + visible: this.optionalContentConfig.isVisible(properties) + }); + } else { + this.markedContentStack.push({ + visible: true + }); + } + + this.contentVisible = this.isContentVisible(); + }, + endMarkedContent: function CanvasGraphics_endMarkedContent() { + this.markedContentStack.pop(); + this.contentVisible = this.isContentVisible(); + }, beginCompat: function CanvasGraphics_beginCompat() {}, endCompat: function CanvasGraphics_endCompat() {}, consumePath: function CanvasGraphics_consumePath() { @@ -6249,6 +6692,15 @@ var CanvasGraphics = function CanvasGraphicsClosure() { getCanvasPosition: function CanvasGraphics_getCanvasPosition(x, y) { var transform = this.ctx.mozCurrentTransform; return [transform[0] * x + transform[2] * y + transform[4], transform[1] * x + transform[3] * y + transform[5]]; + }, + isContentVisible: function CanvasGraphics_isContentVisible() { + for (let i = this.markedContentStack.length - 1; i >= 0; i--) { + if (!this.markedContentStack[i].visible) { + return false; + } + } + + return true; } }; @@ -6262,7 +6714,7 @@ var CanvasGraphics = function CanvasGraphicsClosure() { exports.CanvasGraphics = CanvasGraphics; /***/ }), -/* 9 */ +/* 11 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -6743,7 +7195,7 @@ var TilingPattern = function TilingPatternClosure() { exports.TilingPattern = TilingPattern; /***/ }), -/* 10 */ +/* 12 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -6759,7 +7211,7 @@ GlobalWorkerOptions.workerPort = GlobalWorkerOptions.workerPort === undefined ? GlobalWorkerOptions.workerSrc = GlobalWorkerOptions.workerSrc === undefined ? "" : GlobalWorkerOptions.workerSrc; /***/ }), -/* 11 */ +/* 13 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -7260,7 +7712,7 @@ class MessageHandler { exports.MessageHandler = MessageHandler; /***/ }), -/* 12 */ +/* 14 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -7273,7 +7725,7 @@ exports.Metadata = void 0; var _util = __w_pdfjs_require__(2); -var _xml_parser = __w_pdfjs_require__(13); +var _xml_parser = __w_pdfjs_require__(15); class Metadata { constructor(data) { @@ -7370,13 +7822,7 @@ class Metadata { } getAll() { - const obj = Object.create(null); - - for (const [key, value] of this._metadataMap) { - obj[key] = value; - } - - return obj; + return Object.fromEntries(this._metadataMap); } has(name) { @@ -7388,7 +7834,7 @@ class Metadata { exports.Metadata = Metadata; /***/ }), -/* 13 */ +/* 15 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -7831,7 +8277,176 @@ class SimpleXMLParser extends XMLParserBase { exports.SimpleXMLParser = SimpleXMLParser; /***/ }), -/* 14 */ +/* 16 */ +/***/ (function(module, exports, __w_pdfjs_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.OptionalContentConfig = void 0; + +var _util = __w_pdfjs_require__(2); + +class OptionalContentGroup { + constructor(name, intent) { + this.visible = true; + this.name = name; + this.intent = intent; + } + +} + +class OptionalContentConfig { + constructor(data) { + this.name = null; + this.creator = null; + this._order = null; + this._groups = new Map(); + + if (data === null) { + return; + } + + 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)); + } + + if (data.baseState === "OFF") { + for (const group of this._groups) { + group.visible = false; + } + } + + for (const on of data.on) { + this._groups.get(on).visible = true; + } + + for (const off of data.off) { + this._groups.get(off).visible = false; + } + } + + isVisible(group) { + if (group.type === "OCG") { + 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; + } else if (group.type === "OCMD") { + if (group.expression) { + (0, _util.warn)("Visibility expression not supported yet."); + } + + if (!group.policy || group.policy === "AnyOn") { + for (const id of group.ids) { + if (!this._groups.has(id)) { + (0, _util.warn)(`Optional content group not found: ${id}`); + return true; + } + + if (this._groups.get(id).visible) { + return true; + } + } + + return false; + } else if (group.policy === "AllOn") { + for (const id of group.ids) { + if (!this._groups.has(id)) { + (0, _util.warn)(`Optional content group not found: ${id}`); + return true; + } + + if (!this._groups.get(id).visible) { + return false; + } + } + + return true; + } else if (group.policy === "AnyOff") { + for (const id of group.ids) { + if (!this._groups.has(id)) { + (0, _util.warn)(`Optional content group not found: ${id}`); + return true; + } + + if (!this._groups.get(id).visible) { + return true; + } + } + + return false; + } else if (group.policy === "AllOff") { + for (const id of group.ids) { + if (!this._groups.has(id)) { + (0, _util.warn)(`Optional content group not found: ${id}`); + return true; + } + + if (this._groups.get(id).visible) { + return false; + } + } + + return true; + } + + (0, _util.warn)(`Unknown optional content policy ${group.policy}.`); + return true; + } + + (0, _util.warn)(`Unknown group type ${group.type}.`); + 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; + +/***/ }), +/* 17 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -8186,7 +8801,7 @@ class PDFDataTransportStreamRangeReader { } /***/ }), -/* 15 */ +/* 18 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -8633,7 +9248,7 @@ var WebGLUtils = function WebGLUtilsClosure() { }(); /***/ }), -/* 16 */ +/* 19 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -8648,6 +9263,8 @@ var _display_utils = __w_pdfjs_require__(1); var _util = __w_pdfjs_require__(2); +var _annotation_storage = __w_pdfjs_require__(8); + class AnnotationElementFactory { static create(parameters) { const subtype = parameters.data.annotationType; @@ -8745,6 +9362,7 @@ class AnnotationElement { this.imageResourcesPath = parameters.imageResourcesPath; this.renderInteractiveForms = parameters.renderInteractiveForms; this.svgFactory = parameters.svgFactory; + this.annotationStorage = parameters.annotationStorage; if (isRenderable) { this.container = this._createContainer(ignoreBorder); @@ -8951,19 +9569,26 @@ class TextWidgetAnnotationElement extends WidgetAnnotationElement { render() { const TEXT_ALIGNMENT = ["left", "center", "right"]; + const storage = this.annotationStorage; + const id = this.data.id; this.container.className = "textWidgetAnnotation"; let element = null; if (this.renderInteractiveForms) { + const textContent = storage.getOrCreateValue(id, this.data.fieldValue); + if (this.data.multiLine) { element = document.createElement("textarea"); - element.textContent = this.data.fieldValue; + element.textContent = textContent; } else { element = document.createElement("input"); element.type = "text"; - element.setAttribute("value", this.data.fieldValue); + element.setAttribute("value", textContent); } + element.addEventListener("input", function (event) { + storage.setValue(id, event.target.value); + }); element.disabled = this.data.readOnly; element.name = this.data.fieldName; @@ -9031,16 +9656,23 @@ class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement { } render() { + const storage = this.annotationStorage; + const data = this.data; + const id = data.id; + const value = storage.getOrCreateValue(id, data.fieldValue && data.fieldValue !== "Off"); this.container.className = "buttonWidgetAnnotation checkBox"; const element = document.createElement("input"); - element.disabled = this.data.readOnly; + element.disabled = data.readOnly; element.type = "checkbox"; element.name = this.data.fieldName; - if (this.data.fieldValue && this.data.fieldValue !== "Off") { + if (value) { element.setAttribute("checked", true); } + element.addEventListener("change", function (event) { + storage.setValue(id, event.target.checked); + }); this.container.appendChild(element); return this.container; } @@ -9054,15 +9686,30 @@ class RadioButtonWidgetAnnotationElement extends WidgetAnnotationElement { render() { this.container.className = "buttonWidgetAnnotation radioButton"; + const storage = this.annotationStorage; + const data = this.data; + const id = data.id; + const value = storage.getOrCreateValue(id, data.fieldValue === data.buttonValue); const element = document.createElement("input"); - element.disabled = this.data.readOnly; + element.disabled = data.readOnly; element.type = "radio"; - element.name = this.data.fieldName; + element.name = data.fieldName; - if (this.data.fieldValue === this.data.buttonValue) { + if (value) { element.setAttribute("checked", true); } + element.addEventListener("change", function (event) { + const name = event.target.name; + + for (const radio of document.getElementsByName(name)) { + if (radio !== event.target) { + storage.setValue(radio.parentNode.getAttribute("data-annotation-id"), false); + } + } + + storage.setValue(id, event.target.checked); + }); this.container.appendChild(element); return this.container; } @@ -9085,6 +9732,9 @@ class ChoiceWidgetAnnotationElement extends WidgetAnnotationElement { render() { this.container.className = "choiceWidgetAnnotation"; + const storage = this.annotationStorage; + const id = this.data.id; + storage.getOrCreateValue(id, this.data.fieldValue.length > 0 ? this.data.fieldValue[0] : null); const selectElement = document.createElement("select"); selectElement.disabled = this.data.readOnly; selectElement.name = this.data.fieldName; @@ -9102,13 +9752,18 @@ class ChoiceWidgetAnnotationElement extends WidgetAnnotationElement { optionElement.textContent = option.displayValue; optionElement.value = option.exportValue; - if (this.data.fieldValue.includes(option.displayValue)) { + if (this.data.fieldValue.includes(option.exportValue)) { optionElement.setAttribute("selected", true); } selectElement.appendChild(optionElement); } + selectElement.addEventListener("input", function (event) { + const options = event.target.options; + const value = options[options.selectedIndex].value; + storage.setValue(id, value); + }); this.container.appendChild(selectElement); return this.container; } @@ -9642,8 +10297,9 @@ class AnnotationLayer { linkService: parameters.linkService, downloadManager: parameters.downloadManager, imageResourcesPath: parameters.imageResourcesPath || "", - renderInteractiveForms: parameters.renderInteractiveForms || false, - svgFactory: new _display_utils.DOMSVGFactory() + renderInteractiveForms: typeof parameters.renderInteractiveForms === "boolean" ? parameters.renderInteractiveForms : true, + svgFactory: new _display_utils.DOMSVGFactory(), + annotationStorage: parameters.annotationStorage || new _annotation_storage.AnnotationStorage() }); if (element.isRenderable) { @@ -9669,7 +10325,7 @@ class AnnotationLayer { exports.AnnotationLayer = AnnotationLayer; /***/ }), -/* 17 */ +/* 20 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -10116,6 +10772,7 @@ var renderTextLayer = function renderTextLayerClosure() { this._textContent = textContent; this._textContentStream = textContentStream; this._container = container; + this._document = container.ownerDocument; this._viewport = viewport; this._textDivs = textDivs || []; this._textContentItemsStr = textContentItemsStr || []; @@ -10222,7 +10879,9 @@ var renderTextLayer = function renderTextLayerClosure() { _render: function TextLayer_render(timeout) { const capability = (0, _util.createPromiseCapability)(); let styleCache = Object.create(null); - const canvas = document.createElement("canvas"); + + const canvas = this._document.createElement("canvas"); + canvas.mozOpaque = true; this._layoutTextCtx = canvas.getContext("2d", { alpha: false @@ -10364,7 +11023,7 @@ var renderTextLayer = function renderTextLayerClosure() { exports.renderTextLayer = renderTextLayer; /***/ }), -/* 18 */ +/* 21 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -11769,7 +12428,7 @@ exports.SVGGraphics = SVGGraphics; } paintImageXObject(objId) { - const imgData = this.objs.get(objId); + const imgData = objId.startsWith("g_") ? this.commonObjs.get(objId) : this.objs.get(objId); if (!imgData) { (0, _util.warn)(`Dependent image with object ID ${objId} is not ready yet`); @@ -11890,7 +12549,7 @@ exports.SVGGraphics = SVGGraphics; } /***/ }), -/* 19 */ +/* 22 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -11903,7 +12562,7 @@ exports.PDFNodeStream = void 0; var _util = __w_pdfjs_require__(2); -var _network_utils = __w_pdfjs_require__(20); +var _network_utils = __w_pdfjs_require__(23); ; @@ -12359,7 +13018,7 @@ class PDFNodeStreamFsRangeReader extends BaseRangeReader { } /***/ }), -/* 20 */ +/* 23 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -12375,7 +13034,7 @@ exports.validateResponseStatus = validateResponseStatus; var _util = __w_pdfjs_require__(2); -var _content_disposition = __w_pdfjs_require__(21); +var _content_disposition = __w_pdfjs_require__(24); function validateRangeRequestCapabilities({ getResponseHeader, @@ -12451,7 +13110,7 @@ function validateResponseStatus(status) { } /***/ }), -/* 21 */ +/* 24 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -12639,7 +13298,7 @@ function getFilenameFromContentDispositionHeader(contentDisposition) { } /***/ }), -/* 22 */ +/* 25 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -12652,7 +13311,7 @@ exports.PDFNetworkStream = void 0; var _util = __w_pdfjs_require__(2); -var _network_utils = __w_pdfjs_require__(20); +var _network_utils = __w_pdfjs_require__(23); ; const OK_RESPONSE = 200; @@ -12820,14 +13479,6 @@ class NetworkManager { } } - hasPendingRequests() { - for (const xhrId in this.pendingRequests) { - return true; - } - - return false; - } - getRequestXhr(xhrId) { return this.pendingRequests[xhrId].xhr; } @@ -12836,12 +13487,6 @@ class NetworkManager { return xhrId in this.pendingRequests; } - abortAllRequests() { - for (const xhrId in this.pendingRequests) { - this.abortRequest(xhrId | 0); - } - } - abortRequest(xhrId) { const xhr = this.pendingRequests[xhrId].xhr; delete this.pendingRequests[xhrId]; @@ -13196,7 +13841,7 @@ class PDFNetworkStreamRangeRequestReader { } /***/ }), -/* 23 */ +/* 26 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -13209,7 +13854,7 @@ exports.PDFFetchStream = void 0; var _util = __w_pdfjs_require__(2); -var _network_utils = __w_pdfjs_require__(20); +var _network_utils = __w_pdfjs_require__(23); ; @@ -13434,6 +14079,12 @@ class PDFFetchStreamRangeReader { this._readCapability.resolve(); this._reader = response.body.getReader(); + }).catch(reason => { + if (reason && reason.name === "AbortError") { + return; + } + + throw reason; }); this.onProgress = null; } diff --git a/third-party/pdfjs/build/pdf.worker.js b/third-party/pdfjs/build/pdf.worker.js index af4e46699..58bdf7c19 100644 --- a/third-party/pdfjs/build/pdf.worker.js +++ b/third-party/pdfjs/build/pdf.worker.js @@ -135,8 +135,8 @@ Object.defineProperty(exports, "WorkerMessageHandler", { var _worker = __w_pdfjs_require__(1); -const pdfjsVersion = '2.5.207'; -const pdfjsBuild = '0974d6052'; +const pdfjsVersion = '2.6.347'; +const pdfjsBuild = '3be9c65f'; /***/ }), /* 1 */ @@ -156,47 +156,47 @@ var _primitives = __w_pdfjs_require__(5); var _pdf_manager = __w_pdfjs_require__(6); +var _writer = __w_pdfjs_require__(27); + var _is_node = __w_pdfjs_require__(4); -var _message_handler = __w_pdfjs_require__(45); +var _message_handler = __w_pdfjs_require__(46); -var _worker_stream = __w_pdfjs_require__(46); +var _worker_stream = __w_pdfjs_require__(47); var _core_utils = __w_pdfjs_require__(8); -var WorkerTask = function WorkerTaskClosure() { - function WorkerTask(name) { +class WorkerTask { + constructor(name) { this.name = name; this.terminated = false; this._capability = (0, _util.createPromiseCapability)(); } - WorkerTask.prototype = { - get finished() { - return this._capability.promise; - }, + get finished() { + return this._capability.promise; + } - finish() { - this._capability.resolve(); - }, + finish() { + this._capability.resolve(); + } - terminate() { - this.terminated = true; - }, + terminate() { + this.terminated = true; + } - ensureNotTerminated() { - if (this.terminated) { - throw new Error("Worker task was terminated"); - } + ensureNotTerminated() { + if (this.terminated) { + throw new Error("Worker task was terminated"); } + } - }; - return WorkerTask; -}(); +} exports.WorkerTask = WorkerTask; -var WorkerMessageHandler = { - setup(handler, port) { + +class WorkerMessageHandler { + static setup(handler, port) { var testMessageProcessed = false; handler.on("test", function wphSetupTest(data) { if (testMessageProcessed) { @@ -222,16 +222,16 @@ var WorkerMessageHandler = { handler.on("GetDocRequest", function wphSetupDoc(data) { return WorkerMessageHandler.createDocumentHandler(data, port); }); - }, + } - createDocumentHandler(docParams, port) { + static createDocumentHandler(docParams, port) { var pdfManager; var terminated = false; var cancelXHRs = null; var WorkerTasks = []; const verbosity = (0, _util.getVerbosityLevel)(); const apiVersion = docParams.apiVersion; - const workerVersion = '2.5.207'; + const workerVersion = '2.6.347'; if (apiVersion !== workerVersion) { throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`); @@ -445,11 +445,11 @@ var WorkerMessageHandler = { function pdfManagerReady() { ensureNotTerminated(); - loadDocument(false).then(onSuccess, function loadFailure(ex) { + loadDocument(false).then(onSuccess, function (reason) { ensureNotTerminated(); - if (!(ex instanceof _core_utils.XRefParseException)) { - onFailure(ex); + if (!(reason instanceof _core_utils.XRefParseException)) { + onFailure(reason); return; } @@ -458,7 +458,7 @@ var WorkerMessageHandler = { ensureNotTerminated(); loadDocument(true).then(onSuccess, onFailure); }); - }, onFailure); + }); } ensureNotTerminated(); @@ -496,11 +496,12 @@ var WorkerMessageHandler = { }); }); }); - handler.on("GetPageIndex", function wphSetupGetPageIndex(data) { - var ref = _primitives.Ref.get(data.ref.num, data.ref.gen); + handler.on("GetPageIndex", function wphSetupGetPageIndex({ + ref + }) { + const pageRef = _primitives.Ref.get(ref.num, ref.gen); - var catalog = pdfManager.pdfDocument.catalog; - return catalog.getPageIndex(ref); + return pdfManager.ensureCatalog("getPageIndex", [pageRef]); }); handler.on("GetDestinations", function wphSetupGetDestinations(data) { return pdfManager.ensureCatalog("destinations"); @@ -532,6 +533,9 @@ var WorkerMessageHandler = { handler.on("GetOutline", function wphSetupGetOutline(data) { return pdfManager.ensureCatalog("documentOutline"); }); + handler.on("GetOptionalContentConfig", function (data) { + return pdfManager.ensureCatalog("optionalContentConfig"); + }); handler.on("GetPermissions", function (data) { return pdfManager.ensureCatalog("permissions"); }); @@ -545,7 +549,7 @@ var WorkerMessageHandler = { }); }); handler.on("GetStats", function wphSetupGetStats(data) { - return pdfManager.pdfDocument.xref.stats; + return pdfManager.ensureXRef("stats"); }); handler.on("GetAnnotations", function ({ pageIndex, @@ -555,6 +559,65 @@ var WorkerMessageHandler = { return page.getAnnotationsData(intent); }); }); + handler.on("SaveDocument", function ({ + numPages, + annotationStorage, + filename + }) { + pdfManager.requestLoadedStream(); + const promises = [pdfManager.onLoadedStream()]; + const document = pdfManager.pdfDocument; + + for (let pageIndex = 0; pageIndex < numPages; pageIndex++) { + promises.push(pdfManager.getPage(pageIndex).then(function (page) { + const task = new WorkerTask(`Save: page ${pageIndex}`); + return page.save(handler, task, annotationStorage); + })); + } + + return Promise.all(promises).then(([stream, ...refs]) => { + let newRefs = []; + + for (const ref of refs) { + newRefs = ref.filter(x => x !== null).reduce((a, b) => a.concat(b), newRefs); + } + + if (newRefs.length === 0) { + return stream.bytes; + } + + const xref = document.xref; + let newXrefInfo = Object.create(null); + + if (xref.trailer) { + const _info = Object.create(null); + + const xrefInfo = xref.trailer.get("Info") || null; + + if (xrefInfo) { + xrefInfo.forEach((key, value) => { + if ((0, _util.isString)(key) && (0, _util.isString)(value)) { + _info[key] = (0, _util.stringToPDFString)(value); + } + }); + } + + newXrefInfo = { + rootRef: xref.trailer.getRaw("Root") || null, + encrypt: xref.trailer.getRaw("Encrypt") || null, + newRef: xref.getNewRef(), + infoRef: xref.trailer.getRaw("Info") || null, + info: _info, + fileIds: xref.trailer.getRaw("ID") || null, + startXRef: document.startXRef, + filename + }; + } + + xref.resetNewRef(); + return (0, _writer.incrementalUpdate)(stream.bytes, newXrefInfo, newRefs); + }); + }); handler.on("GetOperatorList", function wphSetupRenderPage(data, sink) { var pageIndex = data.pageIndex; pdfManager.getPage(pageIndex).then(function (page) { @@ -566,7 +629,8 @@ var WorkerMessageHandler = { sink, task, intent: data.intent, - renderInteractiveForms: data.renderInteractiveForms + renderInteractiveForms: data.renderInteractiveForms, + annotationStorage: data.annotationStorage }).then(function (operatorListInfo) { finishWorkerTask(task); @@ -662,15 +726,16 @@ var WorkerMessageHandler = { docParams = null; }); return workerHandlerName; - }, + } - initializeFromPort(port) { + static initializeFromPort(port) { var handler = new _message_handler.MessageHandler("worker", "main", port); WorkerMessageHandler.setup(handler, port); handler.send("ready", null); } -}; +} + exports.WorkerMessageHandler = WorkerMessageHandler; function isMessagePort(maybePort) { @@ -696,12 +761,13 @@ exports.arraysToBytes = arraysToBytes; exports.assert = assert; exports.bytesToString = bytesToString; exports.createPromiseCapability = createPromiseCapability; +exports.escapeString = escapeString; +exports.getModificationDate = getModificationDate; exports.getVerbosityLevel = getVerbosityLevel; exports.info = info; exports.isArrayBuffer = isArrayBuffer; exports.isArrayEqual = isArrayEqual; exports.isBool = isBool; -exports.isEmptyObj = isEmptyObj; exports.isNum = isNum; exports.isString = isString; exports.isSameOrigin = isSameOrigin; @@ -1000,7 +1066,8 @@ const UNSUPPORTED_FEATURES = { errorOperatorList: "errorOperatorList", errorFontToUnicode: "errorFontToUnicode", errorFontLoadNative: "errorFontLoadNative", - errorFontGetPath: "errorFontGetPath" + errorFontGetPath: "errorFontGetPath", + errorMarkedContent: "errorMarkedContent" }; exports.UNSUPPORTED_FEATURES = UNSUPPORTED_FEATURES; const PasswordResponses = { @@ -1415,6 +1482,10 @@ function stringToPDFString(str) { return strBuf.join(""); } +function escapeString(str) { + return str.replace(/([\(\)\\])/g, "\\$1"); +} + function stringToUTF8String(str) { return decodeURIComponent(escape(str)); } @@ -1423,14 +1494,6 @@ function utf8StringToString(str) { return unescape(encodeURIComponent(str)); } -function isEmptyObj(obj) { - for (const key in obj) { - return false; - } - - return true; -} - function isBool(v) { return typeof v === "boolean"; } @@ -1457,6 +1520,11 @@ function isArrayEqual(arr1, arr2) { }); } +function getModificationDate(date = new Date(Date.now())) { + const buffer = [date.getUTCFullYear().toString(), (date.getUTCMonth() + 1).toString().padStart(2, "0"), (date.getUTCDate() + 1).toString().padStart(2, "0"), date.getUTCHours().toString().padStart(2, "0"), date.getUTCMinutes().toString().padStart(2, "0"), date.getUTCSeconds().toString().padStart(2, "0")]; + return buffer.join(""); +} + function createPromiseCapability() { const capability = Object.create(null); let isSettled = false; @@ -1531,7 +1599,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.isNodeJS = void 0; -const isNodeJS = typeof process === "object" && process + "" === "[object process]" && !process.versions.nw && !process.versions.electron; +const isNodeJS = typeof process === "object" && process + "" === "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser"); exports.isNodeJS = isNodeJS; /***/ }), @@ -1623,6 +1691,10 @@ var Dict = function DictClosure() { this.xref = newXref; }, + get size() { + return Object.keys(this._map).length; + }, + get(key1, key2, key3) { let value = this._map[key1]; @@ -1685,6 +1757,9 @@ var Dict = function DictClosure() { getKeys: function Dict_getKeys() { return Object.keys(this._map); }, + getRawValues: function Dict_getRawValues() { + return Object.values(this._map); + }, set: function Dict_set(key, value) { this._map[key] = value; }, @@ -1699,26 +1774,75 @@ var Dict = function DictClosure() { }; Dict.empty = new Dict(null); - Dict.merge = function (xref, dictArray) { + Dict.merge = function ({ + xref, + dictArray, + mergeSubDicts = false + }) { const mergedDict = new Dict(xref); - for (let i = 0, ii = dictArray.length; i < ii; i++) { - const dict = dictArray[i]; + if (!mergeSubDicts) { + for (const dict of dictArray) { + if (!(dict instanceof Dict)) { + continue; + } - if (!isDict(dict)) { + for (const [key, value] of Object.entries(dict._map)) { + if (mergedDict._map[key] === undefined) { + mergedDict._map[key] = value; + } + } + } + + return mergedDict.size > 0 ? mergedDict : Dict.empty; + } + + const properties = new Map(); + + for (const dict of dictArray) { + if (!(dict instanceof Dict)) { continue; } - for (const keyName in dict._map) { - if (mergedDict._map[keyName] !== undefined) { + for (const [key, value] of Object.entries(dict._map)) { + let property = properties.get(key); + + if (property === undefined) { + property = []; + properties.set(key, property); + } + + property.push(value); + } + } + + for (const [name, values] of properties) { + if (values.length === 1 || !(values[0] instanceof Dict)) { + mergedDict._map[name] = values[0]; + continue; + } + + const subDict = new Dict(xref); + + for (const dict of values) { + if (!(dict instanceof Dict)) { continue; } - mergedDict._map[keyName] = dict._map[keyName]; + for (const [key, value] of Object.entries(dict._map)) { + if (subDict._map[key] === undefined) { + subDict._map[key] = value; + } + } + } + + if (subDict.size > 0) { + mergedDict._map[name] = subDict; } } - return mergedDict; + properties.clear(); + return mergedDict.size > 0 ? mergedDict : Dict.empty; }; return Dict; @@ -1759,60 +1883,63 @@ var Ref = function RefClosure() { exports.Ref = Ref; -var RefSet = function RefSetClosure() { - function RefSet() { - this.dict = Object.create(null); +class RefSet { + constructor() { + this._set = new Set(); } - RefSet.prototype = { - has: function RefSet_has(ref) { - return ref.toString() in this.dict; - }, - put: function RefSet_put(ref) { - this.dict[ref.toString()] = true; - }, - remove: function RefSet_remove(ref) { - delete this.dict[ref.toString()]; - } - }; - return RefSet; -}(); + has(ref) { + return this._set.has(ref.toString()); + } + + put(ref) { + this._set.add(ref.toString()); + } + + remove(ref) { + this._set.delete(ref.toString()); + } + +} exports.RefSet = RefSet; -var RefSetCache = function RefSetCacheClosure() { - function RefSetCache() { - this.dict = Object.create(null); +class RefSetCache { + constructor() { + this._map = new Map(); } - RefSetCache.prototype = { - get size() { - return Object.keys(this.dict).length; - }, + get size() { + return this._map.size; + } - get: function RefSetCache_get(ref) { - return this.dict[ref.toString()]; - }, - has: function RefSetCache_has(ref) { - return ref.toString() in this.dict; - }, - put: function RefSetCache_put(ref, obj) { - this.dict[ref.toString()] = obj; - }, - putAlias: function RefSetCache_putAlias(ref, aliasRef) { - this.dict[ref.toString()] = this.get(aliasRef); - }, - forEach: function RefSetCache_forEach(callback) { - for (const i in this.dict) { - callback(this.dict[i]); - } - }, - clear: function RefSetCache_clear() { - this.dict = Object.create(null); + get(ref) { + return this._map.get(ref.toString()); + } + + has(ref) { + return this._map.has(ref.toString()); + } + + put(ref, obj) { + this._map.set(ref.toString(), obj); + } + + putAlias(ref, aliasRef) { + this._map.set(ref.toString(), this.get(aliasRef)); + } + + forEach(callback) { + for (const value of this._map.values()) { + callback(value); } - }; - return RefSetCache; -}(); + } + + clear() { + this._map.clear(); + } + +} exports.RefSetCache = RefSetCache; @@ -2082,8 +2209,7 @@ class ChunkedStream { this.pos = 0; this.end = length; this.chunkSize = chunkSize; - this.loadedChunks = []; - this.numChunksLoaded = 0; + this._loadedChunks = new Set(); this.numChunks = Math.ceil(length / chunkSize); this.manager = manager; this.progressiveDataLength = 0; @@ -2094,7 +2220,7 @@ class ChunkedStream { const chunks = []; for (let chunk = 0, n = this.numChunks; chunk < n; ++chunk) { - if (!this.loadedChunks[chunk]) { + if (!this._loadedChunks.has(chunk)) { chunks.push(chunk); } } @@ -2106,6 +2232,10 @@ class ChunkedStream { return [this]; } + get numChunksLoaded() { + return this._loadedChunks.size; + } + allChunksLoaded() { return this.numChunksLoaded === this.numChunks; } @@ -2128,10 +2258,7 @@ class ChunkedStream { const endChunk = Math.floor((end - 1) / chunkSize) + 1; for (let curChunk = beginChunk; curChunk < endChunk; ++curChunk) { - if (!this.loadedChunks[curChunk]) { - this.loadedChunks[curChunk] = true; - ++this.numChunksLoaded; - } + this._loadedChunks.add(curChunk); } } @@ -2144,10 +2271,7 @@ class ChunkedStream { const endChunk = position >= this.end ? this.numChunks : Math.floor(position / this.chunkSize); for (let curChunk = beginChunk; curChunk < endChunk; ++curChunk) { - if (!this.loadedChunks[curChunk]) { - this.loadedChunks[curChunk] = true; - ++this.numChunksLoaded; - } + this._loadedChunks.add(curChunk); } } @@ -2162,7 +2286,7 @@ class ChunkedStream { return; } - if (!this.loadedChunks[chunk]) { + if (!this._loadedChunks.has(chunk)) { throw new _core_utils.MissingDataException(pos, pos + 1); } @@ -2183,7 +2307,7 @@ class ChunkedStream { const endChunk = Math.floor((end - 1) / chunkSize) + 1; for (let chunk = beginChunk; chunk < endChunk; ++chunk) { - if (!this.loadedChunks[chunk]) { + if (!this._loadedChunks.has(chunk)) { throw new _core_utils.MissingDataException(begin, end); } } @@ -2195,7 +2319,7 @@ class ChunkedStream { for (let i = 0; i < numChunks; ++i) { const chunk = (beginChunk + i) % numChunks; - if (!this.loadedChunks[chunk]) { + if (!this._loadedChunks.has(chunk)) { return chunk; } } @@ -2204,7 +2328,7 @@ class ChunkedStream { } hasChunk(chunk) { - return !!this.loadedChunks[chunk]; + return this._loadedChunks.has(chunk); } get length() { @@ -2347,7 +2471,7 @@ class ChunkedStream { const missingChunks = []; for (let chunk = beginChunk; chunk < endChunk; ++chunk) { - if (!this.loadedChunks[chunk]) { + if (!this._loadedChunks.has(chunk)) { missingChunks.push(chunk); } } @@ -2383,9 +2507,9 @@ class ChunkedStreamManager { this.disableAutoFetch = args.disableAutoFetch; this.msgHandler = args.msgHandler; this.currRequestId = 0; - this.chunksNeededByRequest = Object.create(null); - this.requestsByChunk = Object.create(null); - this.promisesByRequest = Object.create(null); + this._chunksNeededByRequest = new Map(); + this._requestsByChunk = new Map(); + this._promisesByRequest = new Map(); this.progressiveDataLength = 0; this.aborted = false; this._loadedStreamCapability = (0, _util.createPromiseCapability)(); @@ -2454,47 +2578,57 @@ class ChunkedStreamManager { _requestChunks(chunks) { const requestId = this.currRequestId++; - const chunksNeeded = Object.create(null); - this.chunksNeededByRequest[requestId] = chunksNeeded; + const chunksNeeded = new Set(); + + this._chunksNeededByRequest.set(requestId, chunksNeeded); for (const chunk of chunks) { if (!this.stream.hasChunk(chunk)) { - chunksNeeded[chunk] = true; + chunksNeeded.add(chunk); } } - if ((0, _util.isEmptyObj)(chunksNeeded)) { + if (chunksNeeded.size === 0) { return Promise.resolve(); } const capability = (0, _util.createPromiseCapability)(); - this.promisesByRequest[requestId] = capability; + + this._promisesByRequest.set(requestId, capability); + const chunksToRequest = []; - for (let chunk in chunksNeeded) { - chunk = chunk | 0; + for (const chunk of chunksNeeded) { + let requestIds = this._requestsByChunk.get(chunk); + + if (!requestIds) { + requestIds = []; + + this._requestsByChunk.set(chunk, requestIds); - if (!(chunk in this.requestsByChunk)) { - this.requestsByChunk[chunk] = []; chunksToRequest.push(chunk); } - this.requestsByChunk[chunk].push(requestId); - } - - if (!chunksToRequest.length) { - return capability.promise; + requestIds.push(requestId); } - const groupedChunksToRequest = this.groupChunks(chunksToRequest); + if (chunksToRequest.length > 0) { + const groupedChunksToRequest = this.groupChunks(chunksToRequest); - for (const groupedChunk of groupedChunksToRequest) { - const begin = groupedChunk.beginChunk * this.chunkSize; - const end = Math.min(groupedChunk.endChunk * this.chunkSize, this.length); - this.sendRequest(begin, end); + for (const groupedChunk of groupedChunksToRequest) { + const begin = groupedChunk.beginChunk * this.chunkSize; + const end = Math.min(groupedChunk.endChunk * this.chunkSize, this.length); + this.sendRequest(begin, end); + } } - return capability.promise; + return capability.promise.catch(reason => { + if (this.aborted) { + return; + } + + throw reason; + }); } getStream() { @@ -2596,17 +2730,22 @@ class ChunkedStreamManager { const loadedRequests = []; for (let curChunk = beginChunk; curChunk < endChunk; ++curChunk) { - const requestIds = this.requestsByChunk[curChunk] || []; - delete this.requestsByChunk[curChunk]; + const requestIds = this._requestsByChunk.get(curChunk); + + if (!requestIds) { + continue; + } + + this._requestsByChunk.delete(curChunk); for (const requestId of requestIds) { - const chunksNeeded = this.chunksNeededByRequest[requestId]; + const chunksNeeded = this._chunksNeededByRequest.get(requestId); - if (curChunk in chunksNeeded) { - delete chunksNeeded[curChunk]; + if (chunksNeeded.has(curChunk)) { + chunksNeeded.delete(curChunk); } - if (!(0, _util.isEmptyObj)(chunksNeeded)) { + if (chunksNeeded.size > 0) { continue; } @@ -2614,7 +2753,7 @@ class ChunkedStreamManager { } } - if (!this.disableAutoFetch && (0, _util.isEmptyObj)(this.requestsByChunk)) { + if (!this.disableAutoFetch && this._requestsByChunk.size === 0) { let nextEmptyChunk; if (this.stream.numChunksLoaded === 1) { @@ -2633,8 +2772,10 @@ class ChunkedStreamManager { } for (const requestId of loadedRequests) { - const capability = this.promisesByRequest[requestId]; - delete this.promisesByRequest[requestId]; + const capability = this._promisesByRequest.get(requestId); + + this._promisesByRequest.delete(requestId); + capability.resolve(); } @@ -2663,8 +2804,8 @@ class ChunkedStreamManager { this.pdfNetworkStream.cancelAllRequests(reason); } - for (const requestId in this.promisesByRequest) { - this.promisesByRequest[requestId].reject(reason); + for (const capability of this._promisesByRequest.values()) { + capability.reject(reason); } } @@ -2839,9 +2980,7 @@ var _parser = __w_pdfjs_require__(11); var _operator_list = __w_pdfjs_require__(26); -var _evaluator = __w_pdfjs_require__(27); - -var _function = __w_pdfjs_require__(41); +var _evaluator = __w_pdfjs_require__(28); const DEFAULT_USER_UNIT = 1.0; const LETTER_SIZE_MEDIABOX = [0, 0, 612, 792]; @@ -2857,10 +2996,10 @@ class Page { pageIndex, pageDict, ref, + globalIdFactory, fontCache, builtInCMapCache, - globalImageCache, - pdfFunctionFactory + globalImageCache }) { this.pdfManager = pdfManager; this.pageIndex = pageIndex; @@ -2870,19 +3009,14 @@ class Page { this.fontCache = fontCache; this.builtInCMapCache = builtInCMapCache; this.globalImageCache = globalImageCache; - this.pdfFunctionFactory = pdfFunctionFactory; this.evaluatorOptions = pdfManager.evaluatorOptions; this.resourcesPromise = null; const idCounters = { obj: 0 }; - this.idFactory = { - createObjId() { + this._localIdFactory = class extends globalIdFactory { + static createObjId() { return `p${pageIndex}_${++idCounters.obj}`; - }, - - getDocId() { - return `g_${pdfManager.docId}`; } }; @@ -2904,7 +3038,10 @@ class Page { return value[0]; } - return _primitives.Dict.merge(this.xref, value); + return _primitives.Dict.merge({ + xref: this.xref, + dictArray: value + }); } get content() { @@ -3005,6 +3142,35 @@ class Page { return stream; } + save(handler, task, annotationStorage) { + const partialEvaluator = new _evaluator.PartialEvaluator({ + xref: this.xref, + handler, + pageIndex: this.pageIndex, + idFactory: this._localIdFactory, + fontCache: this.fontCache, + builtInCMapCache: this.builtInCMapCache, + globalImageCache: this.globalImageCache, + options: this.evaluatorOptions + }); + return this._parsedAnnotations.then(function (annotations) { + const newRefsPromises = []; + + for (const annotation of annotations) { + if (!isAnnotationRenderable(annotation, "print")) { + continue; + } + + newRefsPromises.push(annotation.save(partialEvaluator, task, annotationStorage).catch(function (reason) { + (0, _util.warn)("save - ignoring annotation data during " + `"${task.name}" task: "${reason}".`); + return null; + })); + } + + return Promise.all(newRefsPromises); + }); + } + loadResources(keys) { if (!this.resourcesPromise) { this.resourcesPromise = this.pdfManager.ensure(this, "resources"); @@ -3021,7 +3187,8 @@ class Page { sink, task, intent, - renderInteractiveForms + renderInteractiveForms, + annotationStorage }) { const contentStreamPromise = this.pdfManager.ensure(this, "getContentStream"); const resourcesPromise = this.loadResources(["ExtGState", "ColorSpace", "Pattern", "Shading", "XObject", "Font"]); @@ -3029,16 +3196,15 @@ class Page { xref: this.xref, handler, pageIndex: this.pageIndex, - idFactory: this.idFactory, + idFactory: this._localIdFactory, fontCache: this.fontCache, builtInCMapCache: this.builtInCMapCache, globalImageCache: this.globalImageCache, - options: this.evaluatorOptions, - pdfFunctionFactory: this.pdfFunctionFactory + options: this.evaluatorOptions }); const dataPromises = Promise.all([contentStreamPromise, resourcesPromise]); const pageListPromise = dataPromises.then(([contentStream]) => { - const opList = new _operator_list.OperatorList(intent, sink, this.pageIndex); + const opList = new _operator_list.OperatorList(intent, sink); handler.send("StartRenderPage", { transparency: partialEvaluator.hasBlendModes(this.resources), pageIndex: this.pageIndex, @@ -3065,7 +3231,7 @@ class Page { for (const annotation of annotations) { if (isAnnotationRenderable(annotation, intent)) { - opListPromises.push(annotation.getOperatorList(partialEvaluator, task, renderInteractiveForms).catch(function (reason) { + opListPromises.push(annotation.getOperatorList(partialEvaluator, task, renderInteractiveForms, annotationStorage).catch(function (reason) { (0, _util.warn)("getOperatorList - ignoring annotation data during " + `"${task.name}" task: "${reason}".`); return null; })); @@ -3103,12 +3269,11 @@ class Page { xref: this.xref, handler, pageIndex: this.pageIndex, - idFactory: this.idFactory, + idFactory: this._localIdFactory, fontCache: this.fontCache, builtInCMapCache: this.builtInCMapCache, globalImageCache: this.globalImageCache, - options: this.evaluatorOptions, - pdfFunctionFactory: this.pdfFunctionFactory + options: this.evaluatorOptions }); return partialEvaluator.getTextContent({ stream: contentStream, @@ -3144,7 +3309,7 @@ class Page { const annotationPromises = []; for (const annotationRef of this.annotations) { - annotationPromises.push(_annotation.AnnotationFactory.create(this.xref, annotationRef, this.pdfManager, this.idFactory).catch(function (reason) { + annotationPromises.push(_annotation.AnnotationFactory.create(this.xref, annotationRef, this.pdfManager, this._localIdFactory).catch(function (reason) { (0, _util.warn)(`_parsedAnnotations: "${reason}".`); return null; })); @@ -3235,53 +3400,33 @@ class PDFDocument { this.pdfManager = pdfManager; this.stream = stream; this.xref = new _obj.XRef(stream, pdfManager); - this.pdfFunctionFactory = new _function.PDFFunctionFactory({ - xref: this.xref, - isEvalSupported: pdfManager.evaluatorOptions.isEvalSupported - }); this._pagePromises = []; - } - - parse(recoveryMode) { - this.setup(recoveryMode); - const version = this.catalog.catDict.get("Version"); - - if ((0, _primitives.isName)(version)) { - this.pdfFormatVersion = version.name; - } - - try { - this.acroForm = this.catalog.catDict.get("AcroForm"); - - if (this.acroForm) { - this.xfa = this.acroForm.get("XFA"); - const fields = this.acroForm.get("Fields"); - - if ((!Array.isArray(fields) || fields.length === 0) && !this.xfa) { - this.acroForm = null; - } + this._version = null; + const idCounters = { + font: 0 + }; + this._globalIdFactory = class { + static getDocId() { + return `g_${pdfManager.docId}`; } - } catch (ex) { - if (ex instanceof _core_utils.MissingDataException) { - throw ex; + + static createFontId() { + return `f${++idCounters.font}`; } - (0, _util.info)("Cannot fetch AcroForm entry; assuming no AcroForms are present"); - this.acroForm = null; - } + static createObjId() { + (0, _util.unreachable)("Abstract method `createObjId` called."); + } - try { - const collection = this.catalog.catDict.get("Collection"); + }; + } - if ((0, _primitives.isDict)(collection) && collection.getKeys().length > 0) { - this.collection = collection; - } - } catch (ex) { - if (ex instanceof _core_utils.MissingDataException) { - throw ex; - } + parse(recoveryMode) { + this.xref.parse(recoveryMode); + this.catalog = new _obj.Catalog(this.pdfManager, this.xref); - (0, _util.info)("Cannot fetch Collection dictionary."); + if (this.catalog.version) { + this._version = this.catalog.version; } } @@ -3375,8 +3520,8 @@ class PDFDocument { version += String.fromCharCode(ch); } - if (!this.pdfFormatVersion) { - this.pdfFormatVersion = version.substring(5); + if (!this._version) { + this._version = version.substring(5); } } @@ -3384,17 +3529,66 @@ class PDFDocument { this.xref.setStartXRef(this.startXRef); } - setup(recoveryMode) { - this.xref.parse(recoveryMode); - this.catalog = new _obj.Catalog(this.pdfManager, this.xref); - } - get numPages() { const linearization = this.linearization; const num = linearization ? linearization.numPages : this.catalog.numPages; return (0, _util.shadow)(this, "numPages", num); } + _hasOnlyDocumentSignatures(fields, recursionDepth = 0) { + const RECURSION_LIMIT = 10; + return fields.every(field => { + field = this.xref.fetchIfRef(field); + + if (field.has("Kids")) { + if (++recursionDepth > RECURSION_LIMIT) { + (0, _util.warn)("_hasOnlyDocumentSignatures: maximum recursion depth reached"); + return false; + } + + return this._hasOnlyDocumentSignatures(field.get("Kids"), recursionDepth); + } + + const isSignature = (0, _primitives.isName)(field.get("FT"), "Sig"); + const rectangle = field.get("Rect"); + const isInvisible = Array.isArray(rectangle) && rectangle.every(value => value === 0); + return isSignature && isInvisible; + }); + } + + get formInfo() { + const formInfo = { + hasAcroForm: false, + hasXfa: false + }; + const acroForm = this.catalog.acroForm; + + if (!acroForm) { + return (0, _util.shadow)(this, "formInfo", formInfo); + } + + try { + const xfa = acroForm.get("XFA"); + const hasXfa = Array.isArray(xfa) && xfa.length > 0 || (0, _primitives.isStream)(xfa) && !xfa.isEmpty; + formInfo.hasXfa = hasXfa; + const fields = acroForm.get("Fields"); + const hasFields = Array.isArray(fields) && fields.length > 0; + const sigFlags = acroForm.get("SigFlags"); + + const hasOnlyDocumentSignatures = !!(sigFlags & 0x1) && this._hasOnlyDocumentSignatures(fields); + + formInfo.hasAcroForm = hasFields && !hasOnlyDocumentSignatures; + } catch (ex) { + if (ex instanceof _core_utils.MissingDataException) { + throw ex; + } + + (0, _util.info)("Cannot fetch form information."); + } + + return (0, _util.shadow)(this, "formInfo", formInfo); + } + get documentInfo() { const DocumentInfoValidators = { Title: _util.isString, @@ -3407,7 +3601,7 @@ class PDFDocument { ModDate: _util.isString, Trapped: _primitives.isName }; - let version = this.pdfFormatVersion; + let version = this._version; if (typeof version !== "string" || !PDF_HEADER_VERSION_REGEXP.test(version)) { (0, _util.warn)(`Invalid PDF header version number: ${version}`); @@ -3417,9 +3611,9 @@ class PDFDocument { const docInfo = { PDFFormatVersion: version, IsLinearized: !!this.linearization, - IsAcroFormPresent: !!this.acroForm, - IsXFAPresent: !!this.xfa, - IsCollectionPresent: !!this.collection + IsAcroFormPresent: this.formInfo.hasAcroForm, + IsXFAPresent: this.formInfo.hasXfa, + IsCollectionPresent: !!this.catalog.collection }; let infoDict; @@ -3528,10 +3722,10 @@ class PDFDocument { pageIndex, pageDict, ref, + globalIdFactory: this._globalIdFactory, fontCache: catalog.fontCache, builtInCMapCache: catalog.builtInCMapCache, - globalImageCache: catalog.globalImageCache, - pdfFunctionFactory: this.pdfFunctionFactory + globalImageCache: catalog.globalImageCache }); }); } @@ -3592,9 +3786,9 @@ class Catalog { constructor(pdfManager, xref) { this.pdfManager = pdfManager; this.xref = xref; - this.catDict = xref.getCatalogObj(); + this._catDict = xref.getCatalogObj(); - if (!(0, _primitives.isDict)(this.catDict)) { + if (!(0, _primitives.isDict)(this._catDict)) { throw new _util.FormatError("Catalog object is not a dictionary."); } @@ -3604,8 +3798,58 @@ class Catalog { this.pageKidsCountCache = new _primitives.RefSetCache(); } + get version() { + const version = this._catDict.get("Version"); + + if (!(0, _primitives.isName)(version)) { + return (0, _util.shadow)(this, "version", null); + } + + return (0, _util.shadow)(this, "version", version.name); + } + + get collection() { + let collection = null; + + try { + const obj = this._catDict.get("Collection"); + + if ((0, _primitives.isDict)(obj) && obj.size > 0) { + collection = obj; + } + } catch (ex) { + if (ex instanceof _core_utils.MissingDataException) { + throw ex; + } + + (0, _util.info)("Cannot fetch Collection entry; assuming no collection is present."); + } + + return (0, _util.shadow)(this, "collection", collection); + } + + get acroForm() { + let acroForm = null; + + try { + const obj = this._catDict.get("AcroForm"); + + if ((0, _primitives.isDict)(obj) && obj.size > 0) { + acroForm = obj; + } + } catch (ex) { + if (ex instanceof _core_utils.MissingDataException) { + throw ex; + } + + (0, _util.info)("Cannot fetch AcroForm entry; assuming no forms are present."); + } + + return (0, _util.shadow)(this, "acroForm", acroForm); + } + get metadata() { - const streamRef = this.catDict.getRaw("Metadata"); + const streamRef = this._catDict.getRaw("Metadata"); if (!(0, _primitives.isRef)(streamRef)) { return (0, _util.shadow)(this, "metadata", null); @@ -3636,7 +3880,7 @@ class Catalog { } get toplevelPagesDict() { - const pagesObj = this.catDict.get("Pages"); + const pagesObj = this._catDict.get("Pages"); if (!(0, _primitives.isDict)(pagesObj)) { throw new _util.FormatError("Invalid top-level pages dictionary."); @@ -3662,7 +3906,7 @@ class Catalog { } _readDocumentOutline() { - let obj = this.catDict.get("Outlines"); + let obj = this._catDict.get("Outlines"); if (!(0, _primitives.isDict)(obj)) { return null; @@ -3797,6 +4041,166 @@ class Catalog { return permissions; } + get optionalContentConfig() { + let config = null; + + try { + const properties = this._catDict.get("OCProperties"); + + if (!properties) { + return (0, _util.shadow)(this, "optionalContentConfig", null); + } + + const defaultConfig = properties.get("D"); + + if (!defaultConfig) { + return (0, _util.shadow)(this, "optionalContentConfig", null); + } + + const groupsData = properties.get("OCGs"); + + if (!Array.isArray(groupsData)) { + return (0, _util.shadow)(this, "optionalContentConfig", null); + } + + const groups = []; + const groupRefs = []; + + for (const groupRef of groupsData) { + if (!(0, _primitives.isRef)(groupRef)) { + continue; + } + + groupRefs.push(groupRef); + const group = this.xref.fetchIfRef(groupRef); + groups.push({ + id: groupRef.toString(), + name: (0, _util.isString)(group.get("Name")) ? (0, _util.stringToPDFString)(group.get("Name")) : null, + intent: (0, _util.isString)(group.get("Intent")) ? (0, _util.stringToPDFString)(group.get("Intent")) : null + }); + } + + config = this._readOptionalContentConfig(defaultConfig, groupRefs); + config.groups = groups; + } catch (ex) { + if (ex instanceof _core_utils.MissingDataException) { + throw ex; + } + + (0, _util.warn)(`Unable to read optional content config: ${ex}`); + } + + return (0, _util.shadow)(this, "optionalContentConfig", config); + } + + _readOptionalContentConfig(config, contentGroupRefs) { + function parseOnOff(refs) { + const onParsed = []; + + if (Array.isArray(refs)) { + for (const value of refs) { + if (!(0, _primitives.isRef)(value)) { + continue; + } + + if (contentGroupRefs.includes(value)) { + onParsed.push(value.toString()); + } + } + } + + 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")), + order: parseOrder(config.get("Order")), + groups: null + }; + } + get numPages() { const obj = this.toplevelPagesDict.get("Count"); @@ -3839,12 +4243,12 @@ class Catalog { } _readDests() { - const obj = this.catDict.get("Names"); + const obj = this._catDict.get("Names"); if (obj && obj.has("Dests")) { return new NameTree(obj.getRaw("Dests"), this.xref); - } else if (this.catDict.has("Dests")) { - return this.catDict.get("Dests"); + } else if (this._catDict.has("Dests")) { + return this._catDict.get("Dests"); } return undefined; @@ -3867,7 +4271,7 @@ class Catalog { } _readPageLabels() { - const obj = this.catDict.getRaw("PageLabels"); + const obj = this._catDict.getRaw("PageLabels"); if (!obj) { return null; @@ -3973,7 +4377,8 @@ class Catalog { } get pageLayout() { - const obj = this.catDict.get("PageLayout"); + const obj = this._catDict.get("PageLayout"); + let pageLayout = ""; if ((0, _primitives.isName)(obj)) { @@ -3992,7 +4397,8 @@ class Catalog { } get pageMode() { - const obj = this.catDict.get("PageMode"); + const obj = this._catDict.get("PageMode"); + let pageMode = "UseNone"; if ((0, _primitives.isName)(obj)) { @@ -4030,7 +4436,9 @@ class Catalog { PrintPageRange: Array.isArray, NumCopies: Number.isInteger }; - const obj = this.catDict.get("ViewerPreferences"); + + const obj = this._catDict.get("ViewerPreferences"); + let prefs = null; if ((0, _primitives.isDict)(obj)) { @@ -4171,7 +4579,8 @@ class Catalog { } get openAction() { - const obj = this.catDict.get("OpenAction"); + const obj = this._catDict.get("OpenAction"); + let openAction = null; if ((0, _primitives.isDict)(obj)) { @@ -4212,7 +4621,8 @@ class Catalog { } get attachments() { - const obj = this.catDict.get("Names"); + const obj = this._catDict.get("Names"); + let attachments = null; if (obj && obj.has("EmbeddedFiles")) { @@ -4234,7 +4644,8 @@ class Catalog { } get javaScript() { - const obj = this.catDict.get("Names"); + const obj = this._catDict.get("Names"); + let javaScript = null; function appendIfJavaScriptDict(jsDict) { @@ -4272,7 +4683,7 @@ class Catalog { } } - const openAction = this.catDict.get("OpenAction"); + const openAction = this._catDict.get("OpenAction"); if ((0, _primitives.isDict)(openAction) && (0, _primitives.isName)(openAction.get("S"), "JavaScript")) { appendIfJavaScriptDict(openAction); @@ -4318,7 +4729,7 @@ class Catalog { getPageDict(pageIndex) { const capability = (0, _util.createPromiseCapability)(); - const nodesToVisit = [this.catDict.getRaw("Pages")]; + const nodesToVisit = [this._catDict.getRaw("Pages")]; const visitedNodes = new _primitives.RefSet(); const xref = this.xref, pageKidsCountCache = this.pageKidsCountCache; @@ -4683,9 +5094,20 @@ var XRef = function XRefClosure() { streamTypes: Object.create(null), fontTypes: Object.create(null) }; + this._newRefNum = null; } XRef.prototype = { + getNewRef: function XRef_getNewRef() { + if (this._newRefNum === null) { + this._newRefNum = this.entries.length; + } + + return _primitives.Ref.get(this._newRefNum++, 0); + }, + resetNewRef: function XRef_resetNewRef() { + this._newRefNum = null; + }, setStartXRef: function XRef_setStartXRef(startXRef) { this.startXRefQueue = [startXRef]; }, @@ -5687,24 +6109,17 @@ const ObjectLoader = function () { } function addChildren(node, nodesToVisit) { - if (node instanceof _primitives.Dict || (0, _primitives.isStream)(node)) { - const dict = node instanceof _primitives.Dict ? node : node.dict; - const dictKeys = dict.getKeys(); - - for (let i = 0, ii = dictKeys.length; i < ii; i++) { - const rawValue = dict.getRaw(dictKeys[i]); - - if (mayHaveChildren(rawValue)) { - nodesToVisit.push(rawValue); - } - } - } else if (Array.isArray(node)) { - for (let i = 0, ii = node.length; i < ii; i++) { - const value = node[i]; + if (node instanceof _primitives.Dict) { + node = node.getRawValues(); + } else if ((0, _primitives.isStream)(node)) { + node = node.dict.getRawValues(); + } else if (!Array.isArray(node)) { + return; + } - if (mayHaveChildren(value)) { - nodesToVisit.push(value); - } + for (const rawValue of node) { + if (mayHaveChildren(rawValue)) { + nodesToVisit.push(rawValue); } } } @@ -5998,10 +6413,11 @@ class Parser { I = 0x49, SPACE = 0x20, LF = 0xa, - CR = 0xd; - const n = 10, + CR = 0xd, NUL = 0x0; - const startPos = stream.pos; + const lexer = this.lexer, + startPos = stream.pos, + n = 10; let state = 0, ch, maybeEIPos; @@ -6031,6 +6447,20 @@ class Parser { } } + if (state !== 2) { + continue; + } + + if (lexer.knownCommands) { + const nextObj = lexer.peekObj(); + + if (nextObj instanceof _primitives.Cmd && !lexer.knownCommands[nextObj.cmd]) { + state = 0; + } + } else { + (0, _util.warn)("findDefaultInlineStreamEnd - `lexer.knownCommands` is undefined."); + } + if (state === 2) { break; } @@ -7036,6 +7466,28 @@ class Lexer { return _primitives.Cmd.get(str); } + peekObj() { + const streamPos = this.stream.pos, + currentChar = this.currentChar, + beginInlineImagePos = this.beginInlineImagePos; + let nextObj; + + try { + nextObj = this.getObj(); + } catch (ex) { + if (ex instanceof _core_utils.MissingDataException) { + throw ex; + } + + (0, _util.warn)(`peekObj: ${ex}`); + } + + this.stream.pos = streamPos; + this.currentChar = currentChar; + this.beginInlineImagePos = beginInlineImagePos; + return nextObj; + } + skipToNextLine() { let ch = this.currentChar; @@ -12090,9 +12542,9 @@ var JpegImage = function JpegImageClosure() { } } else if (nextByte === 0xd9) { if (parseDNLMarker) { - const maybeScanLines = blockRow * 8; + const maybeScanLines = blockRow * (frame.precision === 8 ? 8 : 0); - if (maybeScanLines > 0 && maybeScanLines < frame.scanLines / 10) { + if (maybeScanLines > 0 && Math.round(frame.scanLines / maybeScanLines) >= 10) { throw new DNLMarkerError("Found EOI marker (0xFFD9) while parsing scan data, " + "possibly caused by incorrect `scanLines` parameter", maybeScanLines); } } @@ -12912,8 +13364,10 @@ var JpegImage = function JpegImageClosure() { component; for (i = 0; i < selectorsCount; i++) { - var componentIndex = frame.componentIds[data[offset++]]; + const index = data[offset++]; + var componentIndex = frame.componentIds[index]; component = frame.components[componentIndex]; + component.index = index; var tableSpec = data[offset++]; component.huffmanTableDC = huffmanTablesDC[tableSpec >> 4]; component.huffmanTableAC = huffmanTablesAC[tableSpec & 15]; @@ -12990,6 +13444,7 @@ var JpegImage = function JpegImageClosure() { } this.components.push({ + index: component.index, output: buildComponentData(frame, component), scaleX: component.h / frame.maxH, scaleY: component.v / frame.maxV, @@ -13070,6 +13525,8 @@ var JpegImage = function JpegImageClosure() { if (this.numComponents === 3) { if (this._colorTransform === 0) { return false; + } else if (this.components[0].index === 0x52 && this.components[1].index === 0x47 && this.components[2].index === 0x42) { + return false; } return true; @@ -15683,6 +16140,7 @@ var ARCFourCipher = function ARCFourCipherClosure() { } }; ARCFourCipher.prototype.decryptBlock = ARCFourCipher.prototype.encryptBlock; + ARCFourCipher.prototype.encrypt = ARCFourCipher.prototype.encryptBlock; return ARCFourCipher; }(); @@ -16222,6 +16680,9 @@ var NullCipher = function NullCipherClosure() { NullCipher.prototype = { decryptBlock: function NullCipher_decryptBlock(data) { return data; + }, + encrypt: function NullCipher_encrypt(data) { + return data; } }; return NullCipher; @@ -16835,6 +17296,39 @@ var CipherTransform = function CipherTransformClosure() { var data = (0, _util.stringToBytes)(s); data = cipher.decryptBlock(data, true); return (0, _util.bytesToString)(data); + }, + encryptString: function CipherTransform_encryptString(s) { + const cipher = new this.StringCipherConstructor(); + + if (cipher instanceof AESBaseCipher) { + const strLen = s.length; + const pad = 16 - strLen % 16; + + if (pad !== 16) { + s = s.padEnd(16 * Math.ceil(strLen / 16), String.fromCharCode(pad)); + } + + const iv = new Uint8Array(16); + + if (typeof crypto !== "undefined") { + crypto.getRandomValues(iv); + } else { + for (let i = 0; i < 16; i++) { + iv[i] = Math.floor(256 * Math.random()); + } + } + + let data = (0, _util.stringToBytes)(s); + data = cipher.encrypt(data, iv); + const buf = new Uint8Array(16 + data.length); + buf.set(iv); + buf.set(data, 16); + return (0, _util.bytesToString)(buf); + } + + let data = (0, _util.stringToBytes)(s); + data = cipher.encrypt(data); + return (0, _util.bytesToString)(data); } }; return CipherTransform; @@ -17220,6 +17714,8 @@ var _util = __w_pdfjs_require__(2); var _primitives = __w_pdfjs_require__(5); +var _core_utils = __w_pdfjs_require__(8); + function resizeRgbImage(src, dest, w1, h1, w2, h2, alpha01) { const COMPONENTS = 3; alpha01 = alpha01 !== 1 ? 0 : alpha01; @@ -17352,135 +17848,162 @@ class ColorSpace { return (0, _util.shadow)(this, "usesZeroToOneRange", true); } - static parse(cs, xref, res, pdfFunctionFactory) { - const IR = this.parseToIR(cs, xref, res, pdfFunctionFactory); - return this.fromIR(IR); - } + static _cache(cacheKey, xref, localColorSpaceCache, parsedColorSpace) { + if (!localColorSpaceCache) { + throw new Error('ColorSpace._cache - expected "localColorSpaceCache" argument.'); + } - static fromIR(IR) { - const name = Array.isArray(IR) ? IR[0] : IR; - let whitePoint, blackPoint, gamma; + if (!parsedColorSpace) { + throw new Error('ColorSpace._cache - expected "parsedColorSpace" argument.'); + } - switch (name) { - case "DeviceGrayCS": - return this.singletons.gray; + let csName, csRef; - case "DeviceRgbCS": - return this.singletons.rgb; + if (cacheKey instanceof _primitives.Ref) { + csRef = cacheKey; + cacheKey = xref.fetch(cacheKey); + } - case "DeviceCmykCS": - return this.singletons.cmyk; + if (cacheKey instanceof _primitives.Name) { + csName = cacheKey.name; + } - case "CalGrayCS": - whitePoint = IR[1]; - blackPoint = IR[2]; - gamma = IR[3]; - return new CalGrayCS(whitePoint, blackPoint, gamma); + if (csName || csRef) { + localColorSpaceCache.set(csName, csRef, parsedColorSpace); + } + } + + static getCached(cacheKey, xref, localColorSpaceCache) { + if (!localColorSpaceCache) { + throw new Error('ColorSpace.getCached - expected "localColorSpaceCache" argument.'); + } - case "CalRGBCS": - whitePoint = IR[1]; - blackPoint = IR[2]; - gamma = IR[3]; - const matrix = IR[4]; - return new CalRGBCS(whitePoint, blackPoint, gamma, matrix); + if (cacheKey instanceof _primitives.Ref) { + const localColorSpace = localColorSpaceCache.getByRef(cacheKey); - case "PatternCS": - let basePatternCS = IR[1]; + if (localColorSpace) { + return localColorSpace; + } - if (basePatternCS) { - basePatternCS = this.fromIR(basePatternCS); + try { + cacheKey = xref.fetch(cacheKey); + } catch (ex) { + if (ex instanceof _core_utils.MissingDataException) { + throw ex; } + } + } + + if (cacheKey instanceof _primitives.Name) { + const localColorSpace = localColorSpaceCache.getByName(cacheKey.name); + + if (localColorSpace) { + return localColorSpace; + } + } + + return null; + } - return new PatternCS(basePatternCS); + static async parseAsync({ + cs, + xref, + resources = null, + pdfFunctionFactory, + localColorSpaceCache + }) { + const parsedColorSpace = this._parse(cs, xref, resources, pdfFunctionFactory); - case "IndexedCS": - const baseIndexedCS = IR[1]; - const hiVal = IR[2]; - const lookup = IR[3]; - return new IndexedCS(this.fromIR(baseIndexedCS), hiVal, lookup); + this._cache(cs, xref, localColorSpaceCache, parsedColorSpace); - case "AlternateCS": - const numComps = IR[1]; - const alt = IR[2]; - const tintFn = IR[3]; - return new AlternateCS(numComps, this.fromIR(alt), tintFn); + return parsedColorSpace; + } - case "LabCS": - whitePoint = IR[1]; - blackPoint = IR[2]; - const range = IR[3]; - return new LabCS(whitePoint, blackPoint, range); + static parse({ + cs, + xref, + resources = null, + pdfFunctionFactory, + localColorSpaceCache + }) { + const cachedColorSpace = this.getCached(cs, xref, localColorSpaceCache); - default: - throw new _util.FormatError(`Unknown colorspace name: ${name}`); + if (cachedColorSpace) { + return cachedColorSpace; } + + const parsedColorSpace = this._parse(cs, xref, resources, pdfFunctionFactory); + + this._cache(cs, xref, localColorSpaceCache, parsedColorSpace); + + return parsedColorSpace; } - static parseToIR(cs, xref, res = null, pdfFunctionFactory) { + static _parse(cs, xref, resources = null, pdfFunctionFactory) { cs = xref.fetchIfRef(cs); if ((0, _primitives.isName)(cs)) { switch (cs.name) { case "DeviceGray": case "G": - return "DeviceGrayCS"; + return this.singletons.gray; case "DeviceRGB": case "RGB": - return "DeviceRgbCS"; + return this.singletons.rgb; case "DeviceCMYK": case "CMYK": - return "DeviceCmykCS"; + return this.singletons.cmyk; case "Pattern": - return ["PatternCS", null]; + return new PatternCS(null); default: - if ((0, _primitives.isDict)(res)) { - const colorSpaces = res.get("ColorSpace"); + if ((0, _primitives.isDict)(resources)) { + const colorSpaces = resources.get("ColorSpace"); if ((0, _primitives.isDict)(colorSpaces)) { - const resCS = colorSpaces.get(cs.name); + const resourcesCS = colorSpaces.get(cs.name); - if (resCS) { - if ((0, _primitives.isName)(resCS)) { - return this.parseToIR(resCS, xref, res, pdfFunctionFactory); + if (resourcesCS) { + if ((0, _primitives.isName)(resourcesCS)) { + return this._parse(resourcesCS, xref, resources, pdfFunctionFactory); } - cs = resCS; + cs = resourcesCS; break; } } } - throw new _util.FormatError(`unrecognized colorspace ${cs.name}`); + throw new _util.FormatError(`Unrecognized ColorSpace: ${cs.name}`); } } if (Array.isArray(cs)) { const mode = xref.fetchIfRef(cs[0]).name; - let numComps, params, alt, whitePoint, blackPoint, gamma; + let params, numComps, baseCS, whitePoint, blackPoint, gamma; switch (mode) { case "DeviceGray": case "G": - return "DeviceGrayCS"; + return this.singletons.gray; case "DeviceRGB": case "RGB": - return "DeviceRgbCS"; + return this.singletons.rgb; case "DeviceCMYK": case "CMYK": - return "DeviceCmykCS"; + return this.singletons.cmyk; case "CalGray": params = xref.fetchIfRef(cs[1]); whitePoint = params.getArray("WhitePoint"); blackPoint = params.getArray("BlackPoint"); gamma = params.get("Gamma"); - return ["CalGrayCS", whitePoint, blackPoint, gamma]; + return new CalGrayCS(whitePoint, blackPoint, gamma); case "CalRGB": params = xref.fetchIfRef(cs[1]); @@ -17488,77 +18011,71 @@ class ColorSpace { blackPoint = params.getArray("BlackPoint"); gamma = params.getArray("Gamma"); const matrix = params.getArray("Matrix"); - return ["CalRGBCS", whitePoint, blackPoint, gamma, matrix]; + return new CalRGBCS(whitePoint, blackPoint, gamma, matrix); case "ICCBased": const stream = xref.fetchIfRef(cs[1]); const dict = stream.dict; numComps = dict.get("N"); - alt = dict.get("Alternate"); + const alt = dict.get("Alternate"); if (alt) { - const altIR = this.parseToIR(alt, xref, res, pdfFunctionFactory); - const altCS = this.fromIR(altIR, pdfFunctionFactory); + const altCS = this._parse(alt, xref, resources, pdfFunctionFactory); if (altCS.numComps === numComps) { - return altIR; + return altCS; } (0, _util.warn)("ICCBased color space: Ignoring incorrect /Alternate entry."); } if (numComps === 1) { - return "DeviceGrayCS"; + return this.singletons.gray; } else if (numComps === 3) { - return "DeviceRgbCS"; + return this.singletons.rgb; } else if (numComps === 4) { - return "DeviceCmykCS"; + return this.singletons.cmyk; } break; case "Pattern": - let basePatternCS = cs[1] || null; + baseCS = cs[1] || null; - if (basePatternCS) { - basePatternCS = this.parseToIR(basePatternCS, xref, res, pdfFunctionFactory); + if (baseCS) { + baseCS = this._parse(baseCS, xref, resources, pdfFunctionFactory); } - return ["PatternCS", basePatternCS]; + return new PatternCS(baseCS); case "Indexed": case "I": - const baseIndexedCS = this.parseToIR(cs[1], xref, res, pdfFunctionFactory); + baseCS = this._parse(cs[1], xref, resources, pdfFunctionFactory); const hiVal = xref.fetchIfRef(cs[2]) + 1; - let lookup = xref.fetchIfRef(cs[3]); - - if ((0, _primitives.isStream)(lookup)) { - lookup = lookup.getBytes(); - } - - return ["IndexedCS", baseIndexedCS, hiVal, lookup]; + const lookup = xref.fetchIfRef(cs[3]); + return new IndexedCS(baseCS, hiVal, lookup); case "Separation": case "DeviceN": const name = xref.fetchIfRef(cs[1]); numComps = Array.isArray(name) ? name.length : 1; - alt = this.parseToIR(cs[2], xref, res, pdfFunctionFactory); - const tintFn = pdfFunctionFactory.create(xref.fetchIfRef(cs[3])); - return ["AlternateCS", numComps, alt, tintFn]; + baseCS = this._parse(cs[2], xref, resources, pdfFunctionFactory); + const tintFn = pdfFunctionFactory.create(cs[3]); + return new AlternateCS(numComps, baseCS, tintFn); case "Lab": params = xref.fetchIfRef(cs[1]); whitePoint = params.getArray("WhitePoint"); blackPoint = params.getArray("BlackPoint"); const range = params.getArray("Range"); - return ["LabCS", whitePoint, blackPoint, range]; + return new LabCS(whitePoint, blackPoint, range); default: - throw new _util.FormatError(`unimplemented color space object "${mode}"`); + throw new _util.FormatError(`Unimplemented ColorSpace object: ${mode}`); } } - throw new _util.FormatError(`unrecognized color space object: "${cs}"`); + throw new _util.FormatError(`Unrecognized ColorSpace object: ${cs}`); } static isDefaultDecode(decode, numComps) { @@ -17674,23 +18191,18 @@ class IndexedCS extends ColorSpace { super("Indexed", 1); this.base = base; this.highVal = highVal; - const baseNumComps = base.numComps; - const length = baseNumComps * highVal; + const length = base.numComps * highVal; + this.lookup = new Uint8Array(length); if ((0, _primitives.isStream)(lookup)) { - this.lookup = new Uint8Array(length); const bytes = lookup.getBytes(length); this.lookup.set(bytes); - } else if ((0, _util.isString)(lookup)) { - this.lookup = new Uint8Array(length); - + } else if (typeof lookup === "string") { for (let i = 0; i < length; ++i) { - this.lookup[i] = lookup.charCodeAt(i); + this.lookup[i] = lookup.charCodeAt(i) & 0xff; } - } else if (lookup instanceof Uint8Array) { - this.lookup = lookup; } else { - throw new _util.FormatError(`Unrecognized lookup table: ${lookup}`); + throw new _util.FormatError(`IndexedCS - unrecognized lookup table: ${lookup}`); } } @@ -17952,6 +18464,10 @@ const CalRGBCS = function CalRGBCSClosure() { return adjustToRange(0, 1, 12.92 * color); } + if (color >= 0.99554525) { + return 1; + } + return adjustToRange(0, 1, (1 + 0.055) * color ** (1 / 2.4) - 0.055); } @@ -18024,9 +18540,9 @@ const CalRGBCS = function CalRGBCSClosure() { const A = adjustToRange(0, 1, src[srcOffset] * scale); const B = adjustToRange(0, 1, src[srcOffset + 1] * scale); const C = adjustToRange(0, 1, src[srcOffset + 2] * scale); - const AGR = A ** cs.GR; - const BGG = B ** cs.GG; - const CGB = C ** cs.GB; + const AGR = A === 1 ? 1 : A ** cs.GR; + const BGG = B === 1 ? 1 : B ** cs.GG; + const CGB = C === 1 ? 1 : C ** cs.GB; const X = cs.MXA * AGR + cs.MXB * BGG + cs.MXC * CGB; const Y = cs.MYA * AGR + cs.MYB * BGG + cs.MYC * CGB; const Z = cs.MZA * AGR + cs.MZB * BGG + cs.MZC * CGB; @@ -18260,16 +18776,23 @@ const LabCS = function LabCSClosure() { Object.defineProperty(exports, "__esModule", { value: true }); -exports.GlobalImageCache = exports.LocalImageCache = void 0; +exports.GlobalImageCache = exports.LocalGStateCache = exports.LocalFunctionCache = exports.LocalColorSpaceCache = exports.LocalImageCache = void 0; var _util = __w_pdfjs_require__(2); var _primitives = __w_pdfjs_require__(5); -class LocalImageCache { - constructor() { - this._nameRefMap = new Map(); - this._imageMap = new Map(); +class BaseLocalCache { + constructor(options) { + if (this.constructor === BaseLocalCache) { + (0, _util.unreachable)("Cannot initialize BaseLocalCache."); + } + + if (!options || !options.onlyRefs) { + this._nameRefMap = new Map(); + this._imageMap = new Map(); + } + this._imageCache = new _primitives.RefSetCache(); } @@ -18287,6 +18810,13 @@ class LocalImageCache { return this._imageCache.get(ref) || null; } + set(name, ref, data) { + (0, _util.unreachable)("Abstract method `set` called."); + } + +} + +class LocalImageCache extends BaseLocalCache { set(name, ref = null, data) { if (!name) { throw new Error('LocalImageCache.set - expected "name" argument.'); @@ -18315,6 +18845,93 @@ class LocalImageCache { exports.LocalImageCache = LocalImageCache; +class LocalColorSpaceCache extends BaseLocalCache { + set(name = null, ref = null, data) { + if (!name && !ref) { + throw new Error('LocalColorSpaceCache.set - expected "name" and/or "ref" argument.'); + } + + if (ref) { + if (this._imageCache.has(ref)) { + return; + } + + if (name) { + this._nameRefMap.set(name, ref); + } + + this._imageCache.put(ref, data); + + return; + } + + if (this._imageMap.has(name)) { + return; + } + + this._imageMap.set(name, data); + } + +} + +exports.LocalColorSpaceCache = LocalColorSpaceCache; + +class LocalFunctionCache extends BaseLocalCache { + constructor(options) { + super({ + onlyRefs: true + }); + } + + getByName(name) { + (0, _util.unreachable)("Should not call `getByName` method."); + } + + set(name = null, ref, data) { + if (!ref) { + throw new Error('LocalFunctionCache.set - expected "ref" argument.'); + } + + if (this._imageCache.has(ref)) { + return; + } + + this._imageCache.put(ref, data); + } + +} + +exports.LocalFunctionCache = LocalFunctionCache; + +class LocalGStateCache extends BaseLocalCache { + set(name, ref = null, data) { + if (!name) { + throw new Error('LocalGStateCache.set - expected "name" argument.'); + } + + if (ref) { + if (this._imageCache.has(ref)) { + return; + } + + this._nameRefMap.set(name, ref); + + this._imageCache.put(ref, data); + + return; + } + + if (this._imageMap.has(name)) { + return; + } + + this._imageMap.set(name, data); + } + +} + +exports.LocalGStateCache = LocalGStateCache; + class GlobalImageCache { static get NUM_PAGES_THRESHOLD() { return (0, _util.shadow)(this, "NUM_PAGES_THRESHOLD", 2); @@ -18358,12 +18975,12 @@ class GlobalImageCache { } getData(ref, pageIndex) { - if (!this._refCache.has(ref)) { + const pageIndexSet = this._refCache.get(ref); + + if (!pageIndexSet) { return null; } - const pageIndexSet = this._refCache.get(ref); - if (pageIndexSet.size < GlobalImageCache.NUM_PAGES_THRESHOLD) { return null; } @@ -18432,12 +19049,16 @@ var _operator_list = __w_pdfjs_require__(26); var _stream = __w_pdfjs_require__(12); +var _writer = __w_pdfjs_require__(27); + class AnnotationFactory { static create(xref, ref, pdfManager, idFactory) { - return pdfManager.ensure(this, "_create", [xref, ref, pdfManager, idFactory]); + return pdfManager.ensureCatalog("acroForm").then(acroForm => { + return pdfManager.ensure(this, "_create", [xref, ref, pdfManager, idFactory, acroForm]); + }); } - static _create(xref, ref, pdfManager, idFactory) { + static _create(xref, ref, pdfManager, idFactory, acroForm) { const dict = xref.fetchIfRef(ref); if (!(0, _primitives.isDict)(dict)) { @@ -18449,10 +19070,12 @@ class AnnotationFactory { subtype = (0, _primitives.isName)(subtype) ? subtype.name : null; const parameters = { xref, + ref, dict, subtype, id, - pdfManager + pdfManager, + acroForm: acroForm instanceof _primitives.Dict ? acroForm : _primitives.Dict.empty }; switch (subtype) { @@ -18775,13 +19398,14 @@ class Annotation { }); } - getOperatorList(evaluator, task, renderForms) { + getOperatorList(evaluator, task, renderForms, annotationStorage) { if (!this.appearance) { return Promise.resolve(new _operator_list.OperatorList()); } + const appearance = this.appearance; const data = this.data; - const appearanceDict = this.appearance.dict; + const appearanceDict = appearance.dict; const resourcesPromise = this.loadResources(["ExtGState", "ColorSpace", "Pattern", "Shading", "XObject", "Font"]); const bbox = appearanceDict.getArray("BBox") || [0, 0, 1, 1]; const matrix = appearanceDict.getArray("Matrix") || [1, 0, 0, 1, 0, 0]; @@ -18790,18 +19414,22 @@ class Annotation { const opList = new _operator_list.OperatorList(); opList.addOp(_util.OPS.beginAnnotation, [data.rect, transform, matrix]); return evaluator.getOperatorList({ - stream: this.appearance, + stream: appearance, task, resources, operatorList: opList }).then(() => { opList.addOp(_util.OPS.endAnnotation, []); - this.appearance.reset(); + appearance.reset(); return opList; }); }); } + async save(evaluator, task, annotationStorage) { + return null; + } + } exports.Annotation = Annotation; @@ -18974,18 +19602,20 @@ class WidgetAnnotation extends Annotation { super(params); const dict = params.dict; const data = this.data; + this.ref = params.ref; data.annotationType = _util.AnnotationType.WIDGET; data.fieldName = this._constructFieldName(dict); - data.fieldValue = (0, _core_utils.getInheritableProperty)({ + const fieldValue = (0, _core_utils.getInheritableProperty)({ dict, key: "V", getArray: true }); + data.fieldValue = this._decodeFormValue(fieldValue); data.alternativeText = (0, _util.stringToPDFString)(dict.get("TU") || ""); data.defaultAppearance = (0, _core_utils.getInheritableProperty)({ dict, key: "DA" - }) || ""; + }) || params.acroForm.get("DA") || ""; const fieldType = (0, _core_utils.getInheritableProperty)({ dict, key: "FT" @@ -18994,7 +19624,7 @@ class WidgetAnnotation extends Annotation { this.fieldResources = (0, _core_utils.getInheritableProperty)({ dict, key: "DR" - }) || _primitives.Dict.empty; + }) || params.acroForm.get("DR") || _primitives.Dict.empty; data.fieldFlags = (0, _core_utils.getInheritableProperty)({ dict, key: "Ff" @@ -19045,16 +19675,225 @@ class WidgetAnnotation extends Annotation { return fieldName.join("."); } + _decodeFormValue(formValue) { + if (Array.isArray(formValue)) { + return formValue.filter(item => (0, _util.isString)(item)).map(item => (0, _util.stringToPDFString)(item)); + } else if ((0, _primitives.isName)(formValue)) { + return (0, _util.stringToPDFString)(formValue.name); + } else if ((0, _util.isString)(formValue)) { + return (0, _util.stringToPDFString)(formValue); + } + + return null; + } + hasFieldFlag(flag) { return !!(this.data.fieldFlags & flag); } - getOperatorList(evaluator, task, renderForms) { + getOperatorList(evaluator, task, renderForms, annotationStorage) { if (renderForms) { return Promise.resolve(new _operator_list.OperatorList()); } - return super.getOperatorList(evaluator, task, renderForms); + if (!this._hasText) { + return super.getOperatorList(evaluator, task, renderForms, annotationStorage); + } + + return this._getAppearance(evaluator, task, annotationStorage).then(content => { + if (this.appearance && content === null) { + return super.getOperatorList(evaluator, task, renderForms, annotationStorage); + } + + const operatorList = new _operator_list.OperatorList(); + + if (!this.data.defaultAppearance || content === null) { + return operatorList; + } + + const matrix = [1, 0, 0, 1, 0, 0]; + const bbox = [0, 0, this.data.rect[2] - this.data.rect[0], this.data.rect[3] - this.data.rect[1]]; + const transform = getTransformMatrix(this.data.rect, bbox, matrix); + operatorList.addOp(_util.OPS.beginAnnotation, [this.data.rect, transform, matrix]); + const stream = new _stream.StringStream(content); + return evaluator.getOperatorList({ + stream, + task, + resources: this.fieldResources, + operatorList + }).then(function () { + operatorList.addOp(_util.OPS.endAnnotation, []); + return operatorList; + }); + }); + } + + async save(evaluator, task, annotationStorage) { + if (this.data.fieldValue === annotationStorage[this.data.id]) { + return null; + } + + let appearance = await this._getAppearance(evaluator, task, annotationStorage); + + if (appearance === null) { + return null; + } + + const dict = evaluator.xref.fetchIfRef(this.ref); + + if (!(0, _primitives.isDict)(dict)) { + return null; + } + + const bbox = [0, 0, this.data.rect[2] - this.data.rect[0], this.data.rect[3] - this.data.rect[1]]; + const newRef = evaluator.xref.getNewRef(); + const AP = new _primitives.Dict(evaluator.xref); + AP.set("N", newRef); + const value = annotationStorage[this.data.id]; + const encrypt = evaluator.xref.encrypt; + let originalTransform = null; + let newTransform = null; + + if (encrypt) { + originalTransform = encrypt.createCipherTransform(this.ref.num, this.ref.gen); + newTransform = encrypt.createCipherTransform(newRef.num, newRef.gen); + appearance = newTransform.encryptString(appearance); + } + + dict.set("V", value); + dict.set("AP", AP); + dict.set("M", `D:${(0, _util.getModificationDate)()}`); + const appearanceDict = new _primitives.Dict(evaluator.xref); + appearanceDict.set("Length", appearance.length); + appearanceDict.set("Subtype", _primitives.Name.get("Form")); + appearanceDict.set("Resources", this.fieldResources); + appearanceDict.set("BBox", bbox); + const bufferOriginal = [`${this.ref.num} ${this.ref.gen} obj\n`]; + (0, _writer.writeDict)(dict, bufferOriginal, originalTransform); + bufferOriginal.push("\nendobj\n"); + const bufferNew = [`${newRef.num} ${newRef.gen} obj\n`]; + (0, _writer.writeDict)(appearanceDict, bufferNew, newTransform); + bufferNew.push(" stream\n"); + bufferNew.push(appearance); + bufferNew.push("\nendstream\nendobj\n"); + return [{ + ref: this.ref, + data: bufferOriginal.join("") + }, { + ref: newRef, + data: bufferNew.join("") + }]; + } + + async _getAppearance(evaluator, task, annotationStorage) { + const isPassword = this.hasFieldFlag(_util.AnnotationFieldFlag.PASSWORD); + + if (!annotationStorage || isPassword) { + return null; + } + + const value = annotationStorage[this.data.id]; + + if (value === "") { + return ""; + } + + const defaultPadding = 2; + const hPadding = defaultPadding; + const totalHeight = this.data.rect[3] - this.data.rect[1]; + const totalWidth = this.data.rect[2] - this.data.rect[0]; + const fontInfo = await this._getFontData(evaluator, task); + const [font, fontName] = fontInfo; + let fontSize = fontInfo[2]; + fontSize = this._computeFontSize(font, fontName, fontSize, totalHeight); + let descent = font.descent; + + if (isNaN(descent)) { + descent = 0; + } + + const vPadding = defaultPadding + Math.abs(descent) * fontSize; + const defaultAppearance = this.data.defaultAppearance; + const alignment = this.data.textAlignment; + + if (this.data.comb) { + return this._getCombAppearance(defaultAppearance, value, totalWidth, hPadding, vPadding); + } + + if (this.data.multiLine) { + return this._getMultilineAppearance(defaultAppearance, value, font, fontSize, totalWidth, totalHeight, alignment, hPadding, vPadding); + } + + if (alignment === 0 || alignment > 2) { + return "/Tx BMC q BT " + defaultAppearance + ` 1 0 0 1 ${hPadding} ${vPadding} Tm (${(0, _util.escapeString)(value)}) Tj` + " ET Q EMC"; + } + + const renderedText = this._renderText(value, font, fontSize, totalWidth, alignment, hPadding, vPadding); + + return "/Tx BMC q BT " + defaultAppearance + ` 1 0 0 1 0 0 Tm ${renderedText}` + " ET Q EMC"; + } + + async _getFontData(evaluator, task) { + const operatorList = new _operator_list.OperatorList(); + const initialState = { + fontSize: 0, + font: null, + fontName: null, + + clone() { + return this; + } + + }; + await evaluator.getOperatorList({ + stream: new _stream.StringStream(this.data.defaultAppearance), + task, + resources: this.fieldResources, + operatorList, + initialState + }); + return [initialState.font, initialState.fontName, initialState.fontSize]; + } + + _computeFontSize(font, fontName, fontSize, height) { + if (fontSize === null || fontSize === 0) { + const em = font.charsToGlyphs("M", true)[0].width / 1000; + const capHeight = 0.7 * em; + fontSize = Math.max(1, Math.floor(height / (1.5 * capHeight))); + let fontRegex = new RegExp(`/${fontName}\\s+[0-9\.]+\\s+Tf`); + + if (this.data.defaultAppearance.search(fontRegex) === -1) { + fontRegex = new RegExp(`/${fontName}\\s+Tf`); + } + + this.data.defaultAppearance = this.data.defaultAppearance.replace(fontRegex, `/${fontName} ${fontSize} Tf`); + } + + return fontSize; + } + + _renderText(text, font, fontSize, totalWidth, alignment, hPadding, vPadding) { + const glyphs = font.charsToGlyphs(text); + const scale = fontSize / 1000; + let width = 0; + + for (const glyph of glyphs) { + width += glyph.width * scale; + } + + let shift; + + if (alignment === 1) { + shift = (totalWidth - width) / 2; + } else if (alignment === 2) { + shift = totalWidth - width - hPadding; + } else { + shift = hPadding; + } + + shift = shift.toFixed(2); + vPadding = vPadding.toFixed(2); + return `${shift} ${vPadding} Td (${(0, _util.escapeString)(text)}) Tj`; } } @@ -19062,8 +19901,13 @@ class WidgetAnnotation extends Annotation { class TextWidgetAnnotation extends WidgetAnnotation { constructor(params) { super(params); + this._hasText = true; const dict = params.dict; - this.data.fieldValue = (0, _util.stringToPDFString)(this.data.fieldValue || ""); + + if (!(0, _util.isString)(this.data.fieldValue)) { + this.data.fieldValue = ""; + } + let alignment = (0, _core_utils.getInheritableProperty)({ dict, key: "Q" @@ -19088,26 +19932,86 @@ class TextWidgetAnnotation extends WidgetAnnotation { this.data.comb = this.hasFieldFlag(_util.AnnotationFieldFlag.COMB) && !this.hasFieldFlag(_util.AnnotationFieldFlag.MULTILINE) && !this.hasFieldFlag(_util.AnnotationFieldFlag.PASSWORD) && !this.hasFieldFlag(_util.AnnotationFieldFlag.FILESELECT) && this.data.maxLen !== null; } - getOperatorList(evaluator, task, renderForms) { - if (renderForms || this.appearance) { - return super.getOperatorList(evaluator, task, renderForms); + _getCombAppearance(defaultAppearance, text, width, hPadding, vPadding) { + const combWidth = (width / this.data.maxLen).toFixed(2); + const buf = []; + + for (const character of text) { + buf.push(`(${(0, _util.escapeString)(character)}) Tj`); } - const operatorList = new _operator_list.OperatorList(); + const renderedComb = buf.join(` ${combWidth} 0 Td `); + return "/Tx BMC q BT " + defaultAppearance + ` 1 0 0 1 ${hPadding} ${vPadding} Tm ${renderedComb}` + " ET Q EMC"; + } + + _getMultilineAppearance(defaultAppearance, text, font, fontSize, width, height, alignment, hPadding, vPadding) { + const lines = text.split(/\r\n|\r|\n/); + const buf = []; + const totalWidth = width - 2 * hPadding; - if (!this.data.defaultAppearance) { - return Promise.resolve(operatorList); + for (const line of lines) { + const chunks = this._splitLine(line, font, fontSize, totalWidth); + + for (const chunk of chunks) { + const padding = buf.length === 0 ? hPadding : 0; + buf.push(this._renderText(chunk, font, fontSize, width, alignment, padding, -fontSize)); + } } - const stream = new _stream.Stream((0, _util.stringToBytes)(this.data.defaultAppearance)); - return evaluator.getOperatorList({ - stream, - task, - resources: this.fieldResources, - operatorList - }).then(function () { - return operatorList; - }); + const renderedText = buf.join("\n"); + return "/Tx BMC q BT " + defaultAppearance + ` 1 0 0 1 0 ${height} Tm ${renderedText}` + " ET Q EMC"; + } + + _splitLine(line, font, fontSize, width) { + if (line.length <= 1) { + return [line]; + } + + const scale = fontSize / 1000; + const whitespace = font.charsToGlyphs(" ", true)[0].width * scale; + const chunks = []; + let lastSpacePos = -1, + startChunk = 0, + currentWidth = 0; + + for (let i = 0, ii = line.length; i < ii; i++) { + const character = line.charAt(i); + + if (character === " ") { + if (currentWidth + whitespace > width) { + chunks.push(line.substring(startChunk, i)); + startChunk = i; + currentWidth = whitespace; + lastSpacePos = -1; + } else { + currentWidth += whitespace; + lastSpacePos = i; + } + } else { + const charWidth = font.charsToGlyphs(character, false)[0].width * scale; + + if (currentWidth + charWidth > width) { + if (lastSpacePos !== -1) { + chunks.push(line.substring(startChunk, lastSpacePos + 1)); + startChunk = i = lastSpacePos + 1; + lastSpacePos = -1; + currentWidth = 0; + } else { + chunks.push(line.substring(startChunk, i)); + startChunk = i; + currentWidth = charWidth; + } + } else { + currentWidth += charWidth; + } + } + } + + if (startChunk < line.length) { + chunks.push(line.substring(startChunk, line.length)); + } + + return chunks; } } @@ -19115,6 +20019,8 @@ class TextWidgetAnnotation extends WidgetAnnotation { class ButtonWidgetAnnotation extends WidgetAnnotation { constructor(params) { super(params); + this.checkedAppearance = null; + this.uncheckedAppearance = null; this.data.checkBox = !this.hasFieldFlag(_util.AnnotationFieldFlag.RADIO) && !this.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON); this.data.radioButton = this.hasFieldFlag(_util.AnnotationFieldFlag.RADIO) && !this.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON); this.data.pushButton = this.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON); @@ -19130,31 +20036,171 @@ class ButtonWidgetAnnotation extends WidgetAnnotation { } } - _processCheckBox(params) { - if ((0, _primitives.isName)(this.data.fieldValue)) { - this.data.fieldValue = this.data.fieldValue.name; + getOperatorList(evaluator, task, renderForms, annotationStorage) { + if (this.data.pushButton) { + return super.getOperatorList(evaluator, task, false, annotationStorage); + } + + if (annotationStorage) { + const value = annotationStorage[this.data.id] || false; + let appearance; + + if (value) { + appearance = this.checkedAppearance; + } else { + appearance = this.uncheckedAppearance; + } + + if (appearance) { + const savedAppearance = this.appearance; + this.appearance = appearance; + const operatorList = super.getOperatorList(evaluator, task, renderForms, annotationStorage); + this.appearance = savedAppearance; + return operatorList; + } + + return Promise.resolve(new _operator_list.OperatorList()); } + return super.getOperatorList(evaluator, task, renderForms, annotationStorage); + } + + async save(evaluator, task, annotationStorage) { + if (this.data.checkBox) { + return this._saveCheckbox(evaluator, task, annotationStorage); + } + + if (this.data.radioButton) { + return this._saveRadioButton(evaluator, task, annotationStorage); + } + + return super.save(evaluator, task, annotationStorage); + } + + async _saveCheckbox(evaluator, task, annotationStorage) { + const defaultValue = this.data.fieldValue && this.data.fieldValue !== "Off"; + const value = annotationStorage[this.data.id]; + + if (defaultValue === value) { + return null; + } + + const dict = evaluator.xref.fetchIfRef(this.ref); + + if (!(0, _primitives.isDict)(dict)) { + return null; + } + + const name = _primitives.Name.get(value ? this.data.exportValue : "Off"); + + dict.set("V", name); + dict.set("AS", name); + dict.set("M", `D:${(0, _util.getModificationDate)()}`); + const encrypt = evaluator.xref.encrypt; + let originalTransform = null; + + if (encrypt) { + originalTransform = encrypt.createCipherTransform(this.ref.num, this.ref.gen); + } + + const buffer = [`${this.ref.num} ${this.ref.gen} obj\n`]; + (0, _writer.writeDict)(dict, buffer, originalTransform); + buffer.push("\nendobj\n"); + return [{ + ref: this.ref, + data: buffer.join("") + }]; + } + + async _saveRadioButton(evaluator, task, annotationStorage) { + const defaultValue = this.data.fieldValue === this.data.buttonValue; + const value = annotationStorage[this.data.id]; + + if (defaultValue === value) { + return null; + } + + const dict = evaluator.xref.fetchIfRef(this.ref); + + if (!(0, _primitives.isDict)(dict)) { + return null; + } + + const name = _primitives.Name.get(value ? this.data.buttonValue : "Off"); + + let parentBuffer = null; + const encrypt = evaluator.xref.encrypt; + + if (value) { + if ((0, _primitives.isRef)(this.parent)) { + const parent = evaluator.xref.fetch(this.parent); + let parentTransform = null; + + if (encrypt) { + parentTransform = encrypt.createCipherTransform(this.parent.num, this.parent.gen); + } + + parent.set("V", name); + parentBuffer = [`${this.parent.num} ${this.parent.gen} obj\n`]; + (0, _writer.writeDict)(parent, parentBuffer, parentTransform); + parentBuffer.push("\nendobj\n"); + } else if ((0, _primitives.isDict)(this.parent)) { + this.parent.set("V", name); + } + } + + dict.set("AS", name); + dict.set("M", `D:${(0, _util.getModificationDate)()}`); + let originalTransform = null; + + if (encrypt) { + originalTransform = encrypt.createCipherTransform(this.ref.num, this.ref.gen); + } + + const buffer = [`${this.ref.num} ${this.ref.gen} obj\n`]; + (0, _writer.writeDict)(dict, buffer, originalTransform); + buffer.push("\nendobj\n"); + const newRefs = [{ + ref: this.ref, + data: buffer.join("") + }]; + + if (parentBuffer !== null) { + newRefs.push({ + ref: this.parent, + data: parentBuffer.join("") + }); + } + + return newRefs; + } + + _processCheckBox(params) { const customAppearance = params.dict.get("AP"); if (!(0, _primitives.isDict)(customAppearance)) { return; } - const exportValueOptionsDict = customAppearance.get("D"); + const normalAppearance = customAppearance.get("N"); - if (!(0, _primitives.isDict)(exportValueOptionsDict)) { + if (!(0, _primitives.isDict)(normalAppearance)) { return; } - const exportValues = exportValueOptionsDict.getKeys(); - const hasCorrectOptionCount = exportValues.length === 2; + const exportValues = normalAppearance.getKeys(); + + if (!exportValues.includes("Off")) { + exportValues.push("Off"); + } - if (!hasCorrectOptionCount) { + if (exportValues.length !== 2) { return; } this.data.exportValue = exportValues[0] === "Off" ? exportValues[1] : exportValues[0]; + this.checkedAppearance = normalAppearance.get(this.data.exportValue); + this.uncheckedAppearance = normalAppearance.get("Off") || null; } _processRadioButton(params) { @@ -19165,7 +20211,8 @@ class ButtonWidgetAnnotation extends WidgetAnnotation { const fieldParentValue = fieldParent.get("V"); if ((0, _primitives.isName)(fieldParentValue)) { - this.data.fieldValue = fieldParentValue.name; + this.parent = params.dict.getRaw("Parent"); + this.data.fieldValue = this._decodeFormValue(fieldParentValue); } } @@ -19175,18 +20222,21 @@ class ButtonWidgetAnnotation extends WidgetAnnotation { return; } - const normalAppearanceState = appearanceStates.get("N"); + const normalAppearance = appearanceStates.get("N"); - if (!(0, _primitives.isDict)(normalAppearanceState)) { + if (!(0, _primitives.isDict)(normalAppearance)) { return; } - for (const key of normalAppearanceState.getKeys()) { + for (const key of normalAppearance.getKeys()) { if (key !== "Off") { this.data.buttonValue = key; break; } } + + this.checkedAppearance = normalAppearance.get(this.data.buttonValue); + this.uncheckedAppearance = normalAppearance.get("Off") || null; } _processPushButton(params) { @@ -19220,18 +20270,21 @@ class ChoiceWidgetAnnotation extends WidgetAnnotation { const option = xref.fetchIfRef(options[i]); const isOptionArray = Array.isArray(option); this.data.options[i] = { - exportValue: isOptionArray ? xref.fetchIfRef(option[0]) : option, - displayValue: (0, _util.stringToPDFString)(isOptionArray ? xref.fetchIfRef(option[1]) : option) + exportValue: this._decodeFormValue(isOptionArray ? xref.fetchIfRef(option[0]) : option), + displayValue: this._decodeFormValue(isOptionArray ? xref.fetchIfRef(option[1]) : option) }; } } - if (!Array.isArray(this.data.fieldValue)) { + if ((0, _util.isString)(this.data.fieldValue)) { this.data.fieldValue = [this.data.fieldValue]; + } else if (!this.data.fieldValue) { + this.data.fieldValue = []; } this.data.combo = this.hasFieldFlag(_util.AnnotationFieldFlag.COMBO); this.data.multiSelect = this.hasFieldFlag(_util.AnnotationFieldFlag.MULTISELECT); + this._hasText = true; } } @@ -19686,18 +20739,20 @@ var QueueOptimizer = function QueueOptimizerClosure() { var isSameImage = false; var iTransform, transformArgs; var firstPIMXOArg0 = argsArray[iFirstPIMXO][0]; + const firstTransformArg0 = argsArray[iFirstTransform][0], + firstTransformArg1 = argsArray[iFirstTransform][1], + firstTransformArg2 = argsArray[iFirstTransform][2], + firstTransformArg3 = argsArray[iFirstTransform][3]; - if (argsArray[iFirstTransform][1] === 0 && argsArray[iFirstTransform][2] === 0) { + if (firstTransformArg1 === firstTransformArg2) { isSameImage = true; - var firstTransformArg0 = argsArray[iFirstTransform][0]; - var firstTransformArg3 = argsArray[iFirstTransform][3]; iTransform = iFirstTransform + 4; var iPIMXO = iFirstPIMXO + 4; for (q = 1; q < count; q++, iTransform += 4, iPIMXO += 4) { transformArgs = argsArray[iTransform]; - if (argsArray[iPIMXO][0] !== firstPIMXOArg0 || transformArgs[0] !== firstTransformArg0 || transformArgs[1] !== 0 || transformArgs[2] !== 0 || transformArgs[3] !== firstTransformArg3) { + if (argsArray[iPIMXO][0] !== firstPIMXOArg0 || transformArgs[0] !== firstTransformArg0 || transformArgs[1] !== firstTransformArg1 || transformArgs[2] !== firstTransformArg2 || transformArgs[3] !== firstTransformArg3) { if (q < MIN_IMAGES_IN_MASKS_BLOCK) { isSameImage = false; } else { @@ -19721,7 +20776,7 @@ var QueueOptimizer = function QueueOptimizerClosure() { } fnArray.splice(iFirstSave, count * 4, _util.OPS.paintImageMaskXObjectRepeat); - argsArray.splice(iFirstSave, count * 4, [firstPIMXOArg0, firstTransformArg0, firstTransformArg3, positions]); + argsArray.splice(iFirstSave, count * 4, [firstPIMXOArg0, firstTransformArg0, firstTransformArg1, firstTransformArg2, firstTransformArg3, positions]); } else { count = Math.min(count, MAX_IMAGES_IN_MASKS_BLOCK); var images = []; @@ -20017,7 +21072,7 @@ var OperatorList = function OperatorListClosure() { var CHUNK_SIZE = 1000; var CHUNK_SIZE_ABOUT = CHUNK_SIZE - 5; - function OperatorList(intent, streamSink, pageIndex) { + function OperatorList(intent, streamSink) { this._streamSink = streamSink; this.fnArray = []; this.argsArray = []; @@ -20028,10 +21083,8 @@ var OperatorList = function OperatorListClosure() { this.optimizer = new NullOptimizer(this); } - this.dependencies = Object.create(null); + this.dependencies = new Set(); this._totalLength = 0; - this.pageIndex = pageIndex; - this.intent = intent; this.weight = 0; this._resolved = streamSink ? null : Promise.resolve(); } @@ -20063,17 +21116,17 @@ var OperatorList = function OperatorListClosure() { }, addDependency(dependency) { - if (dependency in this.dependencies) { + if (this.dependencies.has(dependency)) { return; } - this.dependencies[dependency] = true; + this.dependencies.add(dependency); this.addOp(_util.OPS.dependency, [dependency]); }, addDependencies(dependencies) { - for (var key in dependencies) { - this.addDependency(key); + for (const dependency of dependencies) { + this.addDependency(dependency); } }, @@ -20083,7 +21136,9 @@ var OperatorList = function OperatorListClosure() { return; } - Object.assign(this.dependencies, opList.dependencies); + for (const dependency of opList.dependencies) { + this.dependencies.add(dependency); + } for (var i = 0, ii = opList.length; i < ii; i++) { this.addOp(opList.fnArray[i], opList.argsArray[i]); @@ -20137,7 +21192,7 @@ var OperatorList = function OperatorListClosure() { length }, 1, this._transfers); - this.dependencies = Object.create(null); + this.dependencies.clear(); this.fnArray.length = 0; this.argsArray.length = 0; this.weight = 0; @@ -20160,2833 +21215,3319 @@ exports.OperatorList = OperatorList; Object.defineProperty(exports, "__esModule", { value: true }); -exports.PartialEvaluator = void 0; +exports.writeDict = writeDict; +exports.incrementalUpdate = incrementalUpdate; var _util = __w_pdfjs_require__(2); -var _cmap = __w_pdfjs_require__(28); - var _primitives = __w_pdfjs_require__(5); -var _fonts = __w_pdfjs_require__(29); +var _crypto = __w_pdfjs_require__(22); -var _encodings = __w_pdfjs_require__(32); +function writeDict(dict, buffer, transform) { + buffer.push("<<"); -var _core_utils = __w_pdfjs_require__(8); + for (const key of dict.getKeys()) { + buffer.push(` /${key} `); + writeValue(dict.getRaw(key), buffer, transform); + } -var _unicode = __w_pdfjs_require__(35); + buffer.push(">>"); +} -var _standard_fonts = __w_pdfjs_require__(34); +function writeStream(stream, buffer, transform) { + writeDict(stream.dict, buffer, transform); + buffer.push(" stream\n"); + let string = (0, _util.bytesToString)(stream.getBytes()); -var _pattern = __w_pdfjs_require__(38); + if (transform !== null) { + string = transform.encryptString(string); + } -var _parser = __w_pdfjs_require__(11); + buffer.push(string); + buffer.push("\nendstream\n"); +} -var _bidi = __w_pdfjs_require__(39); +function writeArray(array, buffer, transform) { + buffer.push("["); + let first = true; -var _colorspace = __w_pdfjs_require__(23); + for (const val of array) { + if (!first) { + buffer.push(" "); + } else { + first = false; + } -var _stream = __w_pdfjs_require__(12); + writeValue(val, buffer, transform); + } -var _glyphlist = __w_pdfjs_require__(33); + buffer.push("]"); +} -var _metrics = __w_pdfjs_require__(40); +function numberToString(value) { + if (Number.isInteger(value)) { + return value.toString(); + } -var _function = __w_pdfjs_require__(41); + const roundedValue = Math.round(value * 100); -var _image_utils = __w_pdfjs_require__(24); + if (roundedValue % 100 === 0) { + return (roundedValue / 100).toString(); + } -var _murmurhash = __w_pdfjs_require__(43); + if (roundedValue % 10 === 0) { + return value.toFixed(1); + } -var _operator_list = __w_pdfjs_require__(26); + return value.toFixed(2); +} -var _image = __w_pdfjs_require__(44); +function writeValue(value, buffer, transform) { + if ((0, _primitives.isName)(value)) { + buffer.push(`/${value.name}`); + } else if ((0, _primitives.isRef)(value)) { + buffer.push(`${value.num} ${value.gen} R`); + } else if (Array.isArray(value)) { + writeArray(value, buffer, transform); + } else if (typeof value === "string") { + if (transform !== null) { + value = transform.encryptString(value); + } + + buffer.push(`(${(0, _util.escapeString)(value)})`); + } else if (typeof value === "number") { + buffer.push(numberToString(value)); + } else if ((0, _primitives.isDict)(value)) { + writeDict(value, buffer, transform); + } else if ((0, _primitives.isStream)(value)) { + writeStream(value, buffer, transform); + } +} -var PartialEvaluator = function PartialEvaluatorClosure() { - const DefaultPartialEvaluatorOptions = { - maxImageSize: -1, - disableFontFace: false, - ignoreErrors: false, - isEvalSupported: true, - fontExtraProperties: false - }; +function writeInt(number, size, offset, buffer) { + for (let i = size + offset - 1; i > offset - 1; i--) { + buffer[i] = number & 0xff; + number >>= 8; + } - function PartialEvaluator({ - xref, - handler, - pageIndex, - idFactory, - fontCache, - builtInCMapCache, - globalImageCache, - options = null, - pdfFunctionFactory - }) { - this.xref = xref; - this.handler = handler; - this.pageIndex = pageIndex; - this.idFactory = idFactory; - this.fontCache = fontCache; - this.builtInCMapCache = builtInCMapCache; - this.globalImageCache = globalImageCache; - this.options = options || DefaultPartialEvaluatorOptions; - this.pdfFunctionFactory = pdfFunctionFactory; - this.parsingType3Font = false; + return offset + size; +} - this.fetchBuiltInCMap = async name => { - if (this.builtInCMapCache.has(name)) { - return this.builtInCMapCache.get(name); - } +function writeString(string, offset, buffer) { + for (let i = 0, len = string.length; i < len; i++) { + buffer[offset + i] = string.charCodeAt(i) & 0xff; + } +} - const readableStream = this.handler.sendWithStream("FetchBuiltInCMap", { - name - }); - const reader = readableStream.getReader(); - const data = await new Promise(function (resolve, reject) { - function pump() { - reader.read().then(function ({ - value, - done - }) { - if (done) { - return; - } +function computeMD5(filesize, xrefInfo) { + const time = Math.floor(Date.now() / 1000); + const filename = xrefInfo.filename || ""; + const md5Buffer = [time.toString(), filename, filesize.toString()]; + let md5BufferLen = md5Buffer.reduce((a, str) => a + str.length, 0); - resolve(value); - pump(); - }, reject); - } + for (const value of Object.values(xrefInfo.info)) { + md5Buffer.push(value); + md5BufferLen += value.length; + } - pump(); - }); + const array = new Uint8Array(md5BufferLen); + let offset = 0; - if (data.compressionType !== _util.CMapCompressionType.NONE) { - this.builtInCMapCache.set(name, data); - } + for (const str of md5Buffer) { + writeString(str, offset, array); + offset += str.length; + } - return data; - }; + return (0, _util.bytesToString)((0, _crypto.calculateMD5)(array)); +} + +function incrementalUpdate(originalData, xrefInfo, newRefs) { + const newXref = new _primitives.Dict(null); + const refForXrefTable = xrefInfo.newRef; + let buffer, baseOffset; + const lastByte = originalData[originalData.length - 1]; + + if (lastByte === 0x0a || lastByte === 0x0d) { + buffer = []; + baseOffset = originalData.length; + } else { + buffer = ["\n"]; + baseOffset = originalData.length + 1; } - var TIME_SLOT_DURATION_MS = 20; - var CHECK_TIME_EVERY = 100; + newXref.set("Size", refForXrefTable.num + 1); + newXref.set("Prev", xrefInfo.startXRef); + newXref.set("Type", _primitives.Name.get("XRef")); - function TimeSlotManager() { - this.reset(); + if (xrefInfo.rootRef !== null) { + newXref.set("Root", xrefInfo.rootRef); } - TimeSlotManager.prototype = { - check: function TimeSlotManager_check() { - if (++this.checked < CHECK_TIME_EVERY) { - return false; - } + if (xrefInfo.infoRef !== null) { + newXref.set("Info", xrefInfo.infoRef); + } - this.checked = 0; - return this.endTime <= Date.now(); - }, - reset: function TimeSlotManager_reset() { - this.endTime = Date.now() + TIME_SLOT_DURATION_MS; - this.checked = 0; - } - }; + if (xrefInfo.encrypt !== null) { + newXref.set("Encrypt", xrefInfo.encrypt); + } - function normalizeBlendMode(value, parsingArray = false) { - if (Array.isArray(value)) { - for (let i = 0, ii = value.length; i < ii; i++) { - const maybeBM = normalizeBlendMode(value[i], true); + newRefs.push({ + ref: refForXrefTable, + data: "" + }); + newRefs = newRefs.sort((a, b) => { + return a.ref.num - b.ref.num; + }); + const xrefTableData = [[0, 1, 0xffff]]; + const indexes = [0, 1]; + let maxOffset = 0; - if (maybeBM) { - return maybeBM; - } - } + for (const { + ref, + data + } of newRefs) { + maxOffset = Math.max(maxOffset, baseOffset); + xrefTableData.push([1, baseOffset, Math.min(ref.gen, 0xffff)]); + baseOffset += data.length; + indexes.push(ref.num); + indexes.push(1); + buffer.push(data); + } + + newXref.set("Index", indexes); + + if (xrefInfo.fileIds.length !== 0) { + const md5 = computeMD5(baseOffset, xrefInfo); + newXref.set("ID", [xrefInfo.fileIds[0], md5]); + } + + const offsetSize = Math.ceil(Math.log2(maxOffset) / 8); + const sizes = [1, offsetSize, 2]; + const structSize = sizes[0] + sizes[1] + sizes[2]; + const tableLength = structSize * xrefTableData.length; + newXref.set("W", sizes); + newXref.set("Length", tableLength); + buffer.push(`${refForXrefTable.num} ${refForXrefTable.gen} obj\n`); + writeDict(newXref, buffer, null); + buffer.push(" stream\n"); + const bufferLen = buffer.reduce((a, str) => a + str.length, 0); + const footer = `\nendstream\nendobj\nstartxref\n${baseOffset}\n%%EOF\n`; + const array = new Uint8Array(originalData.length + bufferLen + tableLength + footer.length); + array.set(originalData); + let offset = originalData.length; + + for (const str of buffer) { + writeString(str, offset, array); + offset += str.length; + } + + for (const [type, objOffset, gen] of xrefTableData) { + offset = writeInt(type, sizes[0], offset, array); + offset = writeInt(objOffset, sizes[1], offset, array); + offset = writeInt(gen, sizes[2], offset, array); + } + + writeString(footer, offset, array); + return array; +} - (0, _util.warn)(`Unsupported blend mode Array: ${value}`); - return "source-over"; - } +/***/ }), +/* 28 */ +/***/ (function(module, exports, __w_pdfjs_require__) { - if (!(0, _primitives.isName)(value)) { - if (parsingArray) { - return null; - } +"use strict"; - return "source-over"; - } - switch (value.name) { - case "Normal": - case "Compatible": - return "source-over"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.PartialEvaluator = void 0; + +var _util = __w_pdfjs_require__(2); + +var _cmap = __w_pdfjs_require__(29); + +var _primitives = __w_pdfjs_require__(5); + +var _fonts = __w_pdfjs_require__(30); - case "Multiply": - return "multiply"; +var _encodings = __w_pdfjs_require__(33); - case "Screen": - return "screen"; +var _core_utils = __w_pdfjs_require__(8); + +var _unicode = __w_pdfjs_require__(36); + +var _standard_fonts = __w_pdfjs_require__(35); - case "Overlay": - return "overlay"; +var _pattern = __w_pdfjs_require__(39); + +var _function = __w_pdfjs_require__(40); + +var _parser = __w_pdfjs_require__(11); - case "Darken": - return "darken"; +var _image_utils = __w_pdfjs_require__(24); - case "Lighten": - return "lighten"; +var _bidi = __w_pdfjs_require__(42); - case "ColorDodge": - return "color-dodge"; +var _colorspace = __w_pdfjs_require__(23); - case "ColorBurn": - return "color-burn"; +var _stream = __w_pdfjs_require__(12); - case "HardLight": - return "hard-light"; +var _glyphlist = __w_pdfjs_require__(34); - case "SoftLight": - return "soft-light"; +var _metrics = __w_pdfjs_require__(43); - case "Difference": - return "difference"; +var _murmurhash = __w_pdfjs_require__(44); - case "Exclusion": - return "exclusion"; +var _operator_list = __w_pdfjs_require__(26); - case "Hue": - return "hue"; +var _image = __w_pdfjs_require__(45); - case "Saturation": - return "saturation"; +const DefaultPartialEvaluatorOptions = Object.freeze({ + maxImageSize: -1, + disableFontFace: false, + ignoreErrors: false, + isEvalSupported: true, + fontExtraProperties: false +}); +const PatternType = { + TILING: 1, + SHADING: 2 +}; +const deferred = Promise.resolve(); - case "Color": - return "color"; +function normalizeBlendMode(value, parsingArray = false) { + if (Array.isArray(value)) { + for (let i = 0, ii = value.length; i < ii; i++) { + const maybeBM = normalizeBlendMode(value[i], true); - case "Luminosity": - return "luminosity"; + if (maybeBM) { + return maybeBM; + } } + (0, _util.warn)(`Unsupported blend mode Array: ${value}`); + return "source-over"; + } + + if (!(0, _primitives.isName)(value)) { if (parsingArray) { return null; } - (0, _util.warn)(`Unsupported blend mode: ${value.name}`); return "source-over"; } - var deferred = Promise.resolve(); - var TILING_PATTERN = 1, - SHADING_PATTERN = 2; - PartialEvaluator.prototype = { - clone(newOptions = DefaultPartialEvaluatorOptions) { - var newEvaluator = Object.create(this); - newEvaluator.options = newOptions; - return newEvaluator; - }, + switch (value.name) { + case "Normal": + case "Compatible": + return "source-over"; - hasBlendModes: function PartialEvaluator_hasBlendModes(resources) { - if (!(resources instanceof _primitives.Dict)) { - return false; - } + case "Multiply": + return "multiply"; - var processed = Object.create(null); + case "Screen": + return "screen"; - if (resources.objId) { - processed[resources.objId] = true; - } + case "Overlay": + return "overlay"; - var nodes = [resources], - xref = this.xref; + case "Darken": + return "darken"; - while (nodes.length) { - var node = nodes.shift(); - var graphicStates = node.get("ExtGState"); + case "Lighten": + return "lighten"; - if (graphicStates instanceof _primitives.Dict) { - var graphicStatesKeys = graphicStates.getKeys(); + case "ColorDodge": + return "color-dodge"; - for (let i = 0, ii = graphicStatesKeys.length; i < ii; i++) { - const key = graphicStatesKeys[i]; - let graphicState = graphicStates.getRaw(key); + case "ColorBurn": + return "color-burn"; - if (graphicState instanceof _primitives.Ref) { - if (processed[graphicState.toString()]) { - continue; - } + case "HardLight": + return "hard-light"; - try { - graphicState = xref.fetch(graphicState); - } catch (ex) { - if (ex instanceof _core_utils.MissingDataException) { - throw ex; - } + case "SoftLight": + return "soft-light"; - if (this.options.ignoreErrors) { - if (graphicState instanceof _primitives.Ref) { - processed[graphicState.toString()] = true; - } + case "Difference": + return "difference"; - this.handler.send("UnsupportedFeature", { - featureId: _util.UNSUPPORTED_FEATURES.errorExtGState - }); - (0, _util.warn)(`hasBlendModes - ignoring ExtGState: "${ex}".`); - continue; - } + case "Exclusion": + return "exclusion"; - throw ex; - } - } + case "Hue": + return "hue"; - if (!(graphicState instanceof _primitives.Dict)) { - continue; - } + case "Saturation": + return "saturation"; - if (graphicState.objId) { - processed[graphicState.objId] = true; - } + case "Color": + return "color"; - const bm = graphicState.get("BM"); + case "Luminosity": + return "luminosity"; + } - if (bm instanceof _primitives.Name) { - if (bm.name !== "Normal") { - return true; - } + if (parsingArray) { + return null; + } - continue; - } + (0, _util.warn)(`Unsupported blend mode: ${value.name}`); + return "source-over"; +} - if (bm !== undefined && Array.isArray(bm)) { - for (let j = 0, jj = bm.length; j < jj; j++) { - if (bm[j] instanceof _primitives.Name && bm[j].name !== "Normal") { - return true; - } - } - } - } - } +class TimeSlotManager { + static get TIME_SLOT_DURATION_MS() { + return (0, _util.shadow)(this, "TIME_SLOT_DURATION_MS", 20); + } - var xObjects = node.get("XObject"); + static get CHECK_TIME_EVERY() { + return (0, _util.shadow)(this, "CHECK_TIME_EVERY", 100); + } - if (!(xObjects instanceof _primitives.Dict)) { - continue; - } + constructor() { + this.reset(); + } + + check() { + if (++this.checked < TimeSlotManager.CHECK_TIME_EVERY) { + return false; + } + + this.checked = 0; + return this.endTime <= Date.now(); + } + + reset() { + this.endTime = Date.now() + TimeSlotManager.TIME_SLOT_DURATION_MS; + this.checked = 0; + } - var xObjectsKeys = xObjects.getKeys(); +} - for (let i = 0, ii = xObjectsKeys.length; i < ii; i++) { - const key = xObjectsKeys[i]; - var xObject = xObjects.getRaw(key); +class PartialEvaluator { + constructor({ + xref, + handler, + pageIndex, + idFactory, + fontCache, + builtInCMapCache, + globalImageCache, + options = null + }) { + this.xref = xref; + this.handler = handler; + this.pageIndex = pageIndex; + this.idFactory = idFactory; + this.fontCache = fontCache; + this.builtInCMapCache = builtInCMapCache; + this.globalImageCache = globalImageCache; + this.options = options || DefaultPartialEvaluatorOptions; + this.parsingType3Font = false; + this._fetchBuiltInCMapBound = this.fetchBuiltInCMap.bind(this); + } + + get _pdfFunctionFactory() { + const pdfFunctionFactory = new _function.PDFFunctionFactory({ + xref: this.xref, + isEvalSupported: this.options.isEvalSupported + }); + return (0, _util.shadow)(this, "_pdfFunctionFactory", pdfFunctionFactory); + } - if (xObject instanceof _primitives.Ref) { - if (processed[xObject.toString()]) { + clone(newOptions = DefaultPartialEvaluatorOptions) { + var newEvaluator = Object.create(this); + newEvaluator.options = newOptions; + return newEvaluator; + } + + hasBlendModes(resources) { + if (!(resources instanceof _primitives.Dict)) { + return false; + } + + const processed = new _primitives.RefSet(); + + if (resources.objId) { + processed.put(resources.objId); + } + + var nodes = [resources], + xref = this.xref; + + while (nodes.length) { + var node = nodes.shift(); + var graphicStates = node.get("ExtGState"); + + if (graphicStates instanceof _primitives.Dict) { + for (let graphicState of graphicStates.getRawValues()) { + if (graphicState instanceof _primitives.Ref) { + if (processed.has(graphicState)) { continue; } try { - xObject = xref.fetch(xObject); + graphicState = xref.fetch(graphicState); } catch (ex) { if (ex instanceof _core_utils.MissingDataException) { throw ex; } - if (this.options.ignoreErrors) { - if (xObject instanceof _primitives.Ref) { - processed[xObject.toString()] = true; - } - - this.handler.send("UnsupportedFeature", { - featureId: _util.UNSUPPORTED_FEATURES.errorXObject - }); - (0, _util.warn)(`hasBlendModes - ignoring XObject: "${ex}".`); - continue; - } - - throw ex; + processed.put(graphicState); + (0, _util.info)(`hasBlendModes - ignoring ExtGState: "${ex}".`); + continue; } } - if (!(0, _primitives.isStream)(xObject)) { + if (!(graphicState instanceof _primitives.Dict)) { continue; } - if (xObject.dict.objId) { - if (processed[xObject.dict.objId]) { - continue; - } - - processed[xObject.dict.objId] = true; + if (graphicState.objId) { + processed.put(graphicState.objId); } - var xResources = xObject.dict.get("Resources"); + const bm = graphicState.get("BM"); + + if (bm instanceof _primitives.Name) { + if (bm.name !== "Normal") { + return true; + } - if (xResources instanceof _primitives.Dict && (!xResources.objId || !processed[xResources.objId])) { - nodes.push(xResources); + continue; + } - if (xResources.objId) { - processed[xResources.objId] = true; + if (bm !== undefined && Array.isArray(bm)) { + for (const element of bm) { + if (element instanceof _primitives.Name && element.name !== "Normal") { + return true; + } } } } } - return false; - }, - - async buildFormXObject(resources, xobj, smask, operatorList, task, initialState) { - var dict = xobj.dict; - var matrix = dict.getArray("Matrix"); - var bbox = dict.getArray("BBox"); + var xObjects = node.get("XObject"); - if (Array.isArray(bbox) && bbox.length === 4) { - bbox = _util.Util.normalizeRect(bbox); - } else { - bbox = null; + if (!(xObjects instanceof _primitives.Dict)) { + continue; } - var group = dict.get("Group"); - - if (group) { - var groupOptions = { - matrix, - bbox, - smask, - isolated: false, - knockout: false - }; - var groupSubtype = group.get("S"); - var colorSpace = null; + for (let xObject of xObjects.getRawValues()) { + if (xObject instanceof _primitives.Ref) { + if (processed.has(xObject)) { + continue; + } - if ((0, _primitives.isName)(groupSubtype, "Transparency")) { - groupOptions.isolated = group.get("I") || false; - groupOptions.knockout = group.get("K") || false; + try { + xObject = xref.fetch(xObject); + } catch (ex) { + if (ex instanceof _core_utils.MissingDataException) { + throw ex; + } - if (group.has("CS")) { - colorSpace = await this.parseColorSpace({ - cs: group.get("CS"), - resources - }); + processed.put(xObject); + (0, _util.info)(`hasBlendModes - ignoring XObject: "${ex}".`); + continue; } } - if (smask && smask.backdrop) { - colorSpace = colorSpace || _colorspace.ColorSpace.singletons.rgb; - smask.backdrop = colorSpace.getRgb(smask.backdrop, 0); + if (!(0, _primitives.isStream)(xObject)) { + continue; } - operatorList.addOp(_util.OPS.beginGroup, [groupOptions]); - } + if (xObject.dict.objId) { + processed.put(xObject.dict.objId); + } - operatorList.addOp(_util.OPS.paintFormXObjectBegin, [matrix, bbox]); - return this.getOperatorList({ - stream: xobj, - task, - resources: dict.get("Resources") || resources, - operatorList, - initialState - }).then(function () { - operatorList.addOp(_util.OPS.paintFormXObjectEnd, []); + var xResources = xObject.dict.get("Resources"); - if (group) { - operatorList.addOp(_util.OPS.endGroup, [groupOptions]); + if (!(xResources instanceof _primitives.Dict)) { + continue; } - }); - }, - async buildPaintImageXObject({ - resources, - image, - isInline = false, - operatorList, - cacheKey, - localImageCache - }) { - var dict = image.dict; - const imageRef = dict.objId; - var w = dict.get("Width", "W"); - var h = dict.get("Height", "H"); + if (xResources.objId && processed.has(xResources.objId)) { + continue; + } - if (!(w && (0, _util.isNum)(w)) || !(h && (0, _util.isNum)(h))) { - (0, _util.warn)("Image dimensions are missing, or not numbers."); - return undefined; + nodes.push(xResources); + + if (xResources.objId) { + processed.put(xResources.objId); + } } + } + + return false; + } - var maxImageSize = this.options.maxImageSize; + async fetchBuiltInCMap(name) { + const cachedData = this.builtInCMapCache.get(name); - if (maxImageSize !== -1 && w * h > maxImageSize) { - (0, _util.warn)("Image exceeded maximum allowed size and was removed."); - return undefined; + if (cachedData) { + return cachedData; + } + + const readableStream = this.handler.sendWithStream("FetchBuiltInCMap", { + name + }); + const reader = readableStream.getReader(); + const data = await new Promise(function (resolve, reject) { + function pump() { + reader.read().then(function ({ + value, + done + }) { + if (done) { + return; + } + + resolve(value); + pump(); + }, reject); } - var imageMask = dict.get("ImageMask", "IM") || false; - var imgData, args; + pump(); + }); - if (imageMask) { - var width = dict.get("Width", "W"); - var height = dict.get("Height", "H"); - var bitStrideLength = width + 7 >> 3; - var imgArray = image.getBytes(bitStrideLength * height, true); - var decode = dict.getArray("Decode", "D"); - imgData = _image.PDFImage.createMask({ - imgArray, - width, - height, - imageIsFromDecodeStream: image instanceof _stream.DecodeStream, - inverseDecode: !!decode && decode[0] > 0 - }); - imgData.cached = !!cacheKey; - args = [imgData]; - operatorList.addOp(_util.OPS.paintImageMaskXObject, args); + if (data.compressionType !== _util.CMapCompressionType.NONE) { + this.builtInCMapCache.set(name, data); + } - if (cacheKey) { - localImageCache.set(cacheKey, imageRef, { - fn: _util.OPS.paintImageMaskXObject, - args - }); + return data; + } + + async buildFormXObject(resources, xobj, smask, operatorList, task, initialState, localColorSpaceCache) { + var dict = xobj.dict; + var matrix = dict.getArray("Matrix"); + var bbox = dict.getArray("BBox"); + + if (Array.isArray(bbox) && bbox.length === 4) { + bbox = _util.Util.normalizeRect(bbox); + } else { + bbox = null; + } + + let optionalContent = null; + + if (dict.has("OC")) { + optionalContent = await this.parseMarkedContentProps(dict.get("OC"), resources); + operatorList.addOp(_util.OPS.beginMarkedContentProps, ["OC", optionalContent]); + } + + var group = dict.get("Group"); + + if (group) { + var groupOptions = { + matrix, + bbox, + smask, + isolated: false, + knockout: false + }; + var groupSubtype = group.get("S"); + var colorSpace = null; + + if ((0, _primitives.isName)(groupSubtype, "Transparency")) { + groupOptions.isolated = group.get("I") || false; + groupOptions.knockout = group.get("K") || false; + + if (group.has("CS")) { + const cs = group.getRaw("CS"); + + const cachedColorSpace = _colorspace.ColorSpace.getCached(cs, this.xref, localColorSpaceCache); + + if (cachedColorSpace) { + colorSpace = cachedColorSpace; + } else { + colorSpace = await this.parseColorSpace({ + cs, + resources, + localColorSpaceCache + }); + } } + } - return undefined; + if (smask && smask.backdrop) { + colorSpace = colorSpace || _colorspace.ColorSpace.singletons.rgb; + smask.backdrop = colorSpace.getRgb(smask.backdrop, 0); } - var softMask = dict.get("SMask", "SM") || false; - var mask = dict.get("Mask") || false; - var SMALL_IMAGE_DIMENSIONS = 200; + operatorList.addOp(_util.OPS.beginGroup, [groupOptions]); + } - if (isInline && !softMask && !mask && w + h < SMALL_IMAGE_DIMENSIONS) { - const imageObj = new _image.PDFImage({ - xref: this.xref, - res: resources, - image, - isInline, - pdfFunctionFactory: this.pdfFunctionFactory - }); - imgData = imageObj.createImageData(true); - operatorList.addOp(_util.OPS.paintInlineImageXObject, [imgData]); - return undefined; + operatorList.addOp(_util.OPS.paintFormXObjectBegin, [matrix, bbox]); + return this.getOperatorList({ + stream: xobj, + task, + resources: dict.get("Resources") || resources, + operatorList, + initialState + }).then(function () { + operatorList.addOp(_util.OPS.paintFormXObjectEnd, []); + + if (group) { + operatorList.addOp(_util.OPS.endGroup, [groupOptions]); } - let objId = `img_${this.idFactory.createObjId()}`, - cacheGlobally = false; + if (optionalContent) { + operatorList.addOp(_util.OPS.endMarkedContent, []); + } + }); + } + + _sendImgData(objId, imgData, cacheGlobally = false) { + const transfers = imgData ? [imgData.data.buffer] : null; - if (this.parsingType3Font) { - objId = `${this.idFactory.getDocId()}_type3res_${objId}`; - } else if (imageRef) { - cacheGlobally = this.globalImageCache.shouldCache(imageRef, this.pageIndex); + if (this.parsingType3Font || cacheGlobally) { + return this.handler.send("commonobj", [objId, "Image", imgData], transfers); + } - if (cacheGlobally) { - objId = `${this.idFactory.getDocId()}_${objId}`; - } + return this.handler.send("obj", [objId, this.pageIndex, "Image", imgData], transfers); + } + + async buildPaintImageXObject({ + resources, + image, + isInline = false, + operatorList, + cacheKey, + localImageCache, + localColorSpaceCache + }) { + var dict = image.dict; + const imageRef = dict.objId; + var w = dict.get("Width", "W"); + var h = dict.get("Height", "H"); + + if (!(w && (0, _util.isNum)(w)) || !(h && (0, _util.isNum)(h))) { + (0, _util.warn)("Image dimensions are missing, or not numbers."); + return undefined; + } + + var maxImageSize = this.options.maxImageSize; + + if (maxImageSize !== -1 && w * h > maxImageSize) { + (0, _util.warn)("Image exceeded maximum allowed size and was removed."); + return undefined; + } + + var imageMask = dict.get("ImageMask", "IM") || false; + var imgData, args; + + if (imageMask) { + var width = dict.get("Width", "W"); + var height = dict.get("Height", "H"); + var bitStrideLength = width + 7 >> 3; + var imgArray = image.getBytes(bitStrideLength * height, true); + var decode = dict.getArray("Decode", "D"); + imgData = _image.PDFImage.createMask({ + imgArray, + width, + height, + imageIsFromDecodeStream: image instanceof _stream.DecodeStream, + inverseDecode: !!decode && decode[0] > 0 + }); + imgData.cached = !!cacheKey; + args = [imgData]; + operatorList.addOp(_util.OPS.paintImageMaskXObject, args); + + if (cacheKey) { + localImageCache.set(cacheKey, imageRef, { + fn: _util.OPS.paintImageMaskXObject, + args + }); } - operatorList.addDependency(objId); - args = [objId, w, h]; + return undefined; + } + + var softMask = dict.get("SMask", "SM") || false; + var mask = dict.get("Mask") || false; + var SMALL_IMAGE_DIMENSIONS = 200; - const imgPromise = _image.PDFImage.buildImage({ + if (isInline && !softMask && !mask && w + h < SMALL_IMAGE_DIMENSIONS) { + const imageObj = new _image.PDFImage({ xref: this.xref, res: resources, image, isInline, - pdfFunctionFactory: this.pdfFunctionFactory - }).then(imageObj => { - imgData = imageObj.createImageData(false); + pdfFunctionFactory: this._pdfFunctionFactory, + localColorSpaceCache + }); + imgData = imageObj.createImageData(true); + operatorList.addOp(_util.OPS.paintInlineImageXObject, [imgData]); + return undefined; + } - if (this.parsingType3Font) { - return this.handler.sendWithPromise("commonobj", [objId, "FontType3Res", imgData], [imgData.data.buffer]); - } else if (cacheGlobally) { - this.handler.send("commonobj", [objId, "Image", imgData], [imgData.data.buffer]); - return undefined; - } + let objId = `img_${this.idFactory.createObjId()}`, + cacheGlobally = false; - this.handler.send("obj", [objId, this.pageIndex, "Image", imgData], [imgData.data.buffer]); - return undefined; - }).catch(reason => { - (0, _util.warn)("Unable to decode image: " + reason); + if (this.parsingType3Font) { + objId = `${this.idFactory.getDocId()}_type3_${objId}`; + } else if (imageRef) { + cacheGlobally = this.globalImageCache.shouldCache(imageRef, this.pageIndex); - if (this.parsingType3Font) { - return this.handler.sendWithPromise("commonobj", [objId, "FontType3Res", null]); - } else if (cacheGlobally) { - this.handler.send("commonobj", [objId, "Image", null]); - return undefined; - } + if (cacheGlobally) { + objId = `${this.idFactory.getDocId()}_${objId}`; + } + } - this.handler.send("obj", [objId, this.pageIndex, "Image", null]); - return undefined; - }); + operatorList.addDependency(objId); + args = [objId, w, h]; - if (this.parsingType3Font) { - await imgPromise; - } + _image.PDFImage.buildImage({ + xref: this.xref, + res: resources, + image, + isInline, + pdfFunctionFactory: this._pdfFunctionFactory, + localColorSpaceCache + }).then(imageObj => { + imgData = imageObj.createImageData(false); + return this._sendImgData(objId, imgData, cacheGlobally); + }).catch(reason => { + (0, _util.warn)(`Unable to decode image "${objId}": "${reason}".`); + return this._sendImgData(objId, null, cacheGlobally); + }); - operatorList.addOp(_util.OPS.paintImageXObject, args); + operatorList.addOp(_util.OPS.paintImageXObject, args); - if (cacheKey) { - localImageCache.set(cacheKey, imageRef, { - fn: _util.OPS.paintImageXObject, - args - }); + if (cacheKey) { + localImageCache.set(cacheKey, imageRef, { + fn: _util.OPS.paintImageXObject, + args + }); - if (imageRef) { - (0, _util.assert)(!isInline, "Cannot cache an inline image globally."); - this.globalImageCache.addPageIndex(imageRef, this.pageIndex); + if (imageRef) { + (0, _util.assert)(!isInline, "Cannot cache an inline image globally."); + this.globalImageCache.addPageIndex(imageRef, this.pageIndex); - if (cacheGlobally) { - this.globalImageCache.setData(imageRef, { - objId, - fn: _util.OPS.paintImageXObject, - args - }); - } + if (cacheGlobally) { + this.globalImageCache.setData(imageRef, { + objId, + fn: _util.OPS.paintImageXObject, + args + }); } } + } - return undefined; - }, + return undefined; + } - handleSMask: function PartialEvaluator_handleSmask(smask, resources, operatorList, task, stateManager) { - var smaskContent = smask.get("G"); - var smaskOptions = { - subtype: smask.get("S").name, - backdrop: smask.get("BC") - }; - var transferObj = smask.get("TR"); + handleSMask(smask, resources, operatorList, task, stateManager, localColorSpaceCache) { + var smaskContent = smask.get("G"); + var smaskOptions = { + subtype: smask.get("S").name, + backdrop: smask.get("BC") + }; + var transferObj = smask.get("TR"); - if ((0, _function.isPDFFunction)(transferObj)) { - const transferFn = this.pdfFunctionFactory.create(transferObj); - var transferMap = new Uint8Array(256); - var tmp = new Float32Array(1); + if ((0, _function.isPDFFunction)(transferObj)) { + const transferFn = this._pdfFunctionFactory.create(transferObj); - for (var i = 0; i < 256; i++) { - tmp[0] = i / 255; - transferFn(tmp, 0, tmp, 0); - transferMap[i] = tmp[0] * 255 | 0; - } + var transferMap = new Uint8Array(256); + var tmp = new Float32Array(1); - smaskOptions.transferMap = transferMap; + for (var i = 0; i < 256; i++) { + tmp[0] = i / 255; + transferFn(tmp, 0, tmp, 0); + transferMap[i] = tmp[0] * 255 | 0; } - return this.buildFormXObject(resources, smaskContent, smaskOptions, operatorList, task, stateManager.state.clone()); - }, + smaskOptions.transferMap = transferMap; + } - handleTilingType(fn, args, resources, pattern, patternDict, operatorList, task) { - const tilingOpList = new _operator_list.OperatorList(); - const resourcesArray = [patternDict.get("Resources"), resources]; + return this.buildFormXObject(resources, smaskContent, smaskOptions, operatorList, task, stateManager.state.clone(), localColorSpaceCache); + } - const patternResources = _primitives.Dict.merge(this.xref, resourcesArray); + handleTransferFunction(tr) { + let transferArray; - return this.getOperatorList({ - stream: pattern, - task, - resources: patternResources, - operatorList: tilingOpList - }).then(function () { - return (0, _pattern.getTilingPatternIR)({ - fnArray: tilingOpList.fnArray, - argsArray: tilingOpList.argsArray - }, patternDict, args); - }).then(function (tilingPatternIR) { - operatorList.addDependencies(tilingOpList.dependencies); - operatorList.addOp(fn, tilingPatternIR); - }, reason => { - if (reason instanceof _util.AbortException) { - return; - } + if (Array.isArray(tr)) { + transferArray = tr; + } else if ((0, _function.isPDFFunction)(tr)) { + transferArray = [tr]; + } else { + return null; + } - if (this.options.ignoreErrors) { - this.handler.send("UnsupportedFeature", { - featureId: _util.UNSUPPORTED_FEATURES.errorTilingPattern - }); - (0, _util.warn)(`handleTilingType - ignoring pattern: "${reason}".`); - return; - } + const transferMaps = []; + let numFns = 0, + numEffectfulFns = 0; - throw reason; - }); - }, + for (const entry of transferArray) { + const transferObj = this.xref.fetchIfRef(entry); + numFns++; + + if ((0, _primitives.isName)(transferObj, "Identity")) { + transferMaps.push(null); + continue; + } else if (!(0, _function.isPDFFunction)(transferObj)) { + return null; + } - handleSetFont: function PartialEvaluator_handleSetFont(resources, fontArgs, fontRef, operatorList, task, state) { - var fontName; + const transferFn = this._pdfFunctionFactory.create(transferObj); - if (fontArgs) { - fontArgs = fontArgs.slice(); - fontName = fontArgs[0].name; + const transferMap = new Uint8Array(256), + tmp = new Float32Array(1); + + for (let j = 0; j < 256; j++) { + tmp[0] = j / 255; + transferFn(tmp, 0, tmp, 0); + transferMap[j] = tmp[0] * 255 | 0; } - return this.loadFont(fontName, fontRef, resources).then(translated => { - if (!translated.font.isType3Font) { - return translated; - } + transferMaps.push(transferMap); + numEffectfulFns++; + } - return translated.loadType3Data(this, resources, operatorList, task).then(function () { - return translated; - }).catch(reason => { - this.handler.send("UnsupportedFeature", { - featureId: _util.UNSUPPORTED_FEATURES.errorFontLoadType3 - }); - return new TranslatedFont({ - loadedName: "g_font_error", - font: new _fonts.ErrorFont(`Type3 font load error: ${reason}`), - dict: translated.font, - extraProperties: this.options.fontExtraProperties - }); - }); - }).then(translated => { - state.font = translated.font; - translated.send(this.handler); - return translated.loadedName; - }); - }, + if (!(numFns === 1 || numFns === 4)) { + return null; + } - handleText(chars, state) { - const font = state.font; - const glyphs = font.charsToGlyphs(chars); + if (numEffectfulFns === 0) { + return null; + } - if (font.data) { - const isAddToPathSet = !!(state.textRenderingMode & _util.TextRenderingMode.ADD_TO_PATH_FLAG); + return transferMaps; + } - if (isAddToPathSet || state.fillColorSpace.name === "Pattern" || font.disableFontFace || this.options.disableFontFace) { - PartialEvaluator.buildFontPaths(font, glyphs, this.handler); - } - } + handleTilingType(fn, args, resources, pattern, patternDict, operatorList, task) { + const tilingOpList = new _operator_list.OperatorList(); - return glyphs; - }, + const patternResources = _primitives.Dict.merge({ + xref: this.xref, + dictArray: [patternDict.get("Resources"), resources] + }); - ensureStateFont(state) { - if (state.font) { + return this.getOperatorList({ + stream: pattern, + task, + resources: patternResources, + operatorList: tilingOpList + }).then(function () { + return (0, _pattern.getTilingPatternIR)({ + fnArray: tilingOpList.fnArray, + argsArray: tilingOpList.argsArray + }, patternDict, args); + }).then(function (tilingPatternIR) { + operatorList.addDependencies(tilingOpList.dependencies); + operatorList.addOp(fn, tilingPatternIR); + }, reason => { + if (reason instanceof _util.AbortException) { return; } - const reason = new _util.FormatError("Missing setFont (Tf) operator before text rendering operator."); - if (this.options.ignoreErrors) { this.handler.send("UnsupportedFeature", { - featureId: _util.UNSUPPORTED_FEATURES.errorFontState + featureId: _util.UNSUPPORTED_FEATURES.errorTilingPattern }); - (0, _util.warn)(`ensureStateFont: "${reason}".`); + (0, _util.warn)(`handleTilingType - ignoring pattern: "${reason}".`); return; } throw reason; - }, - - setGState: function PartialEvaluator_setGState(resources, gState, operatorList, task, stateManager) { - var gStateObj = []; - var gStateKeys = gState.getKeys(); - var promise = Promise.resolve(); + }); + } - for (var i = 0, ii = gStateKeys.length; i < ii; i++) { - const key = gStateKeys[i]; - const value = gState.get(key); + handleSetFont(resources, fontArgs, fontRef, operatorList, task, state) { + var fontName, + fontSize = 0; - switch (key) { - case "Type": - break; + if (fontArgs) { + fontArgs = fontArgs.slice(); + fontName = fontArgs[0].name; + fontSize = fontArgs[1]; + } - case "LW": - case "LC": - case "LJ": - case "ML": - case "D": - case "RI": - case "FL": - case "CA": - case "ca": - gStateObj.push([key, value]); - break; + return this.loadFont(fontName, fontRef, resources).then(translated => { + if (!translated.font.isType3Font) { + return translated; + } - case "Font": - promise = promise.then(() => { - return this.handleSetFont(resources, null, value[0], operatorList, task, stateManager.state).then(function (loadedName) { - operatorList.addDependency(loadedName); - gStateObj.push([key, [loadedName, value[1]]]); - }); - }); - break; + return translated.loadType3Data(this, resources, task).then(function () { + operatorList.addDependencies(translated.type3Dependencies); + return translated; + }).catch(reason => { + this.handler.send("UnsupportedFeature", { + featureId: _util.UNSUPPORTED_FEATURES.errorFontLoadType3 + }); + return new TranslatedFont({ + loadedName: "g_font_error", + font: new _fonts.ErrorFont(`Type3 font load error: ${reason}`), + dict: translated.font, + extraProperties: this.options.fontExtraProperties + }); + }); + }).then(translated => { + state.font = translated.font; + state.fontSize = fontSize; + state.fontName = fontName; + translated.send(this.handler); + return translated.loadedName; + }); + } - case "BM": - gStateObj.push([key, normalizeBlendMode(value)]); - break; + handleText(chars, state) { + const font = state.font; + const glyphs = font.charsToGlyphs(chars); - case "SMask": - if ((0, _primitives.isName)(value, "None")) { - gStateObj.push([key, false]); - break; - } + if (font.data) { + const isAddToPathSet = !!(state.textRenderingMode & _util.TextRenderingMode.ADD_TO_PATH_FLAG); - if ((0, _primitives.isDict)(value)) { - promise = promise.then(() => { - return this.handleSMask(value, resources, operatorList, task, stateManager); - }); - gStateObj.push([key, true]); - } else { - (0, _util.warn)("Unsupported SMask type"); - } + if (isAddToPathSet || state.fillColorSpace.name === "Pattern" || font.disableFontFace || this.options.disableFontFace) { + PartialEvaluator.buildFontPaths(font, glyphs, this.handler); + } + } - break; + return glyphs; + } - case "OP": - case "op": - case "OPM": - case "BG": - case "BG2": - case "UCR": - case "UCR2": - case "TR": - case "TR2": - case "HT": - case "SM": - case "SA": - case "AIS": - case "TK": - (0, _util.info)("graphic state operator " + key); - break; + ensureStateFont(state) { + if (state.font) { + return; + } - default: - (0, _util.info)("Unknown graphic state operator " + key); - break; - } - } + const reason = new _util.FormatError("Missing setFont (Tf) operator before text rendering operator."); - return promise.then(function () { - if (gStateObj.length > 0) { - operatorList.addOp(_util.OPS.setGState, [gStateObj]); - } + if (this.options.ignoreErrors) { + this.handler.send("UnsupportedFeature", { + featureId: _util.UNSUPPORTED_FEATURES.errorFontState }); - }, - loadFont: function PartialEvaluator_loadFont(fontName, font, resources) { - const errorFont = () => { - return Promise.resolve(new TranslatedFont({ - loadedName: "g_font_error", - font: new _fonts.ErrorFont(`Font "${fontName}" is not available.`), - dict: font, - extraProperties: this.options.fontExtraProperties - })); - }; + (0, _util.warn)(`ensureStateFont: "${reason}".`); + return; + } - var fontRef, - xref = this.xref; + throw reason; + } - if (font) { - if (!(0, _primitives.isRef)(font)) { - throw new _util.FormatError('The "font" object should be a reference.'); - } + async setGState({ + resources, + gState, + operatorList, + cacheKey, + task, + stateManager, + localGStateCache, + localColorSpaceCache + }) { + const gStateRef = gState.objId; + let isSimpleGState = true; + var gStateObj = []; + var gStateKeys = gState.getKeys(); + var promise = Promise.resolve(); + + for (var i = 0, ii = gStateKeys.length; i < ii; i++) { + const key = gStateKeys[i]; + const value = gState.get(key); + + switch (key) { + case "Type": + break; - fontRef = font; - } else { - var fontRes = resources.get("Font"); + case "LW": + case "LC": + case "LJ": + case "ML": + case "D": + case "RI": + case "FL": + case "CA": + case "ca": + gStateObj.push([key, value]); + break; - if (fontRes) { - fontRef = fontRes.getRaw(fontName); - } - } + case "Font": + isSimpleGState = false; + promise = promise.then(() => { + return this.handleSetFont(resources, null, value[0], operatorList, task, stateManager.state).then(function (loadedName) { + operatorList.addDependency(loadedName); + gStateObj.push([key, [loadedName, value[1]]]); + }); + }); + break; - if (!fontRef) { - const partialMsg = `Font "${fontName || font && font.toString()}" is not available`; + case "BM": + gStateObj.push([key, normalizeBlendMode(value)]); + break; - if (!this.options.ignoreErrors && !this.parsingType3Font) { - (0, _util.warn)(`${partialMsg}.`); - return errorFont(); - } + case "SMask": + if ((0, _primitives.isName)(value, "None")) { + gStateObj.push([key, false]); + break; + } - this.handler.send("UnsupportedFeature", { - featureId: _util.UNSUPPORTED_FEATURES.errorFontMissing - }); - (0, _util.warn)(`${partialMsg} -- attempting to fallback to a default font.`); - fontRef = PartialEvaluator.getFallbackFontDict(); + if ((0, _primitives.isDict)(value)) { + isSimpleGState = false; + promise = promise.then(() => { + return this.handleSMask(value, resources, operatorList, task, stateManager, localColorSpaceCache); + }); + gStateObj.push([key, true]); + } else { + (0, _util.warn)("Unsupported SMask type"); + } + + break; + + case "TR": + const transferMaps = this.handleTransferFunction(value); + gStateObj.push([key, transferMaps]); + break; + + case "OP": + case "op": + case "OPM": + case "BG": + case "BG2": + case "UCR": + case "UCR2": + case "TR2": + case "HT": + case "SM": + case "SA": + case "AIS": + case "TK": + (0, _util.info)("graphic state operator " + key); + break; + + default: + (0, _util.info)("Unknown graphic state operator " + key); + break; + } + } + + return promise.then(function () { + if (gStateObj.length > 0) { + operatorList.addOp(_util.OPS.setGState, [gStateObj]); } - if (this.fontCache.has(fontRef)) { - return this.fontCache.get(fontRef); + if (isSimpleGState) { + localGStateCache.set(cacheKey, gStateRef, gStateObj); } + }); + } - font = xref.fetchIfRef(fontRef); + loadFont(fontName, font, resources) { + const errorFont = () => { + return Promise.resolve(new TranslatedFont({ + loadedName: "g_font_error", + font: new _fonts.ErrorFont(`Font "${fontName}" is not available.`), + dict: font, + extraProperties: this.options.fontExtraProperties + })); + }; - if (!(0, _primitives.isDict)(font)) { - return errorFont(); + var fontRef, + xref = this.xref; + + if (font) { + if (!(0, _primitives.isRef)(font)) { + throw new _util.FormatError('The "font" object should be a reference.'); } - if (font.translated) { - return font.translated; + fontRef = font; + } else { + var fontRes = resources.get("Font"); + + if (fontRes) { + fontRef = fontRes.getRaw(fontName); } + } - var fontCapability = (0, _util.createPromiseCapability)(); - var preEvaluatedFont = this.preEvaluateFont(font); - const { - descriptor, - hash - } = preEvaluatedFont; - var fontRefIsRef = (0, _primitives.isRef)(fontRef), - fontID; + if (!fontRef) { + const partialMsg = `Font "${fontName || font && font.toString()}" is not available`; - if (fontRefIsRef) { - fontID = fontRef.toString(); + if (!this.options.ignoreErrors && !this.parsingType3Font) { + (0, _util.warn)(`${partialMsg}.`); + return errorFont(); } - if (hash && (0, _primitives.isDict)(descriptor)) { - if (!descriptor.fontAliases) { - descriptor.fontAliases = Object.create(null); - } + this.handler.send("UnsupportedFeature", { + featureId: _util.UNSUPPORTED_FEATURES.errorFontMissing + }); + (0, _util.warn)(`${partialMsg} -- attempting to fallback to a default font.`); + fontRef = PartialEvaluator.fallbackFontDict; + } - var fontAliases = descriptor.fontAliases; + if (this.fontCache.has(fontRef)) { + return this.fontCache.get(fontRef); + } - if (fontAliases[hash]) { - var aliasFontRef = fontAliases[hash].aliasRef; + font = xref.fetchIfRef(fontRef); - if (fontRefIsRef && aliasFontRef && this.fontCache.has(aliasFontRef)) { - this.fontCache.putAlias(fontRef, aliasFontRef); - return this.fontCache.get(fontRef); - } - } else { - fontAliases[hash] = { - fontID: _fonts.Font.getFontID() - }; - } + if (!(0, _primitives.isDict)(font)) { + return errorFont(); + } - if (fontRefIsRef) { - fontAliases[hash].aliasRef = fontRef; - } + if (font.translated) { + return font.translated; + } + + var fontCapability = (0, _util.createPromiseCapability)(); + var preEvaluatedFont = this.preEvaluateFont(font); + const { + descriptor, + hash + } = preEvaluatedFont; + var fontRefIsRef = (0, _primitives.isRef)(fontRef), + fontID; + + if (fontRefIsRef) { + fontID = `f${fontRef.toString()}`; + } - fontID = fontAliases[hash].fontID; + if (hash && (0, _primitives.isDict)(descriptor)) { + if (!descriptor.fontAliases) { + descriptor.fontAliases = Object.create(null); } - if (fontRefIsRef) { - this.fontCache.put(fontRef, fontCapability.promise); - } else { - if (!fontID) { - fontID = this.idFactory.createObjId(); + var fontAliases = descriptor.fontAliases; + + if (fontAliases[hash]) { + var aliasFontRef = fontAliases[hash].aliasRef; + + if (fontRefIsRef && aliasFontRef && this.fontCache.has(aliasFontRef)) { + this.fontCache.putAlias(fontRef, aliasFontRef); + return this.fontCache.get(fontRef); } + } else { + fontAliases[hash] = { + fontID: this.idFactory.createFontId() + }; + } - this.fontCache.put(`id_${fontID}`, fontCapability.promise); + if (fontRefIsRef) { + fontAliases[hash].aliasRef = fontRef; } - (0, _util.assert)(fontID, 'The "fontID" must be defined.'); - font.loadedName = `${this.idFactory.getDocId()}_f${fontID}`; - font.translated = fontCapability.promise; - var translatedPromise; + fontID = fontAliases[hash].fontID; + } - try { - translatedPromise = this.translateFont(preEvaluatedFont); - } catch (e) { - translatedPromise = Promise.reject(e); + if (fontRefIsRef) { + this.fontCache.put(fontRef, fontCapability.promise); + } else { + if (!fontID) { + fontID = this.idFactory.createFontId(); } - translatedPromise.then(translatedFont => { - if (translatedFont.fontType !== undefined) { - var xrefFontStats = xref.stats.fontTypes; - xrefFontStats[translatedFont.fontType] = true; - } + this.fontCache.put(`id_${fontID}`, fontCapability.promise); + } - fontCapability.resolve(new TranslatedFont({ - loadedName: font.loadedName, - font: translatedFont, - dict: font, - extraProperties: this.options.fontExtraProperties - })); - }).catch(reason => { - this.handler.send("UnsupportedFeature", { - featureId: _util.UNSUPPORTED_FEATURES.errorFontTranslate - }); + (0, _util.assert)(fontID && fontID.startsWith("f"), 'The "fontID" must be (correctly) defined.'); + font.loadedName = `${this.idFactory.getDocId()}_${fontID}`; + font.translated = fontCapability.promise; + var translatedPromise; - try { - var fontFile3 = descriptor && descriptor.get("FontFile3"); - var subtype = fontFile3 && fontFile3.get("Subtype"); - var fontType = (0, _fonts.getFontType)(preEvaluatedFont.type, subtype && subtype.name); - var xrefFontStats = xref.stats.fontTypes; - xrefFontStats[fontType] = true; - } catch (ex) {} - - fontCapability.resolve(new TranslatedFont({ - loadedName: font.loadedName, - font: new _fonts.ErrorFont(reason instanceof Error ? reason.message : reason), - dict: font, - extraProperties: this.options.fontExtraProperties - })); + try { + translatedPromise = this.translateFont(preEvaluatedFont); + } catch (e) { + translatedPromise = Promise.reject(e); + } + + translatedPromise.then(translatedFont => { + if (translatedFont.fontType !== undefined) { + var xrefFontStats = xref.stats.fontTypes; + xrefFontStats[translatedFont.fontType] = true; + } + + fontCapability.resolve(new TranslatedFont({ + loadedName: font.loadedName, + font: translatedFont, + dict: font, + extraProperties: this.options.fontExtraProperties + })); + }).catch(reason => { + this.handler.send("UnsupportedFeature", { + featureId: _util.UNSUPPORTED_FEATURES.errorFontTranslate }); - return fontCapability.promise; - }, - buildPath(operatorList, fn, args, parsingText = false) { - var lastIndex = operatorList.length - 1; + try { + var fontFile3 = descriptor && descriptor.get("FontFile3"); + var subtype = fontFile3 && fontFile3.get("Subtype"); + var fontType = (0, _fonts.getFontType)(preEvaluatedFont.type, subtype && subtype.name); + var xrefFontStats = xref.stats.fontTypes; + xrefFontStats[fontType] = true; + } catch (ex) {} + + fontCapability.resolve(new TranslatedFont({ + loadedName: font.loadedName, + font: new _fonts.ErrorFont(reason instanceof Error ? reason.message : reason), + dict: font, + extraProperties: this.options.fontExtraProperties + })); + }); + return fontCapability.promise; + } - if (!args) { - args = []; - } + buildPath(operatorList, fn, args, parsingText = false) { + var lastIndex = operatorList.length - 1; - if (lastIndex < 0 || operatorList.fnArray[lastIndex] !== _util.OPS.constructPath) { - if (parsingText) { - (0, _util.warn)(`Encountered path operator "${fn}" inside of a text object.`); - operatorList.addOp(_util.OPS.save, null); - } + if (!args) { + args = []; + } - operatorList.addOp(_util.OPS.constructPath, [[fn], args]); + if (lastIndex < 0 || operatorList.fnArray[lastIndex] !== _util.OPS.constructPath) { + if (parsingText) { + (0, _util.warn)(`Encountered path operator "${fn}" inside of a text object.`); + operatorList.addOp(_util.OPS.save, null); + } - if (parsingText) { - operatorList.addOp(_util.OPS.restore, null); - } - } else { - var opArgs = operatorList.argsArray[lastIndex]; - opArgs[0].push(fn); - Array.prototype.push.apply(opArgs[1], args); + operatorList.addOp(_util.OPS.constructPath, [[fn], args]); + + if (parsingText) { + operatorList.addOp(_util.OPS.restore, null); } - }, + } else { + var opArgs = operatorList.argsArray[lastIndex]; + opArgs[0].push(fn); + Array.prototype.push.apply(opArgs[1], args); + } + } - parseColorSpace({ + parseColorSpace({ + cs, + resources, + localColorSpaceCache + }) { + return _colorspace.ColorSpace.parseAsync({ cs, - resources - }) { - return new Promise(resolve => { - resolve(_colorspace.ColorSpace.parse(cs, this.xref, resources, this.pdfFunctionFactory)); - }).catch(reason => { - if (reason instanceof _util.AbortException) { - return null; - } - - if (this.options.ignoreErrors) { - this.handler.send("UnsupportedFeature", { - featureId: _util.UNSUPPORTED_FEATURES.errorColorSpace - }); - (0, _util.warn)(`parseColorSpace - ignoring ColorSpace: "${reason}".`); - return null; - } + xref: this.xref, + resources, + pdfFunctionFactory: this._pdfFunctionFactory, + localColorSpaceCache + }).catch(reason => { + if (reason instanceof _util.AbortException) { + return null; + } - throw reason; - }); - }, + if (this.options.ignoreErrors) { + this.handler.send("UnsupportedFeature", { + featureId: _util.UNSUPPORTED_FEATURES.errorColorSpace + }); + (0, _util.warn)(`parseColorSpace - ignoring ColorSpace: "${reason}".`); + return null; + } - async handleColorN(operatorList, fn, args, cs, patterns, resources, task) { - var patternName = args[args.length - 1]; - var pattern; + throw reason; + }); + } - if ((0, _primitives.isName)(patternName) && (pattern = patterns.get(patternName.name))) { - var dict = (0, _primitives.isStream)(pattern) ? pattern.dict : pattern; - var typeNum = dict.get("PatternType"); + async handleColorN(operatorList, fn, args, cs, patterns, resources, task, localColorSpaceCache) { + var patternName = args[args.length - 1]; + var pattern; - if (typeNum === TILING_PATTERN) { - var color = cs.base ? cs.base.getRgb(args, 0) : null; - return this.handleTilingType(fn, color, resources, pattern, dict, operatorList, task); - } else if (typeNum === SHADING_PATTERN) { - var shading = dict.get("Shading"); - var matrix = dict.getArray("Matrix"); - pattern = _pattern.Pattern.parseShading(shading, matrix, this.xref, resources, this.handler, this.pdfFunctionFactory); - operatorList.addOp(fn, pattern.getIR()); - return undefined; - } + if ((0, _primitives.isName)(patternName) && (pattern = patterns.get(patternName.name))) { + var dict = (0, _primitives.isStream)(pattern) ? pattern.dict : pattern; + var typeNum = dict.get("PatternType"); - throw new _util.FormatError(`Unknown PatternType: ${typeNum}`); + if (typeNum === PatternType.TILING) { + var color = cs.base ? cs.base.getRgb(args, 0) : null; + return this.handleTilingType(fn, color, resources, pattern, dict, operatorList, task); + } else if (typeNum === PatternType.SHADING) { + var shading = dict.get("Shading"); + var matrix = dict.getArray("Matrix"); + pattern = _pattern.Pattern.parseShading(shading, matrix, this.xref, resources, this.handler, this._pdfFunctionFactory, localColorSpaceCache); + operatorList.addOp(fn, pattern.getIR()); + return undefined; } - throw new _util.FormatError(`Unknown PatternName: ${patternName}`); - }, + throw new _util.FormatError(`Unknown PatternType: ${typeNum}`); + } - getOperatorList({ - stream, - task, - resources, - operatorList, - initialState = null - }) { - resources = resources || _primitives.Dict.empty; - initialState = initialState || new EvalState(); + throw new _util.FormatError(`Unknown PatternName: ${patternName}`); + } - if (!operatorList) { - throw new Error('getOperatorList: missing "operatorList" parameter'); - } + async parseMarkedContentProps(contentProperties, resources) { + let optionalContent; - var self = this; - var xref = this.xref; - let parsingText = false; - const localImageCache = new _image_utils.LocalImageCache(); + if ((0, _primitives.isName)(contentProperties)) { + const properties = resources.get("Properties"); + optionalContent = properties.get(contentProperties.name); + } else if ((0, _primitives.isDict)(contentProperties)) { + optionalContent = contentProperties; + } else { + throw new _util.FormatError("Optional content properties malformed."); + } - var xobjs = resources.get("XObject") || _primitives.Dict.empty; + const optionalContentType = optionalContent.get("Type").name; - var patterns = resources.get("Pattern") || _primitives.Dict.empty; + if (optionalContentType === "OCG") { + return { + type: optionalContentType, + id: optionalContent.objId + }; + } else if (optionalContentType === "OCMD") { + const optionalContentGroups = optionalContent.get("OCGs"); - var stateManager = new StateManager(initialState); - var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); - var timeSlotManager = new TimeSlotManager(); + if (Array.isArray(optionalContentGroups) || (0, _primitives.isDict)(optionalContentGroups)) { + const groupIds = []; - function closePendingRestoreOPS(argument) { - for (var i = 0, ii = preprocessor.savedStatesDepth; i < ii; i++) { - operatorList.addOp(_util.OPS.restore, []); + if (Array.isArray(optionalContentGroups)) { + optionalContent.get("OCGs").forEach(ocg => { + groupIds.push(ocg.toString()); + }); + } else { + groupIds.push(optionalContentGroups.objId); } - } - return new Promise(function promiseBody(resolve, reject) { - const next = function (promise) { - Promise.all([promise, operatorList.ready]).then(function () { - try { - promiseBody(resolve, reject); - } catch (ex) { - reject(ex); - } - }, reject); + let expression = null; + + if (optionalContent.get("VE")) { + expression = true; + } + + return { + type: optionalContentType, + ids: groupIds, + policy: (0, _primitives.isName)(optionalContent.get("P")) ? optionalContent.get("P").name : null, + expression + }; + } else if ((0, _primitives.isRef)(optionalContentGroups)) { + return { + type: optionalContentType, + id: optionalContentGroups.toString() }; + } + } - task.ensureNotTerminated(); - timeSlotManager.reset(); - var stop, - operation = {}, - i, - ii, - cs; + return null; + } - while (!(stop = timeSlotManager.check())) { - operation.args = null; + getOperatorList({ + stream, + task, + resources, + operatorList, + initialState = null + }) { + resources = resources || _primitives.Dict.empty; + initialState = initialState || new EvalState(); - if (!preprocessor.read(operation)) { - break; - } + if (!operatorList) { + throw new Error('getOperatorList: missing "operatorList" parameter'); + } - var args = operation.args; - var fn = operation.fn; + var self = this; + var xref = this.xref; + let parsingText = false; + const localImageCache = new _image_utils.LocalImageCache(); + const localColorSpaceCache = new _image_utils.LocalColorSpaceCache(); + const localGStateCache = new _image_utils.LocalGStateCache(); - switch (fn | 0) { - case _util.OPS.paintXObject: - var name = args[0].name; + var xobjs = resources.get("XObject") || _primitives.Dict.empty; - if (name) { - const localImage = localImageCache.getByName(name); + var patterns = resources.get("Pattern") || _primitives.Dict.empty; - if (localImage) { - operatorList.addOp(localImage.fn, localImage.args); - args = null; - continue; - } - } + var stateManager = new StateManager(initialState); + var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); + var timeSlotManager = new TimeSlotManager(); - next(new Promise(function (resolveXObject, rejectXObject) { - if (!name) { - throw new _util.FormatError("XObject must be referred to by name."); - } + function closePendingRestoreOPS(argument) { + for (var i = 0, ii = preprocessor.savedStatesDepth; i < ii; i++) { + operatorList.addOp(_util.OPS.restore, []); + } + } - let xobj = xobjs.getRaw(name); + return new Promise(function promiseBody(resolve, reject) { + const next = function (promise) { + Promise.all([promise, operatorList.ready]).then(function () { + try { + promiseBody(resolve, reject); + } catch (ex) { + reject(ex); + } + }, reject); + }; - if (xobj instanceof _primitives.Ref) { - const localImage = localImageCache.getByRef(xobj); + task.ensureNotTerminated(); + timeSlotManager.reset(); + var stop, + operation = {}, + i, + ii, + cs, + name; - if (localImage) { - operatorList.addOp(localImage.fn, localImage.args); - resolveXObject(); - return; - } + while (!(stop = timeSlotManager.check())) { + operation.args = null; - const globalImage = self.globalImageCache.getData(xobj, self.pageIndex); + if (!preprocessor.read(operation)) { + break; + } - if (globalImage) { - operatorList.addDependency(globalImage.objId); - operatorList.addOp(globalImage.fn, globalImage.args); - resolveXObject(); - return; - } + var args = operation.args; + var fn = operation.fn; - xobj = xref.fetch(xobj); - } + switch (fn | 0) { + case _util.OPS.paintXObject: + name = args[0].name; - if (!xobj) { - operatorList.addOp(fn, args); - resolveXObject(); - return; - } + if (name) { + const localImage = localImageCache.getByName(name); - if (!(0, _primitives.isStream)(xobj)) { - throw new _util.FormatError("XObject should be a stream"); - } + if (localImage) { + operatorList.addOp(localImage.fn, localImage.args); + args = null; + continue; + } + } - const type = xobj.dict.get("Subtype"); + next(new Promise(function (resolveXObject, rejectXObject) { + if (!name) { + throw new _util.FormatError("XObject must be referred to by name."); + } - if (!(0, _primitives.isName)(type)) { - throw new _util.FormatError("XObject should have a Name subtype"); - } + let xobj = xobjs.getRaw(name); - if (type.name === "Form") { - stateManager.save(); - self.buildFormXObject(resources, xobj, null, operatorList, task, stateManager.state.clone()).then(function () { - stateManager.restore(); - resolveXObject(); - }, rejectXObject); - return; - } else if (type.name === "Image") { - self.buildPaintImageXObject({ - resources, - image: xobj, - operatorList, - cacheKey: name, - localImageCache - }).then(resolveXObject, rejectXObject); - return; - } else if (type.name === "PS") { - (0, _util.info)("Ignored XObject subtype PS"); - } else { - throw new _util.FormatError(`Unhandled XObject subtype ${type.name}`); - } + if (xobj instanceof _primitives.Ref) { + const localImage = localImageCache.getByRef(xobj); - resolveXObject(); - }).catch(function (reason) { - if (reason instanceof _util.AbortException) { + if (localImage) { + operatorList.addOp(localImage.fn, localImage.args); + resolveXObject(); return; } - if (self.options.ignoreErrors) { - self.handler.send("UnsupportedFeature", { - featureId: _util.UNSUPPORTED_FEATURES.errorXObject - }); - (0, _util.warn)(`getOperatorList - ignoring XObject: "${reason}".`); + const globalImage = self.globalImageCache.getData(xobj, self.pageIndex); + + if (globalImage) { + operatorList.addDependency(globalImage.objId); + operatorList.addOp(globalImage.fn, globalImage.args); + resolveXObject(); return; } - throw reason; - })); - return; + xobj = xref.fetch(xobj); + } - case _util.OPS.setFont: - var fontSize = args[1]; - next(self.handleSetFont(resources, args, null, operatorList, task, stateManager.state).then(function (loadedName) { - operatorList.addDependency(loadedName); - operatorList.addOp(_util.OPS.setFont, [loadedName, fontSize]); - })); - return; + if (!(0, _primitives.isStream)(xobj)) { + throw new _util.FormatError("XObject should be a stream"); + } - case _util.OPS.beginText: - parsingText = true; - break; + const type = xobj.dict.get("Subtype"); - case _util.OPS.endText: - parsingText = false; - break; + if (!(0, _primitives.isName)(type)) { + throw new _util.FormatError("XObject should have a Name subtype"); + } - case _util.OPS.endInlineImage: - var cacheKey = args[0].cacheKey; + if (type.name === "Form") { + stateManager.save(); + self.buildFormXObject(resources, xobj, null, operatorList, task, stateManager.state.clone(), localColorSpaceCache).then(function () { + stateManager.restore(); + resolveXObject(); + }, rejectXObject); + return; + } else if (type.name === "Image") { + self.buildPaintImageXObject({ + resources, + image: xobj, + operatorList, + cacheKey: name, + localImageCache, + localColorSpaceCache + }).then(resolveXObject, rejectXObject); + return; + } else if (type.name === "PS") { + (0, _util.info)("Ignored XObject subtype PS"); + } else { + throw new _util.FormatError(`Unhandled XObject subtype ${type.name}`); + } - if (cacheKey) { - const localImage = localImageCache.getByName(cacheKey); + resolveXObject(); + }).catch(function (reason) { + if (reason instanceof _util.AbortException) { + return; + } - if (localImage) { - operatorList.addOp(localImage.fn, localImage.args); - args = null; - continue; - } + if (self.options.ignoreErrors) { + self.handler.send("UnsupportedFeature", { + featureId: _util.UNSUPPORTED_FEATURES.errorXObject + }); + (0, _util.warn)(`getOperatorList - ignoring XObject: "${reason}".`); + return; } - next(self.buildPaintImageXObject({ - resources, - image: args[0], - isInline: true, - operatorList, - cacheKey, - localImageCache - })); - return; + throw reason; + })); + return; - case _util.OPS.showText: - if (!stateManager.state.font) { - self.ensureStateFont(stateManager.state); - continue; - } + case _util.OPS.setFont: + var fontSize = args[1]; + next(self.handleSetFont(resources, args, null, operatorList, task, stateManager.state).then(function (loadedName) { + operatorList.addDependency(loadedName); + operatorList.addOp(_util.OPS.setFont, [loadedName, fontSize]); + })); + return; - args[0] = self.handleText(args[0], stateManager.state); - break; + case _util.OPS.beginText: + parsingText = true; + break; + + case _util.OPS.endText: + parsingText = false; + break; - case _util.OPS.showSpacedText: - if (!stateManager.state.font) { - self.ensureStateFont(stateManager.state); + case _util.OPS.endInlineImage: + var cacheKey = args[0].cacheKey; + + if (cacheKey) { + const localImage = localImageCache.getByName(cacheKey); + + if (localImage) { + operatorList.addOp(localImage.fn, localImage.args); + args = null; continue; } + } - var arr = args[0]; - var combinedGlyphs = []; - var arrLength = arr.length; - var state = stateManager.state; + next(self.buildPaintImageXObject({ + resources, + image: args[0], + isInline: true, + operatorList, + cacheKey, + localImageCache, + localColorSpaceCache + })); + return; - for (i = 0; i < arrLength; ++i) { - var arrItem = arr[i]; + case _util.OPS.showText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } - if ((0, _util.isString)(arrItem)) { - Array.prototype.push.apply(combinedGlyphs, self.handleText(arrItem, state)); - } else if ((0, _util.isNum)(arrItem)) { - combinedGlyphs.push(arrItem); - } - } + args[0] = self.handleText(args[0], stateManager.state); + break; - args[0] = combinedGlyphs; - fn = _util.OPS.showText; - break; + case _util.OPS.showSpacedText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } - case _util.OPS.nextLineShowText: - if (!stateManager.state.font) { - self.ensureStateFont(stateManager.state); - continue; - } + var arr = args[0]; + var combinedGlyphs = []; + var arrLength = arr.length; + var state = stateManager.state; - operatorList.addOp(_util.OPS.nextLine); - args[0] = self.handleText(args[0], stateManager.state); - fn = _util.OPS.showText; - break; + for (i = 0; i < arrLength; ++i) { + var arrItem = arr[i]; - case _util.OPS.nextLineSetSpacingShowText: - if (!stateManager.state.font) { - self.ensureStateFont(stateManager.state); - continue; + if ((0, _util.isString)(arrItem)) { + Array.prototype.push.apply(combinedGlyphs, self.handleText(arrItem, state)); + } else if ((0, _util.isNum)(arrItem)) { + combinedGlyphs.push(arrItem); } + } - operatorList.addOp(_util.OPS.nextLine); - operatorList.addOp(_util.OPS.setWordSpacing, [args.shift()]); - operatorList.addOp(_util.OPS.setCharSpacing, [args.shift()]); - args[0] = self.handleText(args[0], stateManager.state); - fn = _util.OPS.showText; - break; + args[0] = combinedGlyphs; + fn = _util.OPS.showText; + break; - case _util.OPS.setTextRenderingMode: - stateManager.state.textRenderingMode = args[0]; - break; + case _util.OPS.nextLineShowText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } + + operatorList.addOp(_util.OPS.nextLine); + args[0] = self.handleText(args[0], stateManager.state); + fn = _util.OPS.showText; + break; + + case _util.OPS.nextLineSetSpacingShowText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } + + operatorList.addOp(_util.OPS.nextLine); + operatorList.addOp(_util.OPS.setWordSpacing, [args.shift()]); + operatorList.addOp(_util.OPS.setCharSpacing, [args.shift()]); + args[0] = self.handleText(args[0], stateManager.state); + fn = _util.OPS.showText; + break; + + case _util.OPS.setTextRenderingMode: + stateManager.state.textRenderingMode = args[0]; + break; + + case _util.OPS.setFillColorSpace: + { + const cachedColorSpace = _colorspace.ColorSpace.getCached(args[0], xref, localColorSpaceCache); + + if (cachedColorSpace) { + stateManager.state.fillColorSpace = cachedColorSpace; + continue; + } - case _util.OPS.setFillColorSpace: next(self.parseColorSpace({ cs: args[0], - resources + resources, + localColorSpaceCache }).then(function (colorSpace) { if (colorSpace) { stateManager.state.fillColorSpace = colorSpace; } })); return; + } + + case _util.OPS.setStrokeColorSpace: + { + const cachedColorSpace = _colorspace.ColorSpace.getCached(args[0], xref, localColorSpaceCache); + + if (cachedColorSpace) { + stateManager.state.strokeColorSpace = cachedColorSpace; + continue; + } - case _util.OPS.setStrokeColorSpace: next(self.parseColorSpace({ cs: args[0], - resources + resources, + localColorSpaceCache }).then(function (colorSpace) { if (colorSpace) { stateManager.state.strokeColorSpace = colorSpace; } })); return; + } - case _util.OPS.setFillColor: - cs = stateManager.state.fillColorSpace; - args = cs.getRgb(args, 0); - fn = _util.OPS.setFillRGBColor; - break; + case _util.OPS.setFillColor: + cs = stateManager.state.fillColorSpace; + args = cs.getRgb(args, 0); + fn = _util.OPS.setFillRGBColor; + break; - case _util.OPS.setStrokeColor: - cs = stateManager.state.strokeColorSpace; - args = cs.getRgb(args, 0); - fn = _util.OPS.setStrokeRGBColor; - break; + case _util.OPS.setStrokeColor: + cs = stateManager.state.strokeColorSpace; + args = cs.getRgb(args, 0); + fn = _util.OPS.setStrokeRGBColor; + break; - case _util.OPS.setFillGray: - stateManager.state.fillColorSpace = _colorspace.ColorSpace.singletons.gray; - args = _colorspace.ColorSpace.singletons.gray.getRgb(args, 0); - fn = _util.OPS.setFillRGBColor; - break; + case _util.OPS.setFillGray: + stateManager.state.fillColorSpace = _colorspace.ColorSpace.singletons.gray; + args = _colorspace.ColorSpace.singletons.gray.getRgb(args, 0); + fn = _util.OPS.setFillRGBColor; + break; - case _util.OPS.setStrokeGray: - stateManager.state.strokeColorSpace = _colorspace.ColorSpace.singletons.gray; - args = _colorspace.ColorSpace.singletons.gray.getRgb(args, 0); - fn = _util.OPS.setStrokeRGBColor; - break; + case _util.OPS.setStrokeGray: + stateManager.state.strokeColorSpace = _colorspace.ColorSpace.singletons.gray; + args = _colorspace.ColorSpace.singletons.gray.getRgb(args, 0); + fn = _util.OPS.setStrokeRGBColor; + break; - case _util.OPS.setFillCMYKColor: - stateManager.state.fillColorSpace = _colorspace.ColorSpace.singletons.cmyk; - args = _colorspace.ColorSpace.singletons.cmyk.getRgb(args, 0); - fn = _util.OPS.setFillRGBColor; - break; + case _util.OPS.setFillCMYKColor: + stateManager.state.fillColorSpace = _colorspace.ColorSpace.singletons.cmyk; + args = _colorspace.ColorSpace.singletons.cmyk.getRgb(args, 0); + fn = _util.OPS.setFillRGBColor; + break; - case _util.OPS.setStrokeCMYKColor: - stateManager.state.strokeColorSpace = _colorspace.ColorSpace.singletons.cmyk; - args = _colorspace.ColorSpace.singletons.cmyk.getRgb(args, 0); - fn = _util.OPS.setStrokeRGBColor; - break; + case _util.OPS.setStrokeCMYKColor: + stateManager.state.strokeColorSpace = _colorspace.ColorSpace.singletons.cmyk; + args = _colorspace.ColorSpace.singletons.cmyk.getRgb(args, 0); + fn = _util.OPS.setStrokeRGBColor; + break; - case _util.OPS.setFillRGBColor: - stateManager.state.fillColorSpace = _colorspace.ColorSpace.singletons.rgb; - args = _colorspace.ColorSpace.singletons.rgb.getRgb(args, 0); - break; + case _util.OPS.setFillRGBColor: + stateManager.state.fillColorSpace = _colorspace.ColorSpace.singletons.rgb; + args = _colorspace.ColorSpace.singletons.rgb.getRgb(args, 0); + break; - case _util.OPS.setStrokeRGBColor: - stateManager.state.strokeColorSpace = _colorspace.ColorSpace.singletons.rgb; - args = _colorspace.ColorSpace.singletons.rgb.getRgb(args, 0); - break; + case _util.OPS.setStrokeRGBColor: + stateManager.state.strokeColorSpace = _colorspace.ColorSpace.singletons.rgb; + args = _colorspace.ColorSpace.singletons.rgb.getRgb(args, 0); + break; - case _util.OPS.setFillColorN: - cs = stateManager.state.fillColorSpace; + case _util.OPS.setFillColorN: + cs = stateManager.state.fillColorSpace; - if (cs.name === "Pattern") { - next(self.handleColorN(operatorList, _util.OPS.setFillColorN, args, cs, patterns, resources, task)); - return; - } + if (cs.name === "Pattern") { + next(self.handleColorN(operatorList, _util.OPS.setFillColorN, args, cs, patterns, resources, task, localColorSpaceCache)); + return; + } - args = cs.getRgb(args, 0); - fn = _util.OPS.setFillRGBColor; - break; + args = cs.getRgb(args, 0); + fn = _util.OPS.setFillRGBColor; + break; - case _util.OPS.setStrokeColorN: - cs = stateManager.state.strokeColorSpace; + case _util.OPS.setStrokeColorN: + cs = stateManager.state.strokeColorSpace; - if (cs.name === "Pattern") { - next(self.handleColorN(operatorList, _util.OPS.setStrokeColorN, args, cs, patterns, resources, task)); - return; - } + if (cs.name === "Pattern") { + next(self.handleColorN(operatorList, _util.OPS.setStrokeColorN, args, cs, patterns, resources, task, localColorSpaceCache)); + return; + } - args = cs.getRgb(args, 0); - fn = _util.OPS.setStrokeRGBColor; - break; + args = cs.getRgb(args, 0); + fn = _util.OPS.setStrokeRGBColor; + break; + + case _util.OPS.shadingFill: + var shadingRes = resources.get("Shading"); + + if (!shadingRes) { + throw new _util.FormatError("No shading resource found"); + } + + var shading = shadingRes.get(args[0].name); + + if (!shading) { + throw new _util.FormatError("No shading object found"); + } + + var shadingFill = _pattern.Pattern.parseShading(shading, null, xref, resources, self.handler, self._pdfFunctionFactory, localColorSpaceCache); + + var patternIR = shadingFill.getIR(); + args = [patternIR]; + fn = _util.OPS.shadingFill; + break; + + case _util.OPS.setGState: + name = args[0].name; + + if (name) { + const localGStateObj = localGStateCache.getByName(name); - case _util.OPS.shadingFill: - var shadingRes = resources.get("Shading"); + if (localGStateObj) { + if (localGStateObj.length > 0) { + operatorList.addOp(_util.OPS.setGState, [localGStateObj]); + } + + args = null; + continue; + } + } - if (!shadingRes) { - throw new _util.FormatError("No shading resource found"); + next(new Promise(function (resolveGState, rejectGState) { + if (!name) { + throw new _util.FormatError("GState must be referred to by name."); } - var shading = shadingRes.get(args[0].name); + const extGState = resources.get("ExtGState"); - if (!shading) { - throw new _util.FormatError("No shading object found"); + if (!(extGState instanceof _primitives.Dict)) { + throw new _util.FormatError("ExtGState should be a dictionary."); } - var shadingFill = _pattern.Pattern.parseShading(shading, null, xref, resources, self.handler, self.pdfFunctionFactory); + const gState = extGState.get(name); - var patternIR = shadingFill.getIR(); - args = [patternIR]; - fn = _util.OPS.shadingFill; - break; + if (!(gState instanceof _primitives.Dict)) { + throw new _util.FormatError("GState should be a dictionary."); + } - case _util.OPS.setGState: - var dictName = args[0]; - var extGState = resources.get("ExtGState"); + self.setGState({ + resources, + gState, + operatorList, + cacheKey: name, + task, + stateManager, + localGStateCache, + localColorSpaceCache + }).then(resolveGState, rejectGState); + }).catch(function (reason) { + if (reason instanceof _util.AbortException) { + return; + } - if (!(0, _primitives.isDict)(extGState) || !extGState.has(dictName.name)) { - break; + if (self.options.ignoreErrors) { + self.handler.send("UnsupportedFeature", { + featureId: _util.UNSUPPORTED_FEATURES.errorExtGState + }); + (0, _util.warn)(`getOperatorList - ignoring ExtGState: "${reason}".`); + return; } - var gState = extGState.get(dictName.name); - next(self.setGState(resources, gState, operatorList, task, stateManager)); - return; + throw reason; + })); + return; - case _util.OPS.moveTo: - case _util.OPS.lineTo: - case _util.OPS.curveTo: - case _util.OPS.curveTo2: - case _util.OPS.curveTo3: - case _util.OPS.closePath: - case _util.OPS.rectangle: - self.buildPath(operatorList, fn, args, parsingText); - continue; + case _util.OPS.moveTo: + case _util.OPS.lineTo: + case _util.OPS.curveTo: + case _util.OPS.curveTo2: + case _util.OPS.curveTo3: + case _util.OPS.closePath: + case _util.OPS.rectangle: + self.buildPath(operatorList, fn, args, parsingText); + continue; - case _util.OPS.markPoint: - case _util.OPS.markPointProps: - case _util.OPS.beginMarkedContent: - case _util.OPS.beginMarkedContentProps: - case _util.OPS.endMarkedContent: - case _util.OPS.beginCompat: - case _util.OPS.endCompat: + case _util.OPS.markPoint: + case _util.OPS.markPointProps: + case _util.OPS.beginCompat: + case _util.OPS.endCompat: + continue; + + case _util.OPS.beginMarkedContentProps: + if (!(0, _primitives.isName)(args[0])) { + (0, _util.warn)(`Expected name for beginMarkedContentProps arg0=${args[0]}`); continue; + } - default: - if (args !== null) { - for (i = 0, ii = args.length; i < ii; i++) { - if (args[i] instanceof _primitives.Dict) { - break; - } + if (args[0].name === "OC") { + next(self.parseMarkedContentProps(args[1], resources).then(data => { + operatorList.addOp(_util.OPS.beginMarkedContentProps, ["OC", data]); + }).catch(reason => { + if (reason instanceof _util.AbortException) { + return; + } + + if (self.options.ignoreErrors) { + self.handler.send("UnsupportedFeature", { + featureId: _util.UNSUPPORTED_FEATURES.errorMarkedContent + }); + (0, _util.warn)(`getOperatorList - ignoring beginMarkedContentProps: "${reason}".`); + return; } - if (i < ii) { - (0, _util.warn)("getOperatorList - ignoring operator: " + fn); - continue; + throw reason; + })); + return; + } + + args = [args[0].name]; + break; + + case _util.OPS.beginMarkedContent: + case _util.OPS.endMarkedContent: + default: + if (args !== null) { + for (i = 0, ii = args.length; i < ii; i++) { + if (args[i] instanceof _primitives.Dict) { + break; } } - } + if (i < ii) { + (0, _util.warn)("getOperatorList - ignoring operator: " + fn); + continue; + } + } - operatorList.addOp(fn, args); } - if (stop) { - next(deferred); - return; - } + operatorList.addOp(fn, args); + } - closePendingRestoreOPS(); - resolve(); - }).catch(reason => { - if (reason instanceof _util.AbortException) { - return; - } + if (stop) { + next(deferred); + return; + } - if (this.options.ignoreErrors) { - this.handler.send("UnsupportedFeature", { - featureId: _util.UNSUPPORTED_FEATURES.errorOperatorList - }); - (0, _util.warn)(`getOperatorList - ignoring errors during "${task.name}" ` + `task: "${reason}".`); - closePendingRestoreOPS(); - return; - } + closePendingRestoreOPS(); + resolve(); + }).catch(reason => { + if (reason instanceof _util.AbortException) { + return; + } - throw reason; - }); - }, + if (this.options.ignoreErrors) { + this.handler.send("UnsupportedFeature", { + featureId: _util.UNSUPPORTED_FEATURES.errorOperatorList + }); + (0, _util.warn)(`getOperatorList - ignoring errors during "${task.name}" ` + `task: "${reason}".`); + closePendingRestoreOPS(); + return; + } - getTextContent({ - stream, - task, - resources, - stateManager = null, - normalizeWhitespace = false, - combineTextItems = false, - sink, - seenStyles = Object.create(null) - }) { - resources = resources || _primitives.Dict.empty; - stateManager = stateManager || new StateManager(new TextState()); - var WhitespaceRegexp = /\s/g; - var textContent = { - items: [], - styles: Object.create(null) - }; - var textContentItem = { - initialized: false, - str: [], - width: 0, - height: 0, - vertical: false, - lastAdvanceWidth: 0, - lastAdvanceHeight: 0, - textAdvanceScale: 0, - spaceWidth: 0, - fakeSpaceMin: Infinity, - fakeMultiSpaceMin: Infinity, - fakeMultiSpaceMax: -0, - textRunBreakAllowed: false, - transform: null, - fontName: null - }; - var SPACE_FACTOR = 0.3; - var MULTI_SPACE_FACTOR = 1.5; - var MULTI_SPACE_FACTOR_MAX = 4; - var self = this; - var xref = this.xref; - var xobjs = null; - const emptyXObjectCache = new _image_utils.LocalImageCache(); - var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); - var textState; - - function ensureTextContentItem() { - if (textContentItem.initialized) { - return textContentItem; - } - - var font = textState.font; - - if (!(font.loadedName in seenStyles)) { - seenStyles[font.loadedName] = true; - textContent.styles[font.loadedName] = { - fontFamily: font.fallbackName, - ascent: font.ascent, - descent: font.descent, - vertical: font.vertical - }; - } + throw reason; + }); + } - textContentItem.fontName = font.loadedName; - var tsm = [textState.fontSize * textState.textHScale, 0, 0, textState.fontSize, 0, textState.textRise]; + getTextContent({ + stream, + task, + resources, + stateManager = null, + normalizeWhitespace = false, + combineTextItems = false, + sink, + seenStyles = Object.create(null) + }) { + resources = resources || _primitives.Dict.empty; + stateManager = stateManager || new StateManager(new TextState()); + var WhitespaceRegexp = /\s/g; + var textContent = { + items: [], + styles: Object.create(null) + }; + var textContentItem = { + initialized: false, + str: [], + width: 0, + height: 0, + vertical: false, + lastAdvanceWidth: 0, + lastAdvanceHeight: 0, + textAdvanceScale: 0, + spaceWidth: 0, + fakeSpaceMin: Infinity, + fakeMultiSpaceMin: Infinity, + fakeMultiSpaceMax: -0, + textRunBreakAllowed: false, + transform: null, + fontName: null + }; + var SPACE_FACTOR = 0.3; + var MULTI_SPACE_FACTOR = 1.5; + var MULTI_SPACE_FACTOR_MAX = 4; + var self = this; + var xref = this.xref; + var xobjs = null; + const emptyXObjectCache = new _image_utils.LocalImageCache(); + const emptyGStateCache = new _image_utils.LocalGStateCache(); + var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); + var textState; + + function ensureTextContentItem() { + if (textContentItem.initialized) { + return textContentItem; + } - if (font.isType3Font && textState.fontSize <= 1 && !(0, _util.isArrayEqual)(textState.fontMatrix, _util.FONT_IDENTITY_MATRIX)) { - const glyphHeight = font.bbox[3] - font.bbox[1]; + var font = textState.font; - if (glyphHeight > 0) { - tsm[3] *= glyphHeight * textState.fontMatrix[3]; - } - } + if (!(font.loadedName in seenStyles)) { + seenStyles[font.loadedName] = true; + textContent.styles[font.loadedName] = { + fontFamily: font.fallbackName, + ascent: font.ascent, + descent: font.descent, + vertical: font.vertical + }; + } - var trm = _util.Util.transform(textState.ctm, _util.Util.transform(textState.textMatrix, tsm)); + textContentItem.fontName = font.loadedName; + var tsm = [textState.fontSize * textState.textHScale, 0, 0, textState.fontSize, 0, textState.textRise]; - textContentItem.transform = trm; + if (font.isType3Font && textState.fontSize <= 1 && !(0, _util.isArrayEqual)(textState.fontMatrix, _util.FONT_IDENTITY_MATRIX)) { + const glyphHeight = font.bbox[3] - font.bbox[1]; - if (!font.vertical) { - textContentItem.width = 0; - textContentItem.height = Math.sqrt(trm[2] * trm[2] + trm[3] * trm[3]); - textContentItem.vertical = false; - } else { - textContentItem.width = Math.sqrt(trm[0] * trm[0] + trm[1] * trm[1]); - textContentItem.height = 0; - textContentItem.vertical = true; - } - - var a = textState.textLineMatrix[0]; - var b = textState.textLineMatrix[1]; - var scaleLineX = Math.sqrt(a * a + b * b); - a = textState.ctm[0]; - b = textState.ctm[1]; - var scaleCtmX = Math.sqrt(a * a + b * b); - textContentItem.textAdvanceScale = scaleCtmX * scaleLineX; - textContentItem.lastAdvanceWidth = 0; - textContentItem.lastAdvanceHeight = 0; - var spaceWidth = font.spaceWidth / 1000 * textState.fontSize; - - if (spaceWidth) { - textContentItem.spaceWidth = spaceWidth; - textContentItem.fakeSpaceMin = spaceWidth * SPACE_FACTOR; - textContentItem.fakeMultiSpaceMin = spaceWidth * MULTI_SPACE_FACTOR; - textContentItem.fakeMultiSpaceMax = spaceWidth * MULTI_SPACE_FACTOR_MAX; - textContentItem.textRunBreakAllowed = !font.isMonospace; - } else { - textContentItem.spaceWidth = 0; - textContentItem.fakeSpaceMin = Infinity; - textContentItem.fakeMultiSpaceMin = Infinity; - textContentItem.fakeMultiSpaceMax = 0; - textContentItem.textRunBreakAllowed = false; + if (glyphHeight > 0) { + tsm[3] *= glyphHeight * textState.fontMatrix[3]; } - - textContentItem.initialized = true; - return textContentItem; } - function replaceWhitespace(str) { - var i = 0, - ii = str.length, - code; + var trm = _util.Util.transform(textState.ctm, _util.Util.transform(textState.textMatrix, tsm)); - while (i < ii && (code = str.charCodeAt(i)) >= 0x20 && code <= 0x7f) { - i++; - } + textContentItem.transform = trm; - return i < ii ? str.replace(WhitespaceRegexp, " ") : str; + if (!font.vertical) { + textContentItem.width = 0; + textContentItem.height = Math.sqrt(trm[2] * trm[2] + trm[3] * trm[3]); + textContentItem.vertical = false; + } else { + textContentItem.width = Math.sqrt(trm[0] * trm[0] + trm[1] * trm[1]); + textContentItem.height = 0; + textContentItem.vertical = true; + } + + var a = textState.textLineMatrix[0]; + var b = textState.textLineMatrix[1]; + var scaleLineX = Math.sqrt(a * a + b * b); + a = textState.ctm[0]; + b = textState.ctm[1]; + var scaleCtmX = Math.sqrt(a * a + b * b); + textContentItem.textAdvanceScale = scaleCtmX * scaleLineX; + textContentItem.lastAdvanceWidth = 0; + textContentItem.lastAdvanceHeight = 0; + var spaceWidth = font.spaceWidth / 1000 * textState.fontSize; + + if (spaceWidth) { + textContentItem.spaceWidth = spaceWidth; + textContentItem.fakeSpaceMin = spaceWidth * SPACE_FACTOR; + textContentItem.fakeMultiSpaceMin = spaceWidth * MULTI_SPACE_FACTOR; + textContentItem.fakeMultiSpaceMax = spaceWidth * MULTI_SPACE_FACTOR_MAX; + textContentItem.textRunBreakAllowed = !font.isMonospace; + } else { + textContentItem.spaceWidth = 0; + textContentItem.fakeSpaceMin = Infinity; + textContentItem.fakeMultiSpaceMin = Infinity; + textContentItem.fakeMultiSpaceMax = 0; + textContentItem.textRunBreakAllowed = false; } - function runBidiTransform(textChunk) { - var str = textChunk.str.join(""); - var bidiResult = (0, _bidi.bidi)(str, -1, textChunk.vertical); - return { - str: normalizeWhitespace ? replaceWhitespace(bidiResult.str) : bidiResult.str, - dir: bidiResult.dir, - width: textChunk.width, - height: textChunk.height, - transform: textChunk.transform, - fontName: textChunk.fontName - }; - } + textContentItem.initialized = true; + return textContentItem; + } - function handleSetFont(fontName, fontRef) { - return self.loadFont(fontName, fontRef, resources).then(function (translated) { - textState.font = translated.font; - textState.fontMatrix = translated.font.fontMatrix || _util.FONT_IDENTITY_MATRIX; - }); + function replaceWhitespace(str) { + var i = 0, + ii = str.length, + code; + + while (i < ii && (code = str.charCodeAt(i)) >= 0x20 && code <= 0x7f) { + i++; } - function buildTextContentItem(chars) { - var font = textState.font; - var textChunk = ensureTextContentItem(); - var width = 0; - var height = 0; - var glyphs = font.charsToGlyphs(chars); + return i < ii ? str.replace(WhitespaceRegexp, " ") : str; + } - for (var i = 0; i < glyphs.length; i++) { - var glyph = glyphs[i]; - var glyphWidth = null; + function runBidiTransform(textChunk) { + var str = textChunk.str.join(""); + var bidiResult = (0, _bidi.bidi)(str, -1, textChunk.vertical); + return { + str: normalizeWhitespace ? replaceWhitespace(bidiResult.str) : bidiResult.str, + dir: bidiResult.dir, + width: textChunk.width, + height: textChunk.height, + transform: textChunk.transform, + fontName: textChunk.fontName + }; + } - if (font.vertical && glyph.vmetric) { - glyphWidth = glyph.vmetric[0]; - } else { - glyphWidth = glyph.width; - } + function handleSetFont(fontName, fontRef) { + return self.loadFont(fontName, fontRef, resources).then(function (translated) { + textState.font = translated.font; + textState.fontMatrix = translated.font.fontMatrix || _util.FONT_IDENTITY_MATRIX; + }); + } - var glyphUnicode = glyph.unicode; - var NormalizedUnicodes = (0, _unicode.getNormalizedUnicodes)(); + function buildTextContentItem(chars) { + var font = textState.font; + var textChunk = ensureTextContentItem(); + var width = 0; + var height = 0; + var glyphs = font.charsToGlyphs(chars); - if (NormalizedUnicodes[glyphUnicode] !== undefined) { - glyphUnicode = NormalizedUnicodes[glyphUnicode]; - } + for (var i = 0; i < glyphs.length; i++) { + var glyph = glyphs[i]; + var glyphWidth = null; + + if (font.vertical && glyph.vmetric) { + glyphWidth = glyph.vmetric[0]; + } else { + glyphWidth = glyph.width; + } - glyphUnicode = (0, _unicode.reverseIfRtl)(glyphUnicode); - var charSpacing = textState.charSpacing; + var glyphUnicode = glyph.unicode; + var NormalizedUnicodes = (0, _unicode.getNormalizedUnicodes)(); - if (glyph.isSpace) { - var wordSpacing = textState.wordSpacing; - charSpacing += wordSpacing; + if (NormalizedUnicodes[glyphUnicode] !== undefined) { + glyphUnicode = NormalizedUnicodes[glyphUnicode]; + } - if (wordSpacing > 0) { - addFakeSpaces(wordSpacing, textChunk.str); - } - } + glyphUnicode = (0, _unicode.reverseIfRtl)(glyphUnicode); + var charSpacing = textState.charSpacing; - var tx = 0; - var ty = 0; + if (glyph.isSpace) { + var wordSpacing = textState.wordSpacing; + charSpacing += wordSpacing; - if (!font.vertical) { - var w0 = glyphWidth * textState.fontMatrix[0]; - tx = (w0 * textState.fontSize + charSpacing) * textState.textHScale; - width += tx; - } else { - var w1 = glyphWidth * textState.fontMatrix[0]; - ty = w1 * textState.fontSize + charSpacing; - height += ty; + if (wordSpacing > 0) { + addFakeSpaces(wordSpacing, textChunk.str); } - - textState.translateTextMatrix(tx, ty); - textChunk.str.push(glyphUnicode); } + var tx = 0; + var ty = 0; + if (!font.vertical) { - textChunk.lastAdvanceWidth = width; - textChunk.width += width; + var w0 = glyphWidth * textState.fontMatrix[0]; + tx = (w0 * textState.fontSize + charSpacing) * textState.textHScale; + width += tx; } else { - textChunk.lastAdvanceHeight = height; - textChunk.height += Math.abs(height); + var w1 = glyphWidth * textState.fontMatrix[0]; + ty = w1 * textState.fontSize + charSpacing; + height += ty; } - return textChunk; + textState.translateTextMatrix(tx, ty); + textChunk.str.push(glyphUnicode); } - function addFakeSpaces(width, strBuf) { - if (width < textContentItem.fakeSpaceMin) { - return; - } - - if (width < textContentItem.fakeMultiSpaceMin) { - strBuf.push(" "); - return; - } + if (!font.vertical) { + textChunk.lastAdvanceWidth = width; + textChunk.width += width; + } else { + textChunk.lastAdvanceHeight = height; + textChunk.height += Math.abs(height); + } - var fakeSpaces = Math.round(width / textContentItem.spaceWidth); + return textChunk; + } - while (fakeSpaces-- > 0) { - strBuf.push(" "); - } + function addFakeSpaces(width, strBuf) { + if (width < textContentItem.fakeSpaceMin) { + return; } - function flushTextContentItem() { - if (!textContentItem.initialized) { - return; - } + if (width < textContentItem.fakeMultiSpaceMin) { + strBuf.push(" "); + return; + } - if (!textContentItem.vertical) { - textContentItem.width *= textContentItem.textAdvanceScale; - } else { - textContentItem.height *= textContentItem.textAdvanceScale; - } + var fakeSpaces = Math.round(width / textContentItem.spaceWidth); - textContent.items.push(runBidiTransform(textContentItem)); - textContentItem.initialized = false; - textContentItem.str.length = 0; + while (fakeSpaces-- > 0) { + strBuf.push(" "); } + } - function enqueueChunk() { - const length = textContent.items.length; + function flushTextContentItem() { + if (!textContentItem.initialized) { + return; + } - if (length > 0) { - sink.enqueue(textContent, length); - textContent.items = []; - textContent.styles = Object.create(null); - } + if (!textContentItem.vertical) { + textContentItem.width *= textContentItem.textAdvanceScale; + } else { + textContentItem.height *= textContentItem.textAdvanceScale; } - var timeSlotManager = new TimeSlotManager(); - return new Promise(function promiseBody(resolve, reject) { - const next = function (promise) { - enqueueChunk(); - Promise.all([promise, sink.ready]).then(function () { - try { - promiseBody(resolve, reject); - } catch (ex) { - reject(ex); - } - }, reject); - }; + textContent.items.push(runBidiTransform(textContentItem)); + textContentItem.initialized = false; + textContentItem.str.length = 0; + } - task.ensureNotTerminated(); - timeSlotManager.reset(); - var stop, - operation = {}, - args = []; + function enqueueChunk() { + const length = textContent.items.length; - while (!(stop = timeSlotManager.check())) { - args.length = 0; - operation.args = args; + if (length > 0) { + sink.enqueue(textContent, length); + textContent.items = []; + textContent.styles = Object.create(null); + } + } - if (!preprocessor.read(operation)) { - break; + var timeSlotManager = new TimeSlotManager(); + return new Promise(function promiseBody(resolve, reject) { + const next = function (promise) { + enqueueChunk(); + Promise.all([promise, sink.ready]).then(function () { + try { + promiseBody(resolve, reject); + } catch (ex) { + reject(ex); } + }, reject); + }; - textState = stateManager.state; - var fn = operation.fn; - args = operation.args; - var advance, diff; + task.ensureNotTerminated(); + timeSlotManager.reset(); + var stop, + operation = {}, + args = []; - switch (fn | 0) { - case _util.OPS.setFont: - var fontNameArg = args[0].name, - fontSizeArg = args[1]; + while (!(stop = timeSlotManager.check())) { + args.length = 0; + operation.args = args; - if (textState.font && fontNameArg === textState.fontName && fontSizeArg === textState.fontSize) { - break; - } + if (!preprocessor.read(operation)) { + break; + } - flushTextContentItem(); - textState.fontName = fontNameArg; - textState.fontSize = fontSizeArg; - next(handleSetFont(fontNameArg, null)); - return; + textState = stateManager.state; + var fn = operation.fn; + args = operation.args; + var advance, diff; - case _util.OPS.setTextRise: - flushTextContentItem(); - textState.textRise = args[0]; - break; + switch (fn | 0) { + case _util.OPS.setFont: + var fontNameArg = args[0].name, + fontSizeArg = args[1]; - case _util.OPS.setHScale: - flushTextContentItem(); - textState.textHScale = args[0] / 100; + if (textState.font && fontNameArg === textState.fontName && fontSizeArg === textState.fontSize) { break; + } - case _util.OPS.setLeading: - flushTextContentItem(); - textState.leading = args[0]; - break; + flushTextContentItem(); + textState.fontName = fontNameArg; + textState.fontSize = fontSizeArg; + next(handleSetFont(fontNameArg, null)); + return; - case _util.OPS.moveText: - var isSameTextLine = !textState.font ? false : (textState.font.vertical ? args[0] : args[1]) === 0; - advance = args[0] - args[1]; + case _util.OPS.setTextRise: + flushTextContentItem(); + textState.textRise = args[0]; + break; - if (combineTextItems && isSameTextLine && textContentItem.initialized && advance > 0 && advance <= textContentItem.fakeMultiSpaceMax) { - textState.translateTextLineMatrix(args[0], args[1]); - textContentItem.width += args[0] - textContentItem.lastAdvanceWidth; - textContentItem.height += args[1] - textContentItem.lastAdvanceHeight; - diff = args[0] - textContentItem.lastAdvanceWidth - (args[1] - textContentItem.lastAdvanceHeight); - addFakeSpaces(diff, textContentItem.str); - break; - } + case _util.OPS.setHScale: + flushTextContentItem(); + textState.textHScale = args[0] / 100; + break; - flushTextContentItem(); - textState.translateTextLineMatrix(args[0], args[1]); - textState.textMatrix = textState.textLineMatrix.slice(); - break; + case _util.OPS.setLeading: + flushTextContentItem(); + textState.leading = args[0]; + break; - case _util.OPS.setLeadingMoveText: - flushTextContentItem(); - textState.leading = -args[1]; + case _util.OPS.moveText: + var isSameTextLine = !textState.font ? false : (textState.font.vertical ? args[0] : args[1]) === 0; + advance = args[0] - args[1]; + + if (combineTextItems && isSameTextLine && textContentItem.initialized && advance > 0 && advance <= textContentItem.fakeMultiSpaceMax) { textState.translateTextLineMatrix(args[0], args[1]); - textState.textMatrix = textState.textLineMatrix.slice(); + textContentItem.width += args[0] - textContentItem.lastAdvanceWidth; + textContentItem.height += args[1] - textContentItem.lastAdvanceHeight; + diff = args[0] - textContentItem.lastAdvanceWidth - (args[1] - textContentItem.lastAdvanceHeight); + addFakeSpaces(diff, textContentItem.str); break; + } - case _util.OPS.nextLine: - flushTextContentItem(); - textState.carriageReturn(); - break; + flushTextContentItem(); + textState.translateTextLineMatrix(args[0], args[1]); + textState.textMatrix = textState.textLineMatrix.slice(); + break; - case _util.OPS.setTextMatrix: - advance = textState.calcTextLineMatrixAdvance(args[0], args[1], args[2], args[3], args[4], args[5]); + case _util.OPS.setLeadingMoveText: + flushTextContentItem(); + textState.leading = -args[1]; + textState.translateTextLineMatrix(args[0], args[1]); + textState.textMatrix = textState.textLineMatrix.slice(); + break; - if (combineTextItems && advance !== null && textContentItem.initialized && advance.value > 0 && advance.value <= textContentItem.fakeMultiSpaceMax) { - textState.translateTextLineMatrix(advance.width, advance.height); - textContentItem.width += advance.width - textContentItem.lastAdvanceWidth; - textContentItem.height += advance.height - textContentItem.lastAdvanceHeight; - diff = advance.width - textContentItem.lastAdvanceWidth - (advance.height - textContentItem.lastAdvanceHeight); - addFakeSpaces(diff, textContentItem.str); - break; - } + case _util.OPS.nextLine: + flushTextContentItem(); + textState.carriageReturn(); + break; - flushTextContentItem(); - textState.setTextMatrix(args[0], args[1], args[2], args[3], args[4], args[5]); - textState.setTextLineMatrix(args[0], args[1], args[2], args[3], args[4], args[5]); - break; + case _util.OPS.setTextMatrix: + advance = textState.calcTextLineMatrixAdvance(args[0], args[1], args[2], args[3], args[4], args[5]); - case _util.OPS.setCharSpacing: - textState.charSpacing = args[0]; + if (combineTextItems && advance !== null && textContentItem.initialized && advance.value > 0 && advance.value <= textContentItem.fakeMultiSpaceMax) { + textState.translateTextLineMatrix(advance.width, advance.height); + textContentItem.width += advance.width - textContentItem.lastAdvanceWidth; + textContentItem.height += advance.height - textContentItem.lastAdvanceHeight; + diff = advance.width - textContentItem.lastAdvanceWidth - (advance.height - textContentItem.lastAdvanceHeight); + addFakeSpaces(diff, textContentItem.str); break; + } - case _util.OPS.setWordSpacing: - textState.wordSpacing = args[0]; - break; + flushTextContentItem(); + textState.setTextMatrix(args[0], args[1], args[2], args[3], args[4], args[5]); + textState.setTextLineMatrix(args[0], args[1], args[2], args[3], args[4], args[5]); + break; - case _util.OPS.beginText: - flushTextContentItem(); - textState.textMatrix = _util.IDENTITY_MATRIX.slice(); - textState.textLineMatrix = _util.IDENTITY_MATRIX.slice(); - break; + case _util.OPS.setCharSpacing: + textState.charSpacing = args[0]; + break; - case _util.OPS.showSpacedText: - if (!stateManager.state.font) { - self.ensureStateFont(stateManager.state); - continue; - } + case _util.OPS.setWordSpacing: + textState.wordSpacing = args[0]; + break; - var items = args[0]; - var offset; - - for (var j = 0, jj = items.length; j < jj; j++) { - if (typeof items[j] === "string") { - buildTextContentItem(items[j]); - } else if ((0, _util.isNum)(items[j])) { - ensureTextContentItem(); - advance = items[j] * textState.fontSize / 1000; - var breakTextRun = false; - - if (textState.font.vertical) { - offset = advance; - textState.translateTextMatrix(0, offset); - breakTextRun = textContentItem.textRunBreakAllowed && advance > textContentItem.fakeMultiSpaceMax; - - if (!breakTextRun) { - textContentItem.height += offset; - } - } else { - advance = -advance; - offset = advance * textState.textHScale; - textState.translateTextMatrix(offset, 0); - breakTextRun = textContentItem.textRunBreakAllowed && advance > textContentItem.fakeMultiSpaceMax; - - if (!breakTextRun) { - textContentItem.width += offset; - } + case _util.OPS.beginText: + flushTextContentItem(); + textState.textMatrix = _util.IDENTITY_MATRIX.slice(); + textState.textLineMatrix = _util.IDENTITY_MATRIX.slice(); + break; + + case _util.OPS.showSpacedText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } + + var items = args[0]; + var offset; + + for (var j = 0, jj = items.length; j < jj; j++) { + if (typeof items[j] === "string") { + buildTextContentItem(items[j]); + } else if ((0, _util.isNum)(items[j])) { + ensureTextContentItem(); + advance = items[j] * textState.fontSize / 1000; + var breakTextRun = false; + + if (textState.font.vertical) { + offset = advance; + textState.translateTextMatrix(0, offset); + breakTextRun = textContentItem.textRunBreakAllowed && advance > textContentItem.fakeMultiSpaceMax; + + if (!breakTextRun) { + textContentItem.height += offset; } + } else { + advance = -advance; + offset = advance * textState.textHScale; + textState.translateTextMatrix(offset, 0); + breakTextRun = textContentItem.textRunBreakAllowed && advance > textContentItem.fakeMultiSpaceMax; - if (breakTextRun) { - flushTextContentItem(); - } else if (advance > 0) { - addFakeSpaces(advance, textContentItem.str); + if (!breakTextRun) { + textContentItem.width += offset; } } - } - - break; - case _util.OPS.showText: - if (!stateManager.state.font) { - self.ensureStateFont(stateManager.state); - continue; + if (breakTextRun) { + flushTextContentItem(); + } else if (advance > 0) { + addFakeSpaces(advance, textContentItem.str); + } } + } - buildTextContentItem(args[0]); - break; + break; - case _util.OPS.nextLineShowText: - if (!stateManager.state.font) { - self.ensureStateFont(stateManager.state); - continue; - } + case _util.OPS.showText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } - flushTextContentItem(); - textState.carriageReturn(); - buildTextContentItem(args[0]); - break; + buildTextContentItem(args[0]); + break; - case _util.OPS.nextLineSetSpacingShowText: - if (!stateManager.state.font) { - self.ensureStateFont(stateManager.state); - continue; - } + case _util.OPS.nextLineShowText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } - flushTextContentItem(); - textState.wordSpacing = args[0]; - textState.charSpacing = args[1]; - textState.carriageReturn(); - buildTextContentItem(args[2]); - break; + flushTextContentItem(); + textState.carriageReturn(); + buildTextContentItem(args[0]); + break; - case _util.OPS.paintXObject: - flushTextContentItem(); + case _util.OPS.nextLineSetSpacingShowText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } - if (!xobjs) { - xobjs = resources.get("XObject") || _primitives.Dict.empty; - } + flushTextContentItem(); + textState.wordSpacing = args[0]; + textState.charSpacing = args[1]; + textState.carriageReturn(); + buildTextContentItem(args[2]); + break; - var name = args[0].name; + case _util.OPS.paintXObject: + flushTextContentItem(); - if (name && emptyXObjectCache.getByName(name)) { - break; - } + if (!xobjs) { + xobjs = resources.get("XObject") || _primitives.Dict.empty; + } - next(new Promise(function (resolveXObject, rejectXObject) { - if (!name) { - throw new _util.FormatError("XObject must be referred to by name."); - } + var name = args[0].name; - let xobj = xobjs.getRaw(name); + if (name && emptyXObjectCache.getByName(name)) { + break; + } - if (xobj instanceof _primitives.Ref) { - if (emptyXObjectCache.getByRef(xobj)) { - resolveXObject(); - return; - } + next(new Promise(function (resolveXObject, rejectXObject) { + if (!name) { + throw new _util.FormatError("XObject must be referred to by name."); + } - xobj = xref.fetch(xobj); - } + let xobj = xobjs.getRaw(name); - if (!xobj) { + if (xobj instanceof _primitives.Ref) { + if (emptyXObjectCache.getByRef(xobj)) { resolveXObject(); return; } - if (!(0, _primitives.isStream)(xobj)) { - throw new _util.FormatError("XObject should be a stream"); - } + xobj = xref.fetch(xobj); + } - const type = xobj.dict.get("Subtype"); + if (!(0, _primitives.isStream)(xobj)) { + throw new _util.FormatError("XObject should be a stream"); + } - if (!(0, _primitives.isName)(type)) { - throw new _util.FormatError("XObject should have a Name subtype"); - } + const type = xobj.dict.get("Subtype"); - if (type.name !== "Form") { - emptyXObjectCache.set(name, xobj.dict.objId, true); - resolveXObject(); - return; - } - - const currentState = stateManager.state.clone(); - const xObjStateManager = new StateManager(currentState); - const matrix = xobj.dict.getArray("Matrix"); + if (!(0, _primitives.isName)(type)) { + throw new _util.FormatError("XObject should have a Name subtype"); + } - if (Array.isArray(matrix) && matrix.length === 6) { - xObjStateManager.transform(matrix); - } + if (type.name !== "Form") { + emptyXObjectCache.set(name, xobj.dict.objId, true); + resolveXObject(); + return; + } - enqueueChunk(); - const sinkWrapper = { - enqueueInvoked: false, + const currentState = stateManager.state.clone(); + const xObjStateManager = new StateManager(currentState); + const matrix = xobj.dict.getArray("Matrix"); - enqueue(chunk, size) { - this.enqueueInvoked = true; - sink.enqueue(chunk, size); - }, + if (Array.isArray(matrix) && matrix.length === 6) { + xObjStateManager.transform(matrix); + } - get desiredSize() { - return sink.desiredSize; - }, + enqueueChunk(); + const sinkWrapper = { + enqueueInvoked: false, - get ready() { - return sink.ready; - } + enqueue(chunk, size) { + this.enqueueInvoked = true; + sink.enqueue(chunk, size); + }, - }; - self.getTextContent({ - stream: xobj, - task, - resources: xobj.dict.get("Resources") || resources, - stateManager: xObjStateManager, - normalizeWhitespace, - combineTextItems, - sink: sinkWrapper, - seenStyles - }).then(function () { - if (!sinkWrapper.enqueueInvoked) { - emptyXObjectCache.set(name, xobj.dict.objId, true); - } + get desiredSize() { + return sink.desiredSize; + }, - resolveXObject(); - }, rejectXObject); - }).catch(function (reason) { - if (reason instanceof _util.AbortException) { - return; + get ready() { + return sink.ready; } - if (self.options.ignoreErrors) { - (0, _util.warn)(`getTextContent - ignoring XObject: "${reason}".`); - return; + }; + self.getTextContent({ + stream: xobj, + task, + resources: xobj.dict.get("Resources") || resources, + stateManager: xObjStateManager, + normalizeWhitespace, + combineTextItems, + sink: sinkWrapper, + seenStyles + }).then(function () { + if (!sinkWrapper.enqueueInvoked) { + emptyXObjectCache.set(name, xobj.dict.objId, true); } - throw reason; - })); - return; + resolveXObject(); + }, rejectXObject); + }).catch(function (reason) { + if (reason instanceof _util.AbortException) { + return; + } - case _util.OPS.setGState: - flushTextContentItem(); - var dictName = args[0]; - var extGState = resources.get("ExtGState"); + if (self.options.ignoreErrors) { + (0, _util.warn)(`getTextContent - ignoring XObject: "${reason}".`); + return; + } - if (!(0, _primitives.isDict)(extGState) || !(0, _primitives.isName)(dictName)) { - break; + throw reason; + })); + return; + + case _util.OPS.setGState: + name = args[0].name; + + if (name && emptyGStateCache.getByName(name)) { + break; + } + + next(new Promise(function (resolveGState, rejectGState) { + if (!name) { + throw new _util.FormatError("GState must be referred to by name."); } - var gState = extGState.get(dictName.name); + const extGState = resources.get("ExtGState"); - if (!(0, _primitives.isDict)(gState)) { - break; + if (!(extGState instanceof _primitives.Dict)) { + throw new _util.FormatError("ExtGState should be a dictionary."); + } + + const gState = extGState.get(name); + + if (!(gState instanceof _primitives.Dict)) { + throw new _util.FormatError("GState should be a dictionary."); } - var gStateFont = gState.get("Font"); + const gStateFont = gState.get("Font"); - if (gStateFont) { - textState.fontName = null; - textState.fontSize = gStateFont[1]; - next(handleSetFont(null, gStateFont[0])); + if (!gStateFont) { + emptyGStateCache.set(name, gState.objId, true); + resolveGState(); return; } - break; - } + flushTextContentItem(); + textState.fontName = null; + textState.fontSize = gStateFont[1]; + handleSetFont(null, gStateFont[0]).then(resolveGState, rejectGState); + }).catch(function (reason) { + if (reason instanceof _util.AbortException) { + return; + } - if (textContent.items.length >= sink.desiredSize) { - stop = true; - break; - } - } + if (self.options.ignoreErrors) { + (0, _util.warn)(`getTextContent - ignoring ExtGState: "${reason}".`); + return; + } - if (stop) { - next(deferred); - return; + throw reason; + })); + return; } - flushTextContentItem(); - enqueueChunk(); - resolve(); - }).catch(reason => { - if (reason instanceof _util.AbortException) { - return; + if (textContent.items.length >= sink.desiredSize) { + stop = true; + break; } + } - if (this.options.ignoreErrors) { - (0, _util.warn)(`getTextContent - ignoring errors during "${task.name}" ` + `task: "${reason}".`); - flushTextContentItem(); - enqueueChunk(); - return; - } + if (stop) { + next(deferred); + return; + } - throw reason; - }); - }, + flushTextContentItem(); + enqueueChunk(); + resolve(); + }).catch(reason => { + if (reason instanceof _util.AbortException) { + return; + } - extractDataStructures: function PartialEvaluator_extractDataStructures(dict, baseDict, properties) { - const xref = this.xref; - let cidToGidBytes; - var toUnicode = dict.get("ToUnicode") || baseDict.get("ToUnicode"); - var toUnicodePromise = toUnicode ? this.readToUnicode(toUnicode) : Promise.resolve(undefined); + if (this.options.ignoreErrors) { + (0, _util.warn)(`getTextContent - ignoring errors during "${task.name}" ` + `task: "${reason}".`); + flushTextContentItem(); + enqueueChunk(); + return; + } - if (properties.composite) { - var cidSystemInfo = dict.get("CIDSystemInfo"); + throw reason; + }); + } - if ((0, _primitives.isDict)(cidSystemInfo)) { - properties.cidSystemInfo = { - registry: (0, _util.stringToPDFString)(cidSystemInfo.get("Registry")), - ordering: (0, _util.stringToPDFString)(cidSystemInfo.get("Ordering")), - supplement: cidSystemInfo.get("Supplement") - }; - } + extractDataStructures(dict, baseDict, properties) { + const xref = this.xref; + let cidToGidBytes; + var toUnicode = dict.get("ToUnicode") || baseDict.get("ToUnicode"); + var toUnicodePromise = toUnicode ? this.readToUnicode(toUnicode) : Promise.resolve(undefined); + + if (properties.composite) { + var cidSystemInfo = dict.get("CIDSystemInfo"); + + if ((0, _primitives.isDict)(cidSystemInfo)) { + properties.cidSystemInfo = { + registry: (0, _util.stringToPDFString)(cidSystemInfo.get("Registry")), + ordering: (0, _util.stringToPDFString)(cidSystemInfo.get("Ordering")), + supplement: cidSystemInfo.get("Supplement") + }; + } - var cidToGidMap = dict.get("CIDToGIDMap"); + var cidToGidMap = dict.get("CIDToGIDMap"); - if ((0, _primitives.isStream)(cidToGidMap)) { - cidToGidBytes = cidToGidMap.getBytes(); - } + if ((0, _primitives.isStream)(cidToGidMap)) { + cidToGidBytes = cidToGidMap.getBytes(); } + } - var differences = []; - var baseEncodingName = null; - var encoding; + var differences = []; + var baseEncodingName = null; + var encoding; - if (dict.has("Encoding")) { - encoding = dict.get("Encoding"); + if (dict.has("Encoding")) { + encoding = dict.get("Encoding"); - if ((0, _primitives.isDict)(encoding)) { - baseEncodingName = encoding.get("BaseEncoding"); - baseEncodingName = (0, _primitives.isName)(baseEncodingName) ? baseEncodingName.name : null; + if ((0, _primitives.isDict)(encoding)) { + baseEncodingName = encoding.get("BaseEncoding"); + baseEncodingName = (0, _primitives.isName)(baseEncodingName) ? baseEncodingName.name : null; - if (encoding.has("Differences")) { - var diffEncoding = encoding.get("Differences"); - var index = 0; + if (encoding.has("Differences")) { + var diffEncoding = encoding.get("Differences"); + var index = 0; - for (var j = 0, jj = diffEncoding.length; j < jj; j++) { - var data = xref.fetchIfRef(diffEncoding[j]); + for (var j = 0, jj = diffEncoding.length; j < jj; j++) { + var data = xref.fetchIfRef(diffEncoding[j]); - if ((0, _util.isNum)(data)) { - index = data; - } else if ((0, _primitives.isName)(data)) { - differences[index++] = data.name; - } else { - throw new _util.FormatError(`Invalid entry in 'Differences' array: ${data}`); - } + if ((0, _util.isNum)(data)) { + index = data; + } else if ((0, _primitives.isName)(data)) { + differences[index++] = data.name; + } else { + throw new _util.FormatError(`Invalid entry in 'Differences' array: ${data}`); } } - } else if ((0, _primitives.isName)(encoding)) { - baseEncodingName = encoding.name; - } else { - throw new _util.FormatError("Encoding is not a Name nor a Dict"); } + } else if ((0, _primitives.isName)(encoding)) { + baseEncodingName = encoding.name; + } else { + throw new _util.FormatError("Encoding is not a Name nor a Dict"); + } - if (baseEncodingName !== "MacRomanEncoding" && baseEncodingName !== "MacExpertEncoding" && baseEncodingName !== "WinAnsiEncoding") { - baseEncodingName = null; - } + if (baseEncodingName !== "MacRomanEncoding" && baseEncodingName !== "MacExpertEncoding" && baseEncodingName !== "WinAnsiEncoding") { + baseEncodingName = null; } + } - if (baseEncodingName) { - properties.defaultEncoding = (0, _encodings.getEncoding)(baseEncodingName).slice(); - } else { - var isSymbolicFont = !!(properties.flags & _fonts.FontFlags.Symbolic); - var isNonsymbolicFont = !!(properties.flags & _fonts.FontFlags.Nonsymbolic); - encoding = _encodings.StandardEncoding; + if (baseEncodingName) { + properties.defaultEncoding = (0, _encodings.getEncoding)(baseEncodingName).slice(); + } else { + var isSymbolicFont = !!(properties.flags & _fonts.FontFlags.Symbolic); + var isNonsymbolicFont = !!(properties.flags & _fonts.FontFlags.Nonsymbolic); + encoding = _encodings.StandardEncoding; - if (properties.type === "TrueType" && !isNonsymbolicFont) { - encoding = _encodings.WinAnsiEncoding; - } + if (properties.type === "TrueType" && !isNonsymbolicFont) { + encoding = _encodings.WinAnsiEncoding; + } - if (isSymbolicFont) { - encoding = _encodings.MacRomanEncoding; + if (isSymbolicFont) { + encoding = _encodings.MacRomanEncoding; - if (!properties.file) { - if (/Symbol/i.test(properties.name)) { - encoding = _encodings.SymbolSetEncoding; - } else if (/Dingbats|Wingdings/i.test(properties.name)) { - encoding = _encodings.ZapfDingbatsEncoding; - } + if (!properties.file) { + if (/Symbol/i.test(properties.name)) { + encoding = _encodings.SymbolSetEncoding; + } else if (/Dingbats|Wingdings/i.test(properties.name)) { + encoding = _encodings.ZapfDingbatsEncoding; } } - - properties.defaultEncoding = encoding; } - properties.differences = differences; - properties.baseEncodingName = baseEncodingName; - properties.hasEncoding = !!baseEncodingName || differences.length > 0; - properties.dict = dict; - return toUnicodePromise.then(readToUnicode => { - properties.toUnicode = readToUnicode; - return this.buildToUnicode(properties); - }).then(builtToUnicode => { - properties.toUnicode = builtToUnicode; + properties.defaultEncoding = encoding; + } - if (cidToGidBytes) { - properties.cidToGidMap = this.readCidToGidMap(cidToGidBytes, builtToUnicode); - } + properties.differences = differences; + properties.baseEncodingName = baseEncodingName; + properties.hasEncoding = !!baseEncodingName || differences.length > 0; + properties.dict = dict; + return toUnicodePromise.then(readToUnicode => { + properties.toUnicode = readToUnicode; + return this.buildToUnicode(properties); + }).then(builtToUnicode => { + properties.toUnicode = builtToUnicode; - return properties; - }); - }, + if (cidToGidBytes) { + properties.cidToGidMap = this.readCidToGidMap(cidToGidBytes, builtToUnicode); + } - _buildSimpleFontToUnicode(properties, forceGlyphs = false) { - (0, _util.assert)(!properties.composite, "Must be a simple font."); - const toUnicode = []; - const encoding = properties.defaultEncoding.slice(); - const baseEncodingName = properties.baseEncodingName; - const differences = properties.differences; + return properties; + }); + } - for (const charcode in differences) { - const glyphName = differences[charcode]; + _buildSimpleFontToUnicode(properties, forceGlyphs = false) { + (0, _util.assert)(!properties.composite, "Must be a simple font."); + const toUnicode = []; + const encoding = properties.defaultEncoding.slice(); + const baseEncodingName = properties.baseEncodingName; + const differences = properties.differences; - if (glyphName === ".notdef") { - continue; - } + for (const charcode in differences) { + const glyphName = differences[charcode]; - encoding[charcode] = glyphName; + if (glyphName === ".notdef") { + continue; } - const glyphsUnicodeMap = (0, _glyphlist.getGlyphsUnicode)(); + encoding[charcode] = glyphName; + } - for (const charcode in encoding) { - let glyphName = encoding[charcode]; + const glyphsUnicodeMap = (0, _glyphlist.getGlyphsUnicode)(); - if (glyphName === "") { - continue; - } else if (glyphsUnicodeMap[glyphName] === undefined) { - let code = 0; + for (const charcode in encoding) { + let glyphName = encoding[charcode]; - switch (glyphName[0]) { - case "G": - if (glyphName.length === 3) { - code = parseInt(glyphName.substring(1), 16); - } - - break; + if (glyphName === "") { + continue; + } else if (glyphsUnicodeMap[glyphName] === undefined) { + let code = 0; - case "g": - if (glyphName.length === 5) { - code = parseInt(glyphName.substring(1), 16); - } + switch (glyphName[0]) { + case "G": + if (glyphName.length === 3) { + code = parseInt(glyphName.substring(1), 16); + } - break; + break; - case "C": - case "c": - if (glyphName.length >= 3 && glyphName.length <= 4) { - const codeStr = glyphName.substring(1); + case "g": + if (glyphName.length === 5) { + code = parseInt(glyphName.substring(1), 16); + } - if (forceGlyphs) { - code = parseInt(codeStr, 16); - break; - } + break; - code = +codeStr; + case "C": + case "c": + if (glyphName.length >= 3 && glyphName.length <= 4) { + const codeStr = glyphName.substring(1); - if (Number.isNaN(code) && Number.isInteger(parseInt(codeStr, 16))) { - return this._buildSimpleFontToUnicode(properties, true); - } + if (forceGlyphs) { + code = parseInt(codeStr, 16); + break; } - break; - - default: - const unicode = (0, _unicode.getUnicodeForGlyph)(glyphName, glyphsUnicodeMap); + code = +codeStr; - if (unicode !== -1) { - code = unicode; + if (Number.isNaN(code) && Number.isInteger(parseInt(codeStr, 16))) { + return this._buildSimpleFontToUnicode(properties, true); } + } - } + break; - if (code > 0 && code <= 0x10ffff && Number.isInteger(code)) { - if (baseEncodingName && code === +charcode) { - const baseEncoding = (0, _encodings.getEncoding)(baseEncodingName); + default: + const unicode = (0, _unicode.getUnicodeForGlyph)(glyphName, glyphsUnicodeMap); - if (baseEncoding && (glyphName = baseEncoding[charcode])) { - toUnicode[charcode] = String.fromCharCode(glyphsUnicodeMap[glyphName]); - continue; - } + if (unicode !== -1) { + code = unicode; } - toUnicode[charcode] = String.fromCodePoint(code); + } + + if (code > 0 && code <= 0x10ffff && Number.isInteger(code)) { + if (baseEncodingName && code === +charcode) { + const baseEncoding = (0, _encodings.getEncoding)(baseEncodingName); + + if (baseEncoding && (glyphName = baseEncoding[charcode])) { + toUnicode[charcode] = String.fromCharCode(glyphsUnicodeMap[glyphName]); + continue; + } } - continue; + toUnicode[charcode] = String.fromCodePoint(code); } - toUnicode[charcode] = String.fromCharCode(glyphsUnicodeMap[glyphName]); + continue; } - return new _fonts.ToUnicodeMap(toUnicode); - }, + toUnicode[charcode] = String.fromCharCode(glyphsUnicodeMap[glyphName]); + } - buildToUnicode(properties) { - properties.hasIncludedToUnicodeMap = !!properties.toUnicode && properties.toUnicode.length > 0; + return new _fonts.ToUnicodeMap(toUnicode); + } - if (properties.hasIncludedToUnicodeMap) { - if (!properties.composite && properties.hasEncoding) { - properties.fallbackToUnicode = this._buildSimpleFontToUnicode(properties); - } + buildToUnicode(properties) { + properties.hasIncludedToUnicodeMap = !!properties.toUnicode && properties.toUnicode.length > 0; - return Promise.resolve(properties.toUnicode); + if (properties.hasIncludedToUnicodeMap) { + if (!properties.composite && properties.hasEncoding) { + properties.fallbackToUnicode = this._buildSimpleFontToUnicode(properties); } - if (!properties.composite) { - return Promise.resolve(this._buildSimpleFontToUnicode(properties)); - } + return Promise.resolve(properties.toUnicode); + } - if (properties.composite && (properties.cMap.builtInCMap && !(properties.cMap instanceof _cmap.IdentityCMap) || properties.cidSystemInfo.registry === "Adobe" && (properties.cidSystemInfo.ordering === "GB1" || properties.cidSystemInfo.ordering === "CNS1" || properties.cidSystemInfo.ordering === "Japan1" || properties.cidSystemInfo.ordering === "Korea1"))) { - const registry = properties.cidSystemInfo.registry; - const ordering = properties.cidSystemInfo.ordering; + if (!properties.composite) { + return Promise.resolve(this._buildSimpleFontToUnicode(properties)); + } - const ucs2CMapName = _primitives.Name.get(registry + "-" + ordering + "-UCS2"); + if (properties.composite && (properties.cMap.builtInCMap && !(properties.cMap instanceof _cmap.IdentityCMap) || properties.cidSystemInfo.registry === "Adobe" && (properties.cidSystemInfo.ordering === "GB1" || properties.cidSystemInfo.ordering === "CNS1" || properties.cidSystemInfo.ordering === "Japan1" || properties.cidSystemInfo.ordering === "Korea1"))) { + const registry = properties.cidSystemInfo.registry; + const ordering = properties.cidSystemInfo.ordering; - return _cmap.CMapFactory.create({ - encoding: ucs2CMapName, - fetchBuiltInCMap: this.fetchBuiltInCMap, - useCMap: null - }).then(function (ucs2CMap) { - const cMap = properties.cMap; - const toUnicode = []; - cMap.forEach(function (charcode, cid) { - if (cid > 0xffff) { - throw new _util.FormatError("Max size of CID is 65,535"); - } + const ucs2CMapName = _primitives.Name.get(registry + "-" + ordering + "-UCS2"); - const ucs2 = ucs2CMap.lookup(cid); + return _cmap.CMapFactory.create({ + encoding: ucs2CMapName, + fetchBuiltInCMap: this._fetchBuiltInCMapBound, + useCMap: null + }).then(function (ucs2CMap) { + const cMap = properties.cMap; + const toUnicode = []; + cMap.forEach(function (charcode, cid) { + if (cid > 0xffff) { + throw new _util.FormatError("Max size of CID is 65,535"); + } - if (ucs2) { - toUnicode[charcode] = String.fromCharCode((ucs2.charCodeAt(0) << 8) + ucs2.charCodeAt(1)); - } - }); - return new _fonts.ToUnicodeMap(toUnicode); - }); - } + const ucs2 = ucs2CMap.lookup(cid); - return Promise.resolve(new _fonts.IdentityToUnicodeMap(properties.firstChar, properties.lastChar)); - }, + if (ucs2) { + toUnicode[charcode] = String.fromCharCode((ucs2.charCodeAt(0) << 8) + ucs2.charCodeAt(1)); + } + }); + return new _fonts.ToUnicodeMap(toUnicode); + }); + } - readToUnicode: function PartialEvaluator_readToUnicode(toUnicode) { - var cmapObj = toUnicode; + return Promise.resolve(new _fonts.IdentityToUnicodeMap(properties.firstChar, properties.lastChar)); + } - if ((0, _primitives.isName)(cmapObj)) { - return _cmap.CMapFactory.create({ - encoding: cmapObj, - fetchBuiltInCMap: this.fetchBuiltInCMap, - useCMap: null - }).then(function (cmap) { - if (cmap instanceof _cmap.IdentityCMap) { - return new _fonts.IdentityToUnicodeMap(0, 0xffff); - } + readToUnicode(toUnicode) { + var cmapObj = toUnicode; - return new _fonts.ToUnicodeMap(cmap.getMap()); - }); - } else if ((0, _primitives.isStream)(cmapObj)) { - return _cmap.CMapFactory.create({ - encoding: cmapObj, - fetchBuiltInCMap: this.fetchBuiltInCMap, - useCMap: null - }).then(function (cmap) { - if (cmap instanceof _cmap.IdentityCMap) { - return new _fonts.IdentityToUnicodeMap(0, 0xffff); - } + if ((0, _primitives.isName)(cmapObj)) { + return _cmap.CMapFactory.create({ + encoding: cmapObj, + fetchBuiltInCMap: this._fetchBuiltInCMapBound, + useCMap: null + }).then(function (cmap) { + if (cmap instanceof _cmap.IdentityCMap) { + return new _fonts.IdentityToUnicodeMap(0, 0xffff); + } - var map = new Array(cmap.length); - cmap.forEach(function (charCode, token) { - var str = []; + return new _fonts.ToUnicodeMap(cmap.getMap()); + }); + } else if ((0, _primitives.isStream)(cmapObj)) { + return _cmap.CMapFactory.create({ + encoding: cmapObj, + fetchBuiltInCMap: this._fetchBuiltInCMapBound, + useCMap: null + }).then(function (cmap) { + if (cmap instanceof _cmap.IdentityCMap) { + return new _fonts.IdentityToUnicodeMap(0, 0xffff); + } - for (var k = 0; k < token.length; k += 2) { - var w1 = token.charCodeAt(k) << 8 | token.charCodeAt(k + 1); + var map = new Array(cmap.length); + cmap.forEach(function (charCode, token) { + var str = []; - if ((w1 & 0xf800) !== 0xd800) { - str.push(w1); - continue; - } + for (var k = 0; k < token.length; k += 2) { + var w1 = token.charCodeAt(k) << 8 | token.charCodeAt(k + 1); - k += 2; - var w2 = token.charCodeAt(k) << 8 | token.charCodeAt(k + 1); - str.push(((w1 & 0x3ff) << 10) + (w2 & 0x3ff) + 0x10000); + if ((w1 & 0xf800) !== 0xd800) { + str.push(w1); + continue; } - map[charCode] = String.fromCodePoint.apply(String, str); - }); - return new _fonts.ToUnicodeMap(map); - }, reason => { - if (reason instanceof _util.AbortException) { - return null; - } - - if (this.options.ignoreErrors) { - this.handler.send("UnsupportedFeature", { - featureId: _util.UNSUPPORTED_FEATURES.errorFontToUnicode - }); - (0, _util.warn)(`readToUnicode - ignoring ToUnicode data: "${reason}".`); - return null; + k += 2; + var w2 = token.charCodeAt(k) << 8 | token.charCodeAt(k + 1); + str.push(((w1 & 0x3ff) << 10) + (w2 & 0x3ff) + 0x10000); } - throw reason; + map[charCode] = String.fromCodePoint.apply(String, str); }); - } + return new _fonts.ToUnicodeMap(map); + }, reason => { + if (reason instanceof _util.AbortException) { + return null; + } - return Promise.resolve(null); - }, + if (this.options.ignoreErrors) { + this.handler.send("UnsupportedFeature", { + featureId: _util.UNSUPPORTED_FEATURES.errorFontToUnicode + }); + (0, _util.warn)(`readToUnicode - ignoring ToUnicode data: "${reason}".`); + return null; + } - readCidToGidMap(glyphsData, toUnicode) { - var result = []; + throw reason; + }); + } - for (var j = 0, jj = glyphsData.length; j < jj; j++) { - var glyphID = glyphsData[j++] << 8 | glyphsData[j]; - const code = j >> 1; + return Promise.resolve(null); + } - if (glyphID === 0 && !toUnicode.has(code)) { - continue; - } + readCidToGidMap(glyphsData, toUnicode) { + var result = []; - result[code] = glyphID; + for (var j = 0, jj = glyphsData.length; j < jj; j++) { + var glyphID = glyphsData[j++] << 8 | glyphsData[j]; + const code = j >> 1; + + if (glyphID === 0 && !toUnicode.has(code)) { + continue; } - return result; - }, + result[code] = glyphID; + } - extractWidths: function PartialEvaluator_extractWidths(dict, descriptor, properties) { - var xref = this.xref; - var glyphsWidths = []; - var defaultWidth = 0; - var glyphsVMetrics = []; - var defaultVMetrics; - var i, ii, j, jj, start, code, widths; + return result; + } - if (properties.composite) { - defaultWidth = dict.has("DW") ? dict.get("DW") : 1000; - widths = dict.get("W"); + extractWidths(dict, descriptor, properties) { + var xref = this.xref; + var glyphsWidths = []; + var defaultWidth = 0; + var glyphsVMetrics = []; + var defaultVMetrics; + var i, ii, j, jj, start, code, widths; - if (widths) { - for (i = 0, ii = widths.length; i < ii; i++) { - start = xref.fetchIfRef(widths[i++]); - code = xref.fetchIfRef(widths[i]); + if (properties.composite) { + defaultWidth = dict.has("DW") ? dict.get("DW") : 1000; + widths = dict.get("W"); - if (Array.isArray(code)) { - for (j = 0, jj = code.length; j < jj; j++) { - glyphsWidths[start++] = xref.fetchIfRef(code[j]); - } - } else { - var width = xref.fetchIfRef(widths[++i]); + if (widths) { + for (i = 0, ii = widths.length; i < ii; i++) { + start = xref.fetchIfRef(widths[i++]); + code = xref.fetchIfRef(widths[i]); - for (j = start; j <= code; j++) { - glyphsWidths[j] = width; - } + if (Array.isArray(code)) { + for (j = 0, jj = code.length; j < jj; j++) { + glyphsWidths[start++] = xref.fetchIfRef(code[j]); + } + } else { + var width = xref.fetchIfRef(widths[++i]); + + for (j = start; j <= code; j++) { + glyphsWidths[j] = width; } } } + } - if (properties.vertical) { - var vmetrics = dict.getArray("DW2") || [880, -1000]; - defaultVMetrics = [vmetrics[1], defaultWidth * 0.5, vmetrics[0]]; - vmetrics = dict.get("W2"); + if (properties.vertical) { + var vmetrics = dict.getArray("DW2") || [880, -1000]; + defaultVMetrics = [vmetrics[1], defaultWidth * 0.5, vmetrics[0]]; + vmetrics = dict.get("W2"); - if (vmetrics) { - for (i = 0, ii = vmetrics.length; i < ii; i++) { - start = xref.fetchIfRef(vmetrics[i++]); - code = xref.fetchIfRef(vmetrics[i]); + if (vmetrics) { + for (i = 0, ii = vmetrics.length; i < ii; i++) { + start = xref.fetchIfRef(vmetrics[i++]); + code = xref.fetchIfRef(vmetrics[i]); - if (Array.isArray(code)) { - for (j = 0, jj = code.length; j < jj; j++) { - glyphsVMetrics[start++] = [xref.fetchIfRef(code[j++]), xref.fetchIfRef(code[j++]), xref.fetchIfRef(code[j])]; - } - } else { - var vmetric = [xref.fetchIfRef(vmetrics[++i]), xref.fetchIfRef(vmetrics[++i]), xref.fetchIfRef(vmetrics[++i])]; + if (Array.isArray(code)) { + for (j = 0, jj = code.length; j < jj; j++) { + glyphsVMetrics[start++] = [xref.fetchIfRef(code[j++]), xref.fetchIfRef(code[j++]), xref.fetchIfRef(code[j])]; + } + } else { + var vmetric = [xref.fetchIfRef(vmetrics[++i]), xref.fetchIfRef(vmetrics[++i]), xref.fetchIfRef(vmetrics[++i])]; - for (j = start; j <= code; j++) { - glyphsVMetrics[j] = vmetric; - } + for (j = start; j <= code; j++) { + glyphsVMetrics[j] = vmetric; } } } } - } else { - var firstChar = properties.firstChar; - widths = dict.get("Widths"); + } + } else { + var firstChar = properties.firstChar; + widths = dict.get("Widths"); - if (widths) { - j = firstChar; + if (widths) { + j = firstChar; - for (i = 0, ii = widths.length; i < ii; i++) { - glyphsWidths[j++] = xref.fetchIfRef(widths[i]); - } + for (i = 0, ii = widths.length; i < ii; i++) { + glyphsWidths[j++] = xref.fetchIfRef(widths[i]); + } - defaultWidth = parseFloat(descriptor.get("MissingWidth")) || 0; - } else { - var baseFontName = dict.get("BaseFont"); + defaultWidth = parseFloat(descriptor.get("MissingWidth")) || 0; + } else { + var baseFontName = dict.get("BaseFont"); - if ((0, _primitives.isName)(baseFontName)) { - var metrics = this.getBaseFontMetrics(baseFontName.name); - glyphsWidths = this.buildCharCodeToWidth(metrics.widths, properties); - defaultWidth = metrics.defaultWidth; - } + if ((0, _primitives.isName)(baseFontName)) { + var metrics = this.getBaseFontMetrics(baseFontName.name); + glyphsWidths = this.buildCharCodeToWidth(metrics.widths, properties); + defaultWidth = metrics.defaultWidth; } } + } - var isMonospace = true; - var firstWidth = defaultWidth; - - for (var glyph in glyphsWidths) { - var glyphWidth = glyphsWidths[glyph]; - - if (!glyphWidth) { - continue; - } + var isMonospace = true; + var firstWidth = defaultWidth; - if (!firstWidth) { - firstWidth = glyphWidth; - continue; - } + for (var glyph in glyphsWidths) { + var glyphWidth = glyphsWidths[glyph]; - if (firstWidth !== glyphWidth) { - isMonospace = false; - break; - } + if (!glyphWidth) { + continue; } - if (isMonospace) { - properties.flags |= _fonts.FontFlags.FixedPitch; + if (!firstWidth) { + firstWidth = glyphWidth; + continue; } - properties.defaultWidth = defaultWidth; - properties.widths = glyphsWidths; - properties.defaultVMetrics = defaultVMetrics; - properties.vmetrics = glyphsVMetrics; - }, - isSerifFont: function PartialEvaluator_isSerifFont(baseFontName) { - var fontNameWoStyle = baseFontName.split("-")[0]; - return fontNameWoStyle in (0, _standard_fonts.getSerifFonts)() || fontNameWoStyle.search(/serif/gi) !== -1; - }, - getBaseFontMetrics: function PartialEvaluator_getBaseFontMetrics(name) { - var defaultWidth = 0; - var widths = []; - var monospace = false; - var stdFontMap = (0, _standard_fonts.getStdFontMap)(); - var lookupName = stdFontMap[name] || name; - var Metrics = (0, _metrics.getMetrics)(); - - if (!(lookupName in Metrics)) { - if (this.isSerifFont(name)) { - lookupName = "Times-Roman"; - } else { - lookupName = "Helvetica"; - } + if (firstWidth !== glyphWidth) { + isMonospace = false; + break; } + } - var glyphWidths = Metrics[lookupName]; - - if ((0, _util.isNum)(glyphWidths)) { - defaultWidth = glyphWidths; - monospace = true; - } else { - widths = glyphWidths(); - } + if (isMonospace) { + properties.flags |= _fonts.FontFlags.FixedPitch; + } - return { - defaultWidth, - monospace, - widths - }; - }, - buildCharCodeToWidth: function PartialEvaluator_bulildCharCodeToWidth(widthsByGlyphName, properties) { - var widths = Object.create(null); - var differences = properties.differences; - var encoding = properties.defaultEncoding; - - for (var charCode = 0; charCode < 256; charCode++) { - if (charCode in differences && widthsByGlyphName[differences[charCode]]) { - widths[charCode] = widthsByGlyphName[differences[charCode]]; - continue; - } + properties.defaultWidth = defaultWidth; + properties.widths = glyphsWidths; + properties.defaultVMetrics = defaultVMetrics; + properties.vmetrics = glyphsVMetrics; + } - if (charCode in encoding && widthsByGlyphName[encoding[charCode]]) { - widths[charCode] = widthsByGlyphName[encoding[charCode]]; - continue; - } - } + isSerifFont(baseFontName) { + var fontNameWoStyle = baseFontName.split("-")[0]; + return fontNameWoStyle in (0, _standard_fonts.getSerifFonts)() || fontNameWoStyle.search(/serif/gi) !== -1; + } - return widths; - }, - preEvaluateFont: function PartialEvaluator_preEvaluateFont(dict) { - var baseDict = dict; - var type = dict.get("Subtype"); + getBaseFontMetrics(name) { + var defaultWidth = 0; + var widths = []; + var monospace = false; + var stdFontMap = (0, _standard_fonts.getStdFontMap)(); + var lookupName = stdFontMap[name] || name; + var Metrics = (0, _metrics.getMetrics)(); - if (!(0, _primitives.isName)(type)) { - throw new _util.FormatError("invalid font Subtype"); + if (!(lookupName in Metrics)) { + if (this.isSerifFont(name)) { + lookupName = "Times-Roman"; + } else { + lookupName = "Helvetica"; } + } - var composite = false; - var uint8array; - - if (type.name === "Type0") { - var df = dict.get("DescendantFonts"); + var glyphWidths = Metrics[lookupName]; - if (!df) { - throw new _util.FormatError("Descendant fonts are not specified"); - } + if ((0, _util.isNum)(glyphWidths)) { + defaultWidth = glyphWidths; + monospace = true; + } else { + widths = glyphWidths(); + } - dict = Array.isArray(df) ? this.xref.fetchIfRef(df[0]) : df; - type = dict.get("Subtype"); + return { + defaultWidth, + monospace, + widths + }; + } - if (!(0, _primitives.isName)(type)) { - throw new _util.FormatError("invalid font Subtype"); - } + buildCharCodeToWidth(widthsByGlyphName, properties) { + var widths = Object.create(null); + var differences = properties.differences; + var encoding = properties.defaultEncoding; - composite = true; + for (var charCode = 0; charCode < 256; charCode++) { + if (charCode in differences && widthsByGlyphName[differences[charCode]]) { + widths[charCode] = widthsByGlyphName[differences[charCode]]; + continue; } - var descriptor = dict.get("FontDescriptor"); - - if (descriptor) { - var hash = new _murmurhash.MurmurHash3_64(); - var encoding = baseDict.getRaw("Encoding"); + if (charCode in encoding && widthsByGlyphName[encoding[charCode]]) { + widths[charCode] = widthsByGlyphName[encoding[charCode]]; + continue; + } + } - if ((0, _primitives.isName)(encoding)) { - hash.update(encoding.name); - } else if ((0, _primitives.isRef)(encoding)) { - hash.update(encoding.toString()); - } else if ((0, _primitives.isDict)(encoding)) { - var keys = encoding.getKeys(); + return widths; + } - for (var i = 0, ii = keys.length; i < ii; i++) { - var entry = encoding.getRaw(keys[i]); + preEvaluateFont(dict) { + var baseDict = dict; + var type = dict.get("Subtype"); - if ((0, _primitives.isName)(entry)) { - hash.update(entry.name); - } else if ((0, _primitives.isRef)(entry)) { - hash.update(entry.toString()); - } else if (Array.isArray(entry)) { - var diffLength = entry.length, - diffBuf = new Array(diffLength); + if (!(0, _primitives.isName)(type)) { + throw new _util.FormatError("invalid font Subtype"); + } - for (var j = 0; j < diffLength; j++) { - var diffEntry = entry[j]; + var composite = false; + var uint8array; - if ((0, _primitives.isName)(diffEntry)) { - diffBuf[j] = diffEntry.name; - } else if ((0, _util.isNum)(diffEntry) || (0, _primitives.isRef)(diffEntry)) { - diffBuf[j] = diffEntry.toString(); - } - } + if (type.name === "Type0") { + var df = dict.get("DescendantFonts"); - hash.update(diffBuf.join()); - } - } - } + if (!df) { + throw new _util.FormatError("Descendant fonts are not specified"); + } - const firstChar = dict.get("FirstChar") || 0; - const lastChar = dict.get("LastChar") || (composite ? 0xffff : 0xff); - hash.update(`${firstChar}-${lastChar}`); - var toUnicode = dict.get("ToUnicode") || baseDict.get("ToUnicode"); + dict = Array.isArray(df) ? this.xref.fetchIfRef(df[0]) : df; + type = dict.get("Subtype"); - if ((0, _primitives.isStream)(toUnicode)) { - var stream = toUnicode.str || toUnicode; - uint8array = stream.buffer ? new Uint8Array(stream.buffer.buffer, 0, stream.bufferLength) : new Uint8Array(stream.bytes.buffer, stream.start, stream.end - stream.start); - hash.update(uint8array); - } else if ((0, _primitives.isName)(toUnicode)) { - hash.update(toUnicode.name); - } + if (!(0, _primitives.isName)(type)) { + throw new _util.FormatError("invalid font Subtype"); + } - var widths = dict.get("Widths") || baseDict.get("Widths"); + composite = true; + } - if (widths) { - uint8array = new Uint8Array(new Uint32Array(widths).buffer); - hash.update(uint8array); - } - } + var descriptor = dict.get("FontDescriptor"); - return { - descriptor, - dict, - baseDict, - composite, - type: type.name, - hash: hash ? hash.hexdigest() : "" - }; - }, - translateFont: function PartialEvaluator_translateFont(preEvaluatedFont) { - var baseDict = preEvaluatedFont.baseDict; - var dict = preEvaluatedFont.dict; - var composite = preEvaluatedFont.composite; - var descriptor = preEvaluatedFont.descriptor; - var type = preEvaluatedFont.type; - var maxCharIndex = composite ? 0xffff : 0xff; - var properties; - const firstChar = dict.get("FirstChar") || 0; - const lastChar = dict.get("LastChar") || maxCharIndex; + if (descriptor) { + var hash = new _murmurhash.MurmurHash3_64(); + var encoding = baseDict.getRaw("Encoding"); - if (!descriptor) { - if (type === "Type3") { - descriptor = new _primitives.Dict(null); - descriptor.set("FontName", _primitives.Name.get(type)); - descriptor.set("FontBBox", dict.getArray("FontBBox") || [0, 0, 0, 0]); - } else { - var baseFontName = dict.get("BaseFont"); - - if (!(0, _primitives.isName)(baseFontName)) { - throw new _util.FormatError("Base font is not specified"); - } - - baseFontName = baseFontName.name.replace(/[,_]/g, "-"); - var metrics = this.getBaseFontMetrics(baseFontName); - var fontNameWoStyle = baseFontName.split("-")[0]; - var flags = (this.isSerifFont(fontNameWoStyle) ? _fonts.FontFlags.Serif : 0) | (metrics.monospace ? _fonts.FontFlags.FixedPitch : 0) | ((0, _standard_fonts.getSymbolsFonts)()[fontNameWoStyle] ? _fonts.FontFlags.Symbolic : _fonts.FontFlags.Nonsymbolic); - properties = { - type, - name: baseFontName, - widths: metrics.widths, - defaultWidth: metrics.defaultWidth, - flags, - firstChar, - lastChar - }; - const widths = dict.get("Widths"); - return this.extractDataStructures(dict, dict, properties).then(newProperties => { - if (widths) { - const glyphWidths = []; - let j = firstChar; - - for (let i = 0, ii = widths.length; i < ii; i++) { - glyphWidths[j++] = this.xref.fetchIfRef(widths[i]); + if ((0, _primitives.isName)(encoding)) { + hash.update(encoding.name); + } else if ((0, _primitives.isRef)(encoding)) { + hash.update(encoding.toString()); + } else if ((0, _primitives.isDict)(encoding)) { + for (const entry of encoding.getRawValues()) { + if ((0, _primitives.isName)(entry)) { + hash.update(entry.name); + } else if ((0, _primitives.isRef)(entry)) { + hash.update(entry.toString()); + } else if (Array.isArray(entry)) { + var diffLength = entry.length, + diffBuf = new Array(diffLength); + + for (var j = 0; j < diffLength; j++) { + var diffEntry = entry[j]; + + if ((0, _primitives.isName)(diffEntry)) { + diffBuf[j] = diffEntry.name; + } else if ((0, _util.isNum)(diffEntry) || (0, _primitives.isRef)(diffEntry)) { + diffBuf[j] = diffEntry.toString(); } - - newProperties.widths = glyphWidths; - } else { - newProperties.widths = this.buildCharCodeToWidth(metrics.widths, newProperties); } - return new _fonts.Font(baseFontName, null, newProperties); - }); + hash.update(diffBuf.join()); + } } } - var fontName = descriptor.get("FontName"); - var baseFont = dict.get("BaseFont"); + const firstChar = dict.get("FirstChar") || 0; + const lastChar = dict.get("LastChar") || (composite ? 0xffff : 0xff); + hash.update(`${firstChar}-${lastChar}`); + var toUnicode = dict.get("ToUnicode") || baseDict.get("ToUnicode"); - if ((0, _util.isString)(fontName)) { - fontName = _primitives.Name.get(fontName); + if ((0, _primitives.isStream)(toUnicode)) { + var stream = toUnicode.str || toUnicode; + uint8array = stream.buffer ? new Uint8Array(stream.buffer.buffer, 0, stream.bufferLength) : new Uint8Array(stream.bytes.buffer, stream.start, stream.end - stream.start); + hash.update(uint8array); + } else if ((0, _primitives.isName)(toUnicode)) { + hash.update(toUnicode.name); } - if ((0, _util.isString)(baseFont)) { - baseFont = _primitives.Name.get(baseFont); + var widths = dict.get("Widths") || baseDict.get("Widths"); + + if (widths) { + uint8array = new Uint8Array(new Uint32Array(widths).buffer); + hash.update(uint8array); } + } - if (type !== "Type3") { - var fontNameStr = fontName && fontName.name; - var baseFontStr = baseFont && baseFont.name; + return { + descriptor, + dict, + baseDict, + composite, + type: type.name, + hash: hash ? hash.hexdigest() : "" + }; + } - if (fontNameStr !== baseFontStr) { - (0, _util.info)(`The FontDescriptor\'s FontName is "${fontNameStr}" but ` + `should be the same as the Font\'s BaseFont "${baseFontStr}".`); + translateFont(preEvaluatedFont) { + var baseDict = preEvaluatedFont.baseDict; + var dict = preEvaluatedFont.dict; + var composite = preEvaluatedFont.composite; + var descriptor = preEvaluatedFont.descriptor; + var type = preEvaluatedFont.type; + var maxCharIndex = composite ? 0xffff : 0xff; + var properties; + const firstChar = dict.get("FirstChar") || 0; + const lastChar = dict.get("LastChar") || maxCharIndex; + + if (!descriptor) { + if (type === "Type3") { + descriptor = new _primitives.Dict(null); + descriptor.set("FontName", _primitives.Name.get(type)); + descriptor.set("FontBBox", dict.getArray("FontBBox") || [0, 0, 0, 0]); + } else { + var baseFontName = dict.get("BaseFont"); + + if (!(0, _primitives.isName)(baseFontName)) { + throw new _util.FormatError("Base font is not specified"); + } + + baseFontName = baseFontName.name.replace(/[,_]/g, "-"); + var metrics = this.getBaseFontMetrics(baseFontName); + var fontNameWoStyle = baseFontName.split("-")[0]; + var flags = (this.isSerifFont(fontNameWoStyle) ? _fonts.FontFlags.Serif : 0) | (metrics.monospace ? _fonts.FontFlags.FixedPitch : 0) | ((0, _standard_fonts.getSymbolsFonts)()[fontNameWoStyle] ? _fonts.FontFlags.Symbolic : _fonts.FontFlags.Nonsymbolic); + properties = { + type, + name: baseFontName, + widths: metrics.widths, + defaultWidth: metrics.defaultWidth, + flags, + firstChar, + lastChar + }; + const widths = dict.get("Widths"); + return this.extractDataStructures(dict, dict, properties).then(newProperties => { + if (widths) { + const glyphWidths = []; + let j = firstChar; + + for (let i = 0, ii = widths.length; i < ii; i++) { + glyphWidths[j++] = this.xref.fetchIfRef(widths[i]); + } - if (fontNameStr && baseFontStr && baseFontStr.startsWith(fontNameStr)) { - fontName = baseFont; + newProperties.widths = glyphWidths; + } else { + newProperties.widths = this.buildCharCodeToWidth(metrics.widths, newProperties); } - } + + return new _fonts.Font(baseFontName, null, newProperties); + }); } + } - fontName = fontName || baseFont; + var fontName = descriptor.get("FontName"); + var baseFont = dict.get("BaseFont"); - if (!(0, _primitives.isName)(fontName)) { - throw new _util.FormatError("invalid font name"); - } + if ((0, _util.isString)(fontName)) { + fontName = _primitives.Name.get(fontName); + } - var fontFile = descriptor.get("FontFile", "FontFile2", "FontFile3"); + if ((0, _util.isString)(baseFont)) { + baseFont = _primitives.Name.get(baseFont); + } - if (fontFile) { - if (fontFile.dict) { - var subtype = fontFile.dict.get("Subtype"); + if (type !== "Type3") { + var fontNameStr = fontName && fontName.name; + var baseFontStr = baseFont && baseFont.name; - if (subtype) { - subtype = subtype.name; - } + if (fontNameStr !== baseFontStr) { + (0, _util.info)(`The FontDescriptor\'s FontName is "${fontNameStr}" but ` + `should be the same as the Font\'s BaseFont "${baseFontStr}".`); - var length1 = fontFile.dict.get("Length1"); - var length2 = fontFile.dict.get("Length2"); - var length3 = fontFile.dict.get("Length3"); + if (fontNameStr && baseFontStr && baseFontStr.startsWith(fontNameStr)) { + fontName = baseFont; } } + } - properties = { - type, - name: fontName.name, - subtype, - file: fontFile, - length1, - length2, - length3, - loadedName: baseDict.loadedName, - composite, - fixedPitch: false, - fontMatrix: dict.getArray("FontMatrix") || _util.FONT_IDENTITY_MATRIX, - firstChar: firstChar || 0, - lastChar: lastChar || maxCharIndex, - bbox: descriptor.getArray("FontBBox"), - ascent: descriptor.get("Ascent"), - descent: descriptor.get("Descent"), - xHeight: descriptor.get("XHeight"), - capHeight: descriptor.get("CapHeight"), - flags: descriptor.get("Flags"), - italicAngle: descriptor.get("ItalicAngle"), - isType3Font: false - }; - var cMapPromise; + fontName = fontName || baseFont; - if (composite) { - var cidEncoding = baseDict.get("Encoding"); + if (!(0, _primitives.isName)(fontName)) { + throw new _util.FormatError("invalid font name"); + } + + var fontFile = descriptor.get("FontFile", "FontFile2", "FontFile3"); - if ((0, _primitives.isName)(cidEncoding)) { - properties.cidEncoding = cidEncoding.name; + if (fontFile) { + if (fontFile.dict) { + var subtype = fontFile.dict.get("Subtype"); + + if (subtype) { + subtype = subtype.name; } - cMapPromise = _cmap.CMapFactory.create({ - encoding: cidEncoding, - fetchBuiltInCMap: this.fetchBuiltInCMap, - useCMap: null - }).then(function (cMap) { - properties.cMap = cMap; - properties.vertical = properties.cMap.vertical; - }); - } else { - cMapPromise = Promise.resolve(undefined); + var length1 = fontFile.dict.get("Length1"); + var length2 = fontFile.dict.get("Length2"); + var length3 = fontFile.dict.get("Length3"); } + } - return cMapPromise.then(() => { - return this.extractDataStructures(dict, baseDict, properties); - }).then(newProperties => { - this.extractWidths(dict, descriptor, newProperties); + properties = { + type, + name: fontName.name, + subtype, + file: fontFile, + length1, + length2, + length3, + loadedName: baseDict.loadedName, + composite, + fixedPitch: false, + fontMatrix: dict.getArray("FontMatrix") || _util.FONT_IDENTITY_MATRIX, + firstChar: firstChar || 0, + lastChar: lastChar || maxCharIndex, + bbox: descriptor.getArray("FontBBox"), + ascent: descriptor.get("Ascent"), + descent: descriptor.get("Descent"), + xHeight: descriptor.get("XHeight"), + capHeight: descriptor.get("CapHeight"), + flags: descriptor.get("Flags"), + italicAngle: descriptor.get("ItalicAngle"), + isType3Font: false + }; + var cMapPromise; - if (type === "Type3") { - newProperties.isType3Font = true; - } + if (composite) { + var cidEncoding = baseDict.get("Encoding"); + + if ((0, _primitives.isName)(cidEncoding)) { + properties.cidEncoding = cidEncoding.name; + } - return new _fonts.Font(fontName.name, fontFile, newProperties); + cMapPromise = _cmap.CMapFactory.create({ + encoding: cidEncoding, + fetchBuiltInCMap: this._fetchBuiltInCMapBound, + useCMap: null + }).then(function (cMap) { + properties.cMap = cMap; + properties.vertical = properties.cMap.vertical; }); + } else { + cMapPromise = Promise.resolve(undefined); } - }; - PartialEvaluator.buildFontPaths = function (font, glyphs, handler) { + return cMapPromise.then(() => { + return this.extractDataStructures(dict, baseDict, properties); + }).then(newProperties => { + this.extractWidths(dict, descriptor, newProperties); + + if (type === "Type3") { + newProperties.isType3Font = true; + } + + return new _fonts.Font(fontName.name, fontFile, newProperties); + }); + } + + static buildFontPaths(font, glyphs, handler) { function buildPath(fontChar) { if (font.renderer.hasBuiltPath(fontChar)) { return; @@ -23003,23 +24544,18 @@ var PartialEvaluator = function PartialEvaluatorClosure() { buildPath(accent.fontChar); } } - }; - - PartialEvaluator.getFallbackFontDict = function () { - if (this._fallbackFontDict) { - return this._fallbackFontDict; - } + } + static get fallbackFontDict() { const dict = new _primitives.Dict(); dict.set("BaseFont", _primitives.Name.get("PDFJS-FallbackFont")); dict.set("Type", _primitives.Name.get("FallbackType")); dict.set("Subtype", _primitives.Name.get("FallbackType")); dict.set("Encoding", _primitives.Name.get("WinAnsiEncoding")); - return this._fallbackFontDict = dict; - }; + return (0, _util.shadow)(this, "fallbackFontDict", dict); + } - return PartialEvaluator; -}(); +} exports.PartialEvaluator = PartialEvaluator; @@ -23035,6 +24571,7 @@ class TranslatedFont { this.dict = dict; this._extraProperties = extraProperties; this.type3Loaded = null; + this.type3Dependencies = font.isType3Font ? new Set() : null; this.sent = false; } @@ -23057,28 +24594,27 @@ class TranslatedFont { PartialEvaluator.buildFontPaths(this.font, glyphs, handler); } - loadType3Data(evaluator, resources, parentOperatorList, task) { - if (!this.font.isType3Font) { - throw new Error("Must be a Type3 font."); - } - + loadType3Data(evaluator, resources, task) { if (this.type3Loaded) { return this.type3Loaded; } + if (!this.font.isType3Font) { + throw new Error("Must be a Type3 font."); + } + var type3Options = Object.create(evaluator.options); type3Options.ignoreErrors = false; var type3Evaluator = evaluator.clone(type3Options); type3Evaluator.parsingType3Font = true; - var translatedFont = this.font; + const translatedFont = this.font, + type3Dependencies = this.type3Dependencies; var loadCharProcsPromise = Promise.resolve(); var charProcs = this.dict.get("CharProcs"); var fontResources = this.dict.get("Resources") || resources; - var charProcKeys = charProcs.getKeys(); var charProcOperatorList = Object.create(null); - for (var i = 0, n = charProcKeys.length; i < n; ++i) { - const key = charProcKeys[i]; + for (const key of charProcs.getKeys()) { loadCharProcsPromise = loadCharProcsPromise.then(function () { var glyphStream = charProcs.get(key); var operatorList = new _operator_list.OperatorList(); @@ -23089,7 +24625,10 @@ class TranslatedFont { operatorList }).then(function () { charProcOperatorList[key] = operatorList.getIR(); - parentOperatorList.addDependencies(operatorList.dependencies); + + for (const dependency of operatorList.dependencies) { + type3Dependencies.add(dependency); + } }).catch(function (reason) { (0, _util.warn)(`Type3 font resource "${key}" is not available.`); const dummyOperatorList = new _operator_list.OperatorList(); @@ -23106,37 +24645,34 @@ class TranslatedFont { } -var StateManager = function StateManagerClosure() { - function StateManager(initialState) { +class StateManager { + constructor(initialState) { this.state = initialState; this.stateStack = []; } - StateManager.prototype = { - save() { - var old = this.state; - this.stateStack.push(this.state); - this.state = old.clone(); - }, - - restore() { - var prev = this.stateStack.pop(); + save() { + var old = this.state; + this.stateStack.push(this.state); + this.state = old.clone(); + } - if (prev) { - this.state = prev; - } - }, + restore() { + var prev = this.stateStack.pop(); - transform(args) { - this.state.ctm = _util.Util.transform(this.state.ctm, args); + if (prev) { + this.state = prev; } + } - }; - return StateManager; -}(); + transform(args) { + this.state.ctm = _util.Util.transform(this.state.ctm, args); + } -var TextState = function TextStateClosure() { - function TextState() { +} + +class TextState { + constructor() { this.ctm = new Float32Array(_util.IDENTITY_MATRIX); this.fontName = null; this.fontSize = 0; @@ -23151,94 +24687,99 @@ var TextState = function TextStateClosure() { this.textRise = 0; } - TextState.prototype = { - setTextMatrix: function TextState_setTextMatrix(a, b, c, d, e, f) { - var m = this.textMatrix; - m[0] = a; - m[1] = b; - m[2] = c; - m[3] = d; - m[4] = e; - m[5] = f; - }, - setTextLineMatrix: function TextState_setTextMatrix(a, b, c, d, e, f) { - var m = this.textLineMatrix; - m[0] = a; - m[1] = b; - m[2] = c; - m[3] = d; - m[4] = e; - m[5] = f; - }, - translateTextMatrix: function TextState_translateTextMatrix(x, y) { - var m = this.textMatrix; - m[4] = m[0] * x + m[2] * y + m[4]; - m[5] = m[1] * x + m[3] * y + m[5]; - }, - translateTextLineMatrix: function TextState_translateTextMatrix(x, y) { - var m = this.textLineMatrix; - m[4] = m[0] * x + m[2] * y + m[4]; - m[5] = m[1] * x + m[3] * y + m[5]; - }, - calcTextLineMatrixAdvance: function TextState_calcTextLineMatrixAdvance(a, b, c, d, e, f) { - var font = this.font; + setTextMatrix(a, b, c, d, e, f) { + var m = this.textMatrix; + m[0] = a; + m[1] = b; + m[2] = c; + m[3] = d; + m[4] = e; + m[5] = f; + } - if (!font) { - return null; - } + setTextLineMatrix(a, b, c, d, e, f) { + var m = this.textLineMatrix; + m[0] = a; + m[1] = b; + m[2] = c; + m[3] = d; + m[4] = e; + m[5] = f; + } - var m = this.textLineMatrix; + translateTextMatrix(x, y) { + var m = this.textMatrix; + m[4] = m[0] * x + m[2] * y + m[4]; + m[5] = m[1] * x + m[3] * y + m[5]; + } - if (!(a === m[0] && b === m[1] && c === m[2] && d === m[3])) { - return null; - } + translateTextLineMatrix(x, y) { + var m = this.textLineMatrix; + m[4] = m[0] * x + m[2] * y + m[4]; + m[5] = m[1] * x + m[3] * y + m[5]; + } - var txDiff = e - m[4], - tyDiff = f - m[5]; + calcTextLineMatrixAdvance(a, b, c, d, e, f) { + var font = this.font; - if (font.vertical && txDiff !== 0 || !font.vertical && tyDiff !== 0) { - return null; - } + if (!font) { + return null; + } - var tx, - ty, - denominator = a * d - b * c; + var m = this.textLineMatrix; - if (font.vertical) { - tx = -tyDiff * c / denominator; - ty = tyDiff * a / denominator; - } else { - tx = txDiff * d / denominator; - ty = -txDiff * b / denominator; - } + if (!(a === m[0] && b === m[1] && c === m[2] && d === m[3])) { + return null; + } - return { - width: tx, - height: ty, - value: font.vertical ? ty : tx - }; - }, - calcRenderMatrix: function TextState_calcRendeMatrix(ctm) { - var tsm = [this.fontSize * this.textHScale, 0, 0, this.fontSize, 0, this.textRise]; - return _util.Util.transform(ctm, _util.Util.transform(this.textMatrix, tsm)); - }, - carriageReturn: function TextState_carriageReturn() { - this.translateTextLineMatrix(0, -this.leading); - this.textMatrix = this.textLineMatrix.slice(); - }, - clone: function TextState_clone() { - var clone = Object.create(this); - clone.textMatrix = this.textMatrix.slice(); - clone.textLineMatrix = this.textLineMatrix.slice(); - clone.fontMatrix = this.fontMatrix.slice(); - return clone; + var txDiff = e - m[4], + tyDiff = f - m[5]; + + if (font.vertical && txDiff !== 0 || !font.vertical && tyDiff !== 0) { + return null; } - }; - return TextState; -}(); -var EvalState = function EvalStateClosure() { - function EvalState() { + var tx, + ty, + denominator = a * d - b * c; + + if (font.vertical) { + tx = -tyDiff * c / denominator; + ty = tyDiff * a / denominator; + } else { + tx = txDiff * d / denominator; + ty = -txDiff * b / denominator; + } + + return { + width: tx, + height: ty, + value: font.vertical ? ty : tx + }; + } + + calcRenderMatrix(ctm) { + var tsm = [this.fontSize * this.textHScale, 0, 0, this.fontSize, 0, this.textRise]; + return _util.Util.transform(ctm, _util.Util.transform(this.textMatrix, tsm)); + } + + carriageReturn() { + this.translateTextLineMatrix(0, -this.leading); + this.textMatrix = this.textLineMatrix.slice(); + } + + clone() { + var clone = Object.create(this); + clone.textMatrix = this.textMatrix.slice(); + clone.textLineMatrix = this.textLineMatrix.slice(); + clone.fontMatrix = this.fontMatrix.slice(); + return clone; + } + +} + +class EvalState { + constructor() { this.ctm = new Float32Array(_util.IDENTITY_MATRIX); this.font = null; this.textRenderingMode = _util.TextRenderingMode.FILL; @@ -23246,398 +24787,401 @@ var EvalState = function EvalStateClosure() { this.strokeColorSpace = _colorspace.ColorSpace.singletons.gray; } - EvalState.prototype = { - clone: function CanvasExtraState_clone() { - return Object.create(this); - } - }; - return EvalState; -}(); + clone() { + return Object.create(this); + } -var EvaluatorPreprocessor = function EvaluatorPreprocessorClosure() { - var getOPMap = (0, _core_utils.getLookupTableFactory)(function (t) { - t.w = { - id: _util.OPS.setLineWidth, - numArgs: 1, - variableArgs: false - }; - t.J = { - id: _util.OPS.setLineCap, - numArgs: 1, - variableArgs: false - }; - t.j = { - id: _util.OPS.setLineJoin, - numArgs: 1, - variableArgs: false - }; - t.M = { - id: _util.OPS.setMiterLimit, - numArgs: 1, - variableArgs: false - }; - t.d = { - id: _util.OPS.setDash, - numArgs: 2, - variableArgs: false - }; - t.ri = { - id: _util.OPS.setRenderingIntent, - numArgs: 1, - variableArgs: false - }; - t.i = { - id: _util.OPS.setFlatness, - numArgs: 1, - variableArgs: false - }; - t.gs = { - id: _util.OPS.setGState, - numArgs: 1, - variableArgs: false - }; - t.q = { - id: _util.OPS.save, - numArgs: 0, - variableArgs: false - }; - t.Q = { - id: _util.OPS.restore, - numArgs: 0, - variableArgs: false - }; - t.cm = { - id: _util.OPS.transform, - numArgs: 6, - variableArgs: false - }; - t.m = { - id: _util.OPS.moveTo, - numArgs: 2, - variableArgs: false - }; - t.l = { - id: _util.OPS.lineTo, - numArgs: 2, - variableArgs: false - }; - t.c = { - id: _util.OPS.curveTo, - numArgs: 6, - variableArgs: false - }; - t.v = { - id: _util.OPS.curveTo2, - numArgs: 4, - variableArgs: false - }; - t.y = { - id: _util.OPS.curveTo3, - numArgs: 4, - variableArgs: false - }; - t.h = { - id: _util.OPS.closePath, - numArgs: 0, - variableArgs: false - }; - t.re = { - id: _util.OPS.rectangle, - numArgs: 4, - variableArgs: false - }; - t.S = { - id: _util.OPS.stroke, - numArgs: 0, - variableArgs: false - }; - t.s = { - id: _util.OPS.closeStroke, - numArgs: 0, - variableArgs: false - }; - t.f = { - id: _util.OPS.fill, - numArgs: 0, - variableArgs: false - }; - t.F = { - id: _util.OPS.fill, - numArgs: 0, - variableArgs: false - }; - t["f*"] = { - id: _util.OPS.eoFill, - numArgs: 0, - variableArgs: false - }; - t.B = { - id: _util.OPS.fillStroke, - numArgs: 0, - variableArgs: false - }; - t["B*"] = { - id: _util.OPS.eoFillStroke, - numArgs: 0, - variableArgs: false - }; - t.b = { - id: _util.OPS.closeFillStroke, - numArgs: 0, - variableArgs: false - }; - t["b*"] = { - id: _util.OPS.closeEOFillStroke, - numArgs: 0, - variableArgs: false - }; - t.n = { - id: _util.OPS.endPath, - numArgs: 0, - variableArgs: false - }; - t.W = { - id: _util.OPS.clip, - numArgs: 0, - variableArgs: false - }; - t["W*"] = { - id: _util.OPS.eoClip, - numArgs: 0, - variableArgs: false - }; - t.BT = { - id: _util.OPS.beginText, - numArgs: 0, - variableArgs: false - }; - t.ET = { - id: _util.OPS.endText, - numArgs: 0, - variableArgs: false - }; - t.Tc = { - id: _util.OPS.setCharSpacing, - numArgs: 1, - variableArgs: false - }; - t.Tw = { - id: _util.OPS.setWordSpacing, - numArgs: 1, - variableArgs: false - }; - t.Tz = { - id: _util.OPS.setHScale, - numArgs: 1, - variableArgs: false - }; - t.TL = { - id: _util.OPS.setLeading, - numArgs: 1, - variableArgs: false - }; - t.Tf = { - id: _util.OPS.setFont, - numArgs: 2, - variableArgs: false - }; - t.Tr = { - id: _util.OPS.setTextRenderingMode, - numArgs: 1, - variableArgs: false - }; - t.Ts = { - id: _util.OPS.setTextRise, - numArgs: 1, - variableArgs: false - }; - t.Td = { - id: _util.OPS.moveText, - numArgs: 2, - variableArgs: false - }; - t.TD = { - id: _util.OPS.setLeadingMoveText, - numArgs: 2, - variableArgs: false - }; - t.Tm = { - id: _util.OPS.setTextMatrix, - numArgs: 6, - variableArgs: false - }; - t["T*"] = { - id: _util.OPS.nextLine, - numArgs: 0, - variableArgs: false - }; - t.Tj = { - id: _util.OPS.showText, - numArgs: 1, - variableArgs: false - }; - t.TJ = { - id: _util.OPS.showSpacedText, - numArgs: 1, - variableArgs: false - }; - t["'"] = { - id: _util.OPS.nextLineShowText, - numArgs: 1, - variableArgs: false - }; - t['"'] = { - id: _util.OPS.nextLineSetSpacingShowText, - numArgs: 3, - variableArgs: false - }; - t.d0 = { - id: _util.OPS.setCharWidth, - numArgs: 2, - variableArgs: false - }; - t.d1 = { - id: _util.OPS.setCharWidthAndBounds, - numArgs: 6, - variableArgs: false - }; - t.CS = { - id: _util.OPS.setStrokeColorSpace, - numArgs: 1, - variableArgs: false - }; - t.cs = { - id: _util.OPS.setFillColorSpace, - numArgs: 1, - variableArgs: false - }; - t.SC = { - id: _util.OPS.setStrokeColor, - numArgs: 4, - variableArgs: true - }; - t.SCN = { - id: _util.OPS.setStrokeColorN, - numArgs: 33, - variableArgs: true - }; - t.sc = { - id: _util.OPS.setFillColor, - numArgs: 4, - variableArgs: true - }; - t.scn = { - id: _util.OPS.setFillColorN, - numArgs: 33, - variableArgs: true - }; - t.G = { - id: _util.OPS.setStrokeGray, - numArgs: 1, - variableArgs: false - }; - t.g = { - id: _util.OPS.setFillGray, - numArgs: 1, - variableArgs: false - }; - t.RG = { - id: _util.OPS.setStrokeRGBColor, - numArgs: 3, - variableArgs: false - }; - t.rg = { - id: _util.OPS.setFillRGBColor, - numArgs: 3, - variableArgs: false - }; - t.K = { - id: _util.OPS.setStrokeCMYKColor, - numArgs: 4, - variableArgs: false - }; - t.k = { - id: _util.OPS.setFillCMYKColor, - numArgs: 4, - variableArgs: false - }; - t.sh = { - id: _util.OPS.shadingFill, - numArgs: 1, - variableArgs: false - }; - t.BI = { - id: _util.OPS.beginInlineImage, - numArgs: 0, - variableArgs: false - }; - t.ID = { - id: _util.OPS.beginImageData, - numArgs: 0, - variableArgs: false - }; - t.EI = { - id: _util.OPS.endInlineImage, - numArgs: 1, - variableArgs: false - }; - t.Do = { - id: _util.OPS.paintXObject, - numArgs: 1, - variableArgs: false - }; - t.MP = { - id: _util.OPS.markPoint, - numArgs: 1, - variableArgs: false - }; - t.DP = { - id: _util.OPS.markPointProps, - numArgs: 2, - variableArgs: false - }; - t.BMC = { - id: _util.OPS.beginMarkedContent, - numArgs: 1, - variableArgs: false - }; - t.BDC = { - id: _util.OPS.beginMarkedContentProps, - numArgs: 2, - variableArgs: false - }; - t.EMC = { - id: _util.OPS.endMarkedContent, - numArgs: 0, - variableArgs: false - }; - t.BX = { - id: _util.OPS.beginCompat, - numArgs: 0, - variableArgs: false - }; - t.EX = { - id: _util.OPS.endCompat, - numArgs: 0, - variableArgs: false - }; - t.BM = null; - t.BD = null; - t.true = null; - t.fa = null; - t.fal = null; - t.fals = null; - t.false = null; - t.nu = null; - t.nul = null; - t.null = null; - }); - const MAX_INVALID_PATH_OPS = 20; +} + +class EvaluatorPreprocessor { + static get opMap() { + const getOPMap = (0, _core_utils.getLookupTableFactory)(function (t) { + t.w = { + id: _util.OPS.setLineWidth, + numArgs: 1, + variableArgs: false + }; + t.J = { + id: _util.OPS.setLineCap, + numArgs: 1, + variableArgs: false + }; + t.j = { + id: _util.OPS.setLineJoin, + numArgs: 1, + variableArgs: false + }; + t.M = { + id: _util.OPS.setMiterLimit, + numArgs: 1, + variableArgs: false + }; + t.d = { + id: _util.OPS.setDash, + numArgs: 2, + variableArgs: false + }; + t.ri = { + id: _util.OPS.setRenderingIntent, + numArgs: 1, + variableArgs: false + }; + t.i = { + id: _util.OPS.setFlatness, + numArgs: 1, + variableArgs: false + }; + t.gs = { + id: _util.OPS.setGState, + numArgs: 1, + variableArgs: false + }; + t.q = { + id: _util.OPS.save, + numArgs: 0, + variableArgs: false + }; + t.Q = { + id: _util.OPS.restore, + numArgs: 0, + variableArgs: false + }; + t.cm = { + id: _util.OPS.transform, + numArgs: 6, + variableArgs: false + }; + t.m = { + id: _util.OPS.moveTo, + numArgs: 2, + variableArgs: false + }; + t.l = { + id: _util.OPS.lineTo, + numArgs: 2, + variableArgs: false + }; + t.c = { + id: _util.OPS.curveTo, + numArgs: 6, + variableArgs: false + }; + t.v = { + id: _util.OPS.curveTo2, + numArgs: 4, + variableArgs: false + }; + t.y = { + id: _util.OPS.curveTo3, + numArgs: 4, + variableArgs: false + }; + t.h = { + id: _util.OPS.closePath, + numArgs: 0, + variableArgs: false + }; + t.re = { + id: _util.OPS.rectangle, + numArgs: 4, + variableArgs: false + }; + t.S = { + id: _util.OPS.stroke, + numArgs: 0, + variableArgs: false + }; + t.s = { + id: _util.OPS.closeStroke, + numArgs: 0, + variableArgs: false + }; + t.f = { + id: _util.OPS.fill, + numArgs: 0, + variableArgs: false + }; + t.F = { + id: _util.OPS.fill, + numArgs: 0, + variableArgs: false + }; + t["f*"] = { + id: _util.OPS.eoFill, + numArgs: 0, + variableArgs: false + }; + t.B = { + id: _util.OPS.fillStroke, + numArgs: 0, + variableArgs: false + }; + t["B*"] = { + id: _util.OPS.eoFillStroke, + numArgs: 0, + variableArgs: false + }; + t.b = { + id: _util.OPS.closeFillStroke, + numArgs: 0, + variableArgs: false + }; + t["b*"] = { + id: _util.OPS.closeEOFillStroke, + numArgs: 0, + variableArgs: false + }; + t.n = { + id: _util.OPS.endPath, + numArgs: 0, + variableArgs: false + }; + t.W = { + id: _util.OPS.clip, + numArgs: 0, + variableArgs: false + }; + t["W*"] = { + id: _util.OPS.eoClip, + numArgs: 0, + variableArgs: false + }; + t.BT = { + id: _util.OPS.beginText, + numArgs: 0, + variableArgs: false + }; + t.ET = { + id: _util.OPS.endText, + numArgs: 0, + variableArgs: false + }; + t.Tc = { + id: _util.OPS.setCharSpacing, + numArgs: 1, + variableArgs: false + }; + t.Tw = { + id: _util.OPS.setWordSpacing, + numArgs: 1, + variableArgs: false + }; + t.Tz = { + id: _util.OPS.setHScale, + numArgs: 1, + variableArgs: false + }; + t.TL = { + id: _util.OPS.setLeading, + numArgs: 1, + variableArgs: false + }; + t.Tf = { + id: _util.OPS.setFont, + numArgs: 2, + variableArgs: false + }; + t.Tr = { + id: _util.OPS.setTextRenderingMode, + numArgs: 1, + variableArgs: false + }; + t.Ts = { + id: _util.OPS.setTextRise, + numArgs: 1, + variableArgs: false + }; + t.Td = { + id: _util.OPS.moveText, + numArgs: 2, + variableArgs: false + }; + t.TD = { + id: _util.OPS.setLeadingMoveText, + numArgs: 2, + variableArgs: false + }; + t.Tm = { + id: _util.OPS.setTextMatrix, + numArgs: 6, + variableArgs: false + }; + t["T*"] = { + id: _util.OPS.nextLine, + numArgs: 0, + variableArgs: false + }; + t.Tj = { + id: _util.OPS.showText, + numArgs: 1, + variableArgs: false + }; + t.TJ = { + id: _util.OPS.showSpacedText, + numArgs: 1, + variableArgs: false + }; + t["'"] = { + id: _util.OPS.nextLineShowText, + numArgs: 1, + variableArgs: false + }; + t['"'] = { + id: _util.OPS.nextLineSetSpacingShowText, + numArgs: 3, + variableArgs: false + }; + t.d0 = { + id: _util.OPS.setCharWidth, + numArgs: 2, + variableArgs: false + }; + t.d1 = { + id: _util.OPS.setCharWidthAndBounds, + numArgs: 6, + variableArgs: false + }; + t.CS = { + id: _util.OPS.setStrokeColorSpace, + numArgs: 1, + variableArgs: false + }; + t.cs = { + id: _util.OPS.setFillColorSpace, + numArgs: 1, + variableArgs: false + }; + t.SC = { + id: _util.OPS.setStrokeColor, + numArgs: 4, + variableArgs: true + }; + t.SCN = { + id: _util.OPS.setStrokeColorN, + numArgs: 33, + variableArgs: true + }; + t.sc = { + id: _util.OPS.setFillColor, + numArgs: 4, + variableArgs: true + }; + t.scn = { + id: _util.OPS.setFillColorN, + numArgs: 33, + variableArgs: true + }; + t.G = { + id: _util.OPS.setStrokeGray, + numArgs: 1, + variableArgs: false + }; + t.g = { + id: _util.OPS.setFillGray, + numArgs: 1, + variableArgs: false + }; + t.RG = { + id: _util.OPS.setStrokeRGBColor, + numArgs: 3, + variableArgs: false + }; + t.rg = { + id: _util.OPS.setFillRGBColor, + numArgs: 3, + variableArgs: false + }; + t.K = { + id: _util.OPS.setStrokeCMYKColor, + numArgs: 4, + variableArgs: false + }; + t.k = { + id: _util.OPS.setFillCMYKColor, + numArgs: 4, + variableArgs: false + }; + t.sh = { + id: _util.OPS.shadingFill, + numArgs: 1, + variableArgs: false + }; + t.BI = { + id: _util.OPS.beginInlineImage, + numArgs: 0, + variableArgs: false + }; + t.ID = { + id: _util.OPS.beginImageData, + numArgs: 0, + variableArgs: false + }; + t.EI = { + id: _util.OPS.endInlineImage, + numArgs: 1, + variableArgs: false + }; + t.Do = { + id: _util.OPS.paintXObject, + numArgs: 1, + variableArgs: false + }; + t.MP = { + id: _util.OPS.markPoint, + numArgs: 1, + variableArgs: false + }; + t.DP = { + id: _util.OPS.markPointProps, + numArgs: 2, + variableArgs: false + }; + t.BMC = { + id: _util.OPS.beginMarkedContent, + numArgs: 1, + variableArgs: false + }; + t.BDC = { + id: _util.OPS.beginMarkedContentProps, + numArgs: 2, + variableArgs: false + }; + t.EMC = { + id: _util.OPS.endMarkedContent, + numArgs: 0, + variableArgs: false + }; + t.BX = { + id: _util.OPS.beginCompat, + numArgs: 0, + variableArgs: false + }; + t.EX = { + id: _util.OPS.endCompat, + numArgs: 0, + variableArgs: false + }; + t.BM = null; + t.BD = null; + t.true = null; + t.fa = null; + t.fal = null; + t.fals = null; + t.false = null; + t.nu = null; + t.nul = null; + t.null = null; + }); + return (0, _util.shadow)(this, "opMap", getOPMap()); + } - function EvaluatorPreprocessor(stream, xref, stateManager) { - this.opMap = getOPMap(); + static get MAX_INVALID_PATH_OPS() { + return (0, _util.shadow)(this, "MAX_INVALID_PATH_OPS", 20); + } + + constructor(stream, xref, stateManager) { this.parser = new _parser.Parser({ - lexer: new _parser.Lexer(stream, this.opMap), + lexer: new _parser.Lexer(stream, EvaluatorPreprocessor.opMap), xref }); this.stateManager = stateManager; @@ -23645,112 +25189,111 @@ var EvaluatorPreprocessor = function EvaluatorPreprocessorClosure() { this._numInvalidPathOPS = 0; } - EvaluatorPreprocessor.prototype = { - get savedStatesDepth() { - return this.stateManager.stateStack.length; - }, + get savedStatesDepth() { + return this.stateManager.stateStack.length; + } - read: function EvaluatorPreprocessor_read(operation) { - var args = operation.args; + read(operation) { + var args = operation.args; - while (true) { - var obj = this.parser.getObj(); + while (true) { + var obj = this.parser.getObj(); - if (obj instanceof _primitives.Cmd) { - var cmd = obj.cmd; - var opSpec = this.opMap[cmd]; + if (obj instanceof _primitives.Cmd) { + var cmd = obj.cmd; + var opSpec = EvaluatorPreprocessor.opMap[cmd]; - if (!opSpec) { - (0, _util.warn)(`Unknown command "${cmd}".`); - continue; - } - - var fn = opSpec.id; - var numArgs = opSpec.numArgs; - var argsLength = args !== null ? args.length : 0; + if (!opSpec) { + (0, _util.warn)(`Unknown command "${cmd}".`); + continue; + } - if (!opSpec.variableArgs) { - if (argsLength !== numArgs) { - var nonProcessedArgs = this.nonProcessedArgs; + var fn = opSpec.id; + var numArgs = opSpec.numArgs; + var argsLength = args !== null ? args.length : 0; - while (argsLength > numArgs) { - nonProcessedArgs.push(args.shift()); - argsLength--; - } + if (!opSpec.variableArgs) { + if (argsLength !== numArgs) { + var nonProcessedArgs = this.nonProcessedArgs; - while (argsLength < numArgs && nonProcessedArgs.length !== 0) { - if (args === null) { - args = []; - } + while (argsLength > numArgs) { + nonProcessedArgs.push(args.shift()); + argsLength--; + } - args.unshift(nonProcessedArgs.pop()); - argsLength++; + while (argsLength < numArgs && nonProcessedArgs.length !== 0) { + if (args === null) { + args = []; } + + args.unshift(nonProcessedArgs.pop()); + argsLength++; } + } - if (argsLength < numArgs) { - const partialMsg = `command ${cmd}: expected ${numArgs} args, ` + `but received ${argsLength} args.`; + if (argsLength < numArgs) { + const partialMsg = `command ${cmd}: expected ${numArgs} args, ` + `but received ${argsLength} args.`; - if (fn >= _util.OPS.moveTo && fn <= _util.OPS.endPath && ++this._numInvalidPathOPS > MAX_INVALID_PATH_OPS) { - throw new _util.FormatError(`Invalid ${partialMsg}`); - } + if (fn >= _util.OPS.moveTo && fn <= _util.OPS.endPath && ++this._numInvalidPathOPS > EvaluatorPreprocessor.MAX_INVALID_PATH_OPS) { + throw new _util.FormatError(`Invalid ${partialMsg}`); + } - (0, _util.warn)(`Skipping ${partialMsg}`); + (0, _util.warn)(`Skipping ${partialMsg}`); - if (args !== null) { - args.length = 0; - } - - continue; + if (args !== null) { + args.length = 0; } - } else if (argsLength > numArgs) { - (0, _util.info)(`Command ${cmd}: expected [0, ${numArgs}] args, ` + `but received ${argsLength} args.`); - } - this.preprocessCommand(fn, args); - operation.fn = fn; - operation.args = args; - return true; + continue; + } + } else if (argsLength > numArgs) { + (0, _util.info)(`Command ${cmd}: expected [0, ${numArgs}] args, ` + `but received ${argsLength} args.`); } - if (obj === _primitives.EOF) { - return false; - } + this.preprocessCommand(fn, args); + operation.fn = fn; + operation.args = args; + return true; + } - if (obj !== null) { - if (args === null) { - args = []; - } + if (obj === _primitives.EOF) { + return false; + } - args.push(obj); + if (obj !== null) { + if (args === null) { + args = []; + } - if (args.length > 33) { - throw new _util.FormatError("Too many arguments"); - } + args.push(obj); + + if (args.length > 33) { + throw new _util.FormatError("Too many arguments"); } } - }, - preprocessCommand: function EvaluatorPreprocessor_preprocessCommand(fn, args) { - switch (fn | 0) { - case _util.OPS.save: - this.stateManager.save(); - break; + } + } - case _util.OPS.restore: - this.stateManager.restore(); - break; + preprocessCommand(fn, args) { + switch (fn | 0) { + case _util.OPS.save: + this.stateManager.save(); + break; - case _util.OPS.transform: - this.stateManager.transform(args); - break; - } + case _util.OPS.restore: + this.stateManager.restore(); + break; + + case _util.OPS.transform: + this.stateManager.transform(args); + break; } - }; - return EvaluatorPreprocessor; -}(); + } + +} /***/ }), -/* 28 */ +/* 29 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -24660,7 +26203,7 @@ var CMapFactory = function CMapFactoryClosure() { exports.CMapFactory = CMapFactory; /***/ }), -/* 29 */ +/* 30 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -24674,25 +26217,25 @@ exports.IdentityToUnicodeMap = exports.ToUnicodeMap = exports.FontFlags = export var _util = __w_pdfjs_require__(2); -var _cff_parser = __w_pdfjs_require__(30); +var _cff_parser = __w_pdfjs_require__(31); -var _glyphlist = __w_pdfjs_require__(33); +var _glyphlist = __w_pdfjs_require__(34); -var _encodings = __w_pdfjs_require__(32); +var _encodings = __w_pdfjs_require__(33); -var _standard_fonts = __w_pdfjs_require__(34); +var _standard_fonts = __w_pdfjs_require__(35); -var _unicode = __w_pdfjs_require__(35); +var _unicode = __w_pdfjs_require__(36); var _core_utils = __w_pdfjs_require__(8); -var _font_renderer = __w_pdfjs_require__(36); +var _font_renderer = __w_pdfjs_require__(37); -var _cmap = __w_pdfjs_require__(28); +var _cmap = __w_pdfjs_require__(29); var _stream = __w_pdfjs_require__(12); -var _type1_parser = __w_pdfjs_require__(37); +var _type1_parser = __w_pdfjs_require__(38); const PRIVATE_USE_AREAS = [[0xe000, 0xf8ff], [0x100000, 0x10fffd]]; var PDF_GLYPH_SPACE_UNITS = 1000; @@ -25167,13 +26710,6 @@ var Font = function FontClosure() { this.seacMap = properties.seacMap; } - Font.getFontID = function () { - var ID = 1; - return function Font_getFontID() { - return String(ID++); - }; - }(); - function int16(b0, b1) { return (b0 << 8) + b1; } @@ -25924,7 +27460,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; @@ -26314,28 +27850,40 @@ var Font = function FontClosure() { var oldGlyfData = glyf.data; var oldGlyfDataLength = oldGlyfData.length; var newGlyfData = new Uint8Array(oldGlyfDataLength); - var startOffset = itemDecode(locaData, 0); - var writeOffset = 0; - var missingGlyphs = Object.create(null); - itemEncode(locaData, 0, writeOffset); var i, j; + const locaEntries = []; - for (i = 0, j = itemSize; i < numGlyphs; i++, j += itemSize) { - var endOffset = itemDecode(locaData, j); + for (i = 0, j = 0; i < numGlyphs + 1; i++, j += itemSize) { + let offset = itemDecode(locaData, j); - if (endOffset === 0) { - endOffset = startOffset; + if (offset > oldGlyfDataLength) { + offset = oldGlyfDataLength; } - if (endOffset > oldGlyfDataLength && (oldGlyfDataLength + 3 & ~3) === endOffset) { - endOffset = oldGlyfDataLength; - } + locaEntries.push({ + index: i, + offset, + endOffset: 0 + }); + } - if (endOffset > oldGlyfDataLength) { - startOffset = endOffset; - } + locaEntries.sort((a, b) => { + return a.offset - b.offset; + }); - var glyphProfile = sanitizeGlyph(oldGlyfData, startOffset, endOffset, newGlyfData, writeOffset, hintsValid); + for (i = 0; i < numGlyphs; i++) { + locaEntries[i].endOffset = locaEntries[i + 1].offset; + } + + locaEntries.sort((a, b) => { + return a.index - b.index; + }); + var missingGlyphs = Object.create(null); + var writeOffset = 0; + itemEncode(locaData, 0, writeOffset); + + for (i = 0, j = itemSize; i < numGlyphs; i++, j += itemSize) { + var glyphProfile = sanitizeGlyph(oldGlyfData, locaEntries[i].offset, locaEntries[i].endOffset, newGlyfData, writeOffset, hintsValid); var newLength = glyphProfile.length; if (newLength === 0) { @@ -26348,7 +27896,6 @@ var Font = function FontClosure() { writeOffset += newLength; itemEncode(locaData, j, writeOffset); - startOffset = endOffset; } if (writeOffset === 0) { @@ -26993,14 +28540,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++) { @@ -27027,31 +28573,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; } @@ -27066,6 +28597,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) { @@ -27900,7 +29444,7 @@ var CFFFont = function CFFFontClosure() { }(); /***/ }), -/* 30 */ +/* 31 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -27913,9 +29457,9 @@ exports.CFFFDSelect = exports.CFFCompiler = exports.CFFPrivateDict = exports.CFF var _util = __w_pdfjs_require__(2); -var _charsets = __w_pdfjs_require__(31); +var _charsets = __w_pdfjs_require__(32); -var _encodings = __w_pdfjs_require__(32); +var _encodings = __w_pdfjs_require__(33); var MAX_SUBR_NESTING = 10; var CFFStandardStrings = [".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "quoteleft", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "exclamdown", "cent", "sterling", "fraction", "yen", "florin", "section", "currency", "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", "fl", "endash", "dagger", "daggerdbl", "periodcentered", "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", "guillemotright", "ellipsis", "perthousand", "questiondown", "grave", "acute", "circumflex", "tilde", "macron", "breve", "dotaccent", "dieresis", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "emdash", "AE", "ordfeminine", "Lslash", "Oslash", "OE", "ordmasculine", "ae", "dotlessi", "lslash", "oslash", "oe", "germandbls", "onesuperior", "logicalnot", "mu", "trademark", "Eth", "onehalf", "plusminus", "Thorn", "onequarter", "divide", "brokenbar", "degree", "thorn", "threequarters", "twosuperior", "registered", "minus", "eth", "multiply", "threesuperior", "copyright", "Aacute", "Acircumflex", "Adieresis", "Agrave", "Aring", "Atilde", "Ccedilla", "Eacute", "Ecircumflex", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Ntilde", "Oacute", "Ocircumflex", "Odieresis", "Ograve", "Otilde", "Scaron", "Uacute", "Ucircumflex", "Udieresis", "Ugrave", "Yacute", "Ydieresis", "Zcaron", "aacute", "acircumflex", "adieresis", "agrave", "aring", "atilde", "ccedilla", "eacute", "ecircumflex", "edieresis", "egrave", "iacute", "icircumflex", "idieresis", "igrave", "ntilde", "oacute", "ocircumflex", "odieresis", "ograve", "otilde", "scaron", "uacute", "ucircumflex", "udieresis", "ugrave", "yacute", "ydieresis", "zcaron", "exclamsmall", "Hungarumlautsmall", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "commasuperior", "threequartersemdash", "periodsuperior", "questionsmall", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior", "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior", "tsuperior", "ff", "ffi", "ffl", "parenleftinferior", "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "exclamdownsmall", "centoldstyle", "Lslashsmall", "Scaronsmall", "Zcaronsmall", "Dieresissmall", "Brevesmall", "Caronsmall", "Dotaccentsmall", "Macronsmall", "figuredash", "hypheninferior", "Ogoneksmall", "Ringsmall", "Cedillasmall", "questiondownsmall", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "zerosuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", "Acircumflexsmall", "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall", "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", "Odieresissmall", "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall", "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall", "001.000", "001.001", "001.002", "001.003", "Black", "Bold", "Book", "Light", "Medium", "Regular", "Roman", "Semibold"]; @@ -28133,14 +29677,14 @@ var CFFParser = function CFFParserClosure() { resetStack: true }]; - function CFFParser(file, properties, seacAnalysisEnabled) { - this.bytes = file.getBytes(); - this.properties = properties; - this.seacAnalysisEnabled = !!seacAnalysisEnabled; - } + class CFFParser { + constructor(file, properties, seacAnalysisEnabled) { + this.bytes = file.getBytes(); + this.properties = properties; + this.seacAnalysisEnabled = !!seacAnalysisEnabled; + } - CFFParser.prototype = { - parse: function CFFParser_parse() { + parse() { var properties = this.properties; var cff = new CFF(); this.cff = cff; @@ -28208,8 +29752,9 @@ var CFFParser = function CFFParserClosure() { cff.seacs = charStringsAndSeacs.seacs; cff.widths = charStringsAndSeacs.widths; return cff; - }, - parseHeader: function CFFParser_parseHeader() { + } + + parseHeader() { var bytes = this.bytes; var bytesLength = bytes.length; var offset = 0; @@ -28237,8 +29782,9 @@ var CFFParser = function CFFParserClosure() { obj: header, endPos: hdrSize }; - }, - parseDict: function CFFParser_parseDict(dict) { + } + + parseDict(dict) { var pos = 0; function parseOperand() { @@ -28317,8 +29863,9 @@ var CFFParser = function CFFParserClosure() { } return entries; - }, - parseIndex: function CFFParser_parseIndex(pos) { + } + + parseIndex(pos) { var cffIndex = new CFFIndex(); var bytes = this.bytes; var count = bytes[pos++] << 8 | bytes[pos++]; @@ -28354,8 +29901,9 @@ var CFFParser = function CFFParserClosure() { obj: cffIndex, endPos: end }; - }, - parseNameIndex: function CFFParser_parseNameIndex(index) { + } + + parseNameIndex(index) { var names = []; for (var i = 0, ii = index.count; i < ii; ++i) { @@ -28364,8 +29912,9 @@ var CFFParser = function CFFParserClosure() { } return names; - }, - parseStringIndex: function CFFParser_parseStringIndex(index) { + } + + parseStringIndex(index) { var strings = new CFFStrings(); for (var i = 0, ii = index.count; i < ii; ++i) { @@ -28374,8 +29923,9 @@ var CFFParser = function CFFParserClosure() { } return strings; - }, - createDict: function CFFParser_createDict(Type, dict, strings) { + } + + createDict(Type, dict, strings) { var cffDict = new Type(strings); for (var i = 0, ii = dict.length; i < ii; ++i) { @@ -28386,8 +29936,9 @@ var CFFParser = function CFFParserClosure() { } return cffDict; - }, - parseCharString: function CFFParser_parseCharString(state, data, localSubrIndex, globalSubrIndex) { + } + + parseCharString(state, data, localSubrIndex, globalSubrIndex) { if (!data || state.callDepth > MAX_SUBR_NESTING) { return false; } @@ -28545,7 +30096,7 @@ var CFFParser = function CFFParserClosure() { state.stackSize = stackSize; return true; - }, + } parseCharStrings({ charStrings, @@ -28623,14 +30174,15 @@ var CFFParser = function CFFParserClosure() { seacs, widths }; - }, + } - emptyPrivateDictionary: function CFFParser_emptyPrivateDictionary(parentDict) { + emptyPrivateDictionary(parentDict) { var privateDict = this.createDict(CFFPrivateDict, [], parentDict.strings); parentDict.setByKey(18, [0, 0]); parentDict.privateDict = privateDict; - }, - parsePrivateDict: function CFFParser_parsePrivateDict(parentDict) { + } + + parsePrivateDict(parentDict) { if (!parentDict.hasName("Private")) { this.emptyPrivateDictionary(parentDict); return; @@ -28671,8 +30223,9 @@ var CFFParser = function CFFParserClosure() { var subrsIndex = this.parseIndex(relativeOffset); privateDict.subrsIndex = subrsIndex.obj; - }, - parseCharsets: function CFFParser_parseCharsets(pos, length, strings, cid) { + } + + parseCharsets(pos, length, strings, cid) { if (pos === 0) { return new CFFCharset(true, CFFCharsetPredefinedTypes.ISO_ADOBE, _charsets.ISOAdobeCharset); } else if (pos === 1) { @@ -28728,8 +30281,9 @@ var CFFParser = function CFFParserClosure() { var end = pos; var raw = bytes.subarray(start, end); return new CFFCharset(false, format, charset, raw); - }, - parseEncoding: function CFFParser_parseEncoding(pos, properties, strings, charset) { + } + + parseEncoding(pos, properties, strings, charset) { var encoding = Object.create(null); var bytes = this.bytes; var predefined = false; @@ -28803,8 +30357,9 @@ var CFFParser = function CFFParserClosure() { format = format & 0x7f; return new CFFEncoding(predefined, format, encoding, raw); - }, - parseFDSelect: function CFFParser_parseFDSelect(pos, length) { + } + + parseFDSelect(pos, length) { var bytes = this.bytes; var format = bytes[pos++]; var fdSelect = []; @@ -28851,14 +30406,16 @@ var CFFParser = function CFFParserClosure() { return new CFFFDSelect(format, fdSelect); } - }; + + } + return CFFParser; }(); exports.CFFParser = CFFParser; -var CFF = function CFFClosure() { - function CFF() { +class CFF { + constructor() { this.header = null; this.names = []; this.topDict = null; @@ -28872,124 +30429,120 @@ var CFF = function CFFClosure() { this.isCIDFont = false; } - CFF.prototype = { - duplicateFirstGlyph: function CFF_duplicateFirstGlyph() { - if (this.charStrings.count >= 65535) { - (0, _util.warn)("Not enough space in charstrings to duplicate first glyph."); - return; - } + duplicateFirstGlyph() { + if (this.charStrings.count >= 65535) { + (0, _util.warn)("Not enough space in charstrings to duplicate first glyph."); + return; + } - var glyphZero = this.charStrings.get(0); - this.charStrings.add(glyphZero); + var glyphZero = this.charStrings.get(0); + this.charStrings.add(glyphZero); - if (this.isCIDFont) { - this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0]); - } - }, - hasGlyphId: function CFF_hasGlyphID(id) { - if (id < 0 || id >= this.charStrings.count) { - return false; - } + if (this.isCIDFont) { + this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0]); + } + } - var glyph = this.charStrings.get(id); - return glyph.length > 0; + hasGlyphId(id) { + if (id < 0 || id >= this.charStrings.count) { + return false; } - }; - return CFF; -}(); + + var glyph = this.charStrings.get(id); + return glyph.length > 0; + } + +} exports.CFF = CFF; -var CFFHeader = function CFFHeaderClosure() { - function CFFHeader(major, minor, hdrSize, offSize) { +class CFFHeader { + constructor(major, minor, hdrSize, offSize) { this.major = major; this.minor = minor; this.hdrSize = hdrSize; this.offSize = offSize; } - return CFFHeader; -}(); +} exports.CFFHeader = CFFHeader; -var CFFStrings = function CFFStringsClosure() { - function CFFStrings() { +class CFFStrings { + constructor() { this.strings = []; } - CFFStrings.prototype = { - get: function CFFStrings_get(index) { - if (index >= 0 && index <= NUM_STANDARD_CFF_STRINGS - 1) { - return CFFStandardStrings[index]; - } - - if (index - NUM_STANDARD_CFF_STRINGS <= this.strings.length) { - return this.strings[index - NUM_STANDARD_CFF_STRINGS]; - } + get(index) { + if (index >= 0 && index <= NUM_STANDARD_CFF_STRINGS - 1) { + return CFFStandardStrings[index]; + } - return CFFStandardStrings[0]; - }, - getSID: function CFFStrings_getSID(str) { - let index = CFFStandardStrings.indexOf(str); + if (index - NUM_STANDARD_CFF_STRINGS <= this.strings.length) { + return this.strings[index - NUM_STANDARD_CFF_STRINGS]; + } - if (index !== -1) { - return index; - } + return CFFStandardStrings[0]; + } - index = this.strings.indexOf(str); + getSID(str) { + let index = CFFStandardStrings.indexOf(str); - if (index !== -1) { - return index + NUM_STANDARD_CFF_STRINGS; - } + if (index !== -1) { + return index; + } - return -1; - }, - add: function CFFStrings_add(value) { - this.strings.push(value); - }, + index = this.strings.indexOf(str); - get count() { - return this.strings.length; + if (index !== -1) { + return index + NUM_STANDARD_CFF_STRINGS; } - }; - return CFFStrings; -}(); + return -1; + } + + add(value) { + this.strings.push(value); + } + + get count() { + return this.strings.length; + } + +} exports.CFFStrings = CFFStrings; -var CFFIndex = function CFFIndexClosure() { - function CFFIndex() { +class CFFIndex { + constructor() { this.objects = []; this.length = 0; } - CFFIndex.prototype = { - add: function CFFIndex_add(data) { - this.length += data.length; - this.objects.push(data); - }, - set: function CFFIndex_set(index, data) { - this.length += data.length - this.objects[index].length; - this.objects[index] = data; - }, - get: function CFFIndex_get(index) { - return this.objects[index]; - }, + add(data) { + this.length += data.length; + this.objects.push(data); + } - get count() { - return this.objects.length; - } + set(index, data) { + this.length += data.length - this.objects[index].length; + this.objects[index] = data; + } - }; - return CFFIndex; -}(); + get(index) { + return this.objects[index]; + } + + get count() { + return this.objects.length; + } + +} exports.CFFIndex = CFFIndex; -var CFFDict = function CFFDictClosure() { - function CFFDict(tables, strings) { +class CFFDict { + constructor(tables, strings) { this.keyToNameMap = tables.keyToNameMap; this.nameToKeyMap = tables.nameToKeyMap; this.defaults = tables.defaults; @@ -29000,63 +30553,65 @@ var CFFDict = function CFFDictClosure() { this.values = Object.create(null); } - CFFDict.prototype = { - setByKey: function CFFDict_setByKey(key, value) { - if (!(key in this.keyToNameMap)) { - return false; - } + setByKey(key, value) { + if (!(key in this.keyToNameMap)) { + return false; + } - var valueLength = value.length; + var valueLength = value.length; - if (valueLength === 0) { + if (valueLength === 0) { + return true; + } + + for (var i = 0; i < valueLength; i++) { + if (isNaN(value[i])) { + (0, _util.warn)('Invalid CFFDict value: "' + value + '" for key "' + key + '".'); return true; } + } - for (var i = 0; i < valueLength; i++) { - if (isNaN(value[i])) { - (0, _util.warn)('Invalid CFFDict value: "' + value + '" for key "' + key + '".'); - return true; - } - } + var type = this.types[key]; - var type = this.types[key]; + if (type === "num" || type === "sid" || type === "offset") { + value = value[0]; + } - if (type === "num" || type === "sid" || type === "offset") { - value = value[0]; - } + this.values[key] = value; + return true; + } - this.values[key] = value; - return true; - }, - setByName: function CFFDict_setByName(name, value) { - if (!(name in this.nameToKeyMap)) { - throw new _util.FormatError(`Invalid dictionary name "${name}"`); - } + setByName(name, value) { + if (!(name in this.nameToKeyMap)) { + throw new _util.FormatError(`Invalid dictionary name "${name}"`); + } - this.values[this.nameToKeyMap[name]] = value; - }, - hasName: function CFFDict_hasName(name) { - return this.nameToKeyMap[name] in this.values; - }, - getByName: function CFFDict_getByName(name) { - if (!(name in this.nameToKeyMap)) { - throw new _util.FormatError(`Invalid dictionary name ${name}"`); - } + this.values[this.nameToKeyMap[name]] = value; + } - var key = this.nameToKeyMap[name]; + hasName(name) { + return this.nameToKeyMap[name] in this.values; + } - if (!(key in this.values)) { - return this.defaults[key]; - } + getByName(name) { + if (!(name in this.nameToKeyMap)) { + throw new _util.FormatError(`Invalid dictionary name ${name}"`); + } - return this.values[key]; - }, - removeByName: function CFFDict_removeByName(name) { - delete this.values[this.nameToKeyMap[name]]; + var key = this.nameToKeyMap[name]; + + if (!(key in this.values)) { + return this.defaults[key]; } - }; - CFFDict.createTables = function CFFDict_createTables(layout) { + return this.values[key]; + } + + removeByName(name) { + delete this.values[this.nameToKeyMap[name]]; + } + + static createTables(layout) { var tables = { keyToNameMap: {}, nameToKeyMap: {}, @@ -29078,25 +30633,26 @@ var CFFDict = function CFFDictClosure() { } return tables; - }; + } - return CFFDict; -}(); +} var CFFTopDict = function CFFTopDictClosure() { var layout = [[[12, 30], "ROS", ["sid", "sid", "num"], null], [[12, 20], "SyntheticBase", "num", null], [0, "version", "sid", null], [1, "Notice", "sid", null], [[12, 0], "Copyright", "sid", null], [2, "FullName", "sid", null], [3, "FamilyName", "sid", null], [4, "Weight", "sid", null], [[12, 1], "isFixedPitch", "num", 0], [[12, 2], "ItalicAngle", "num", 0], [[12, 3], "UnderlinePosition", "num", -100], [[12, 4], "UnderlineThickness", "num", 50], [[12, 5], "PaintType", "num", 0], [[12, 6], "CharstringType", "num", 2], [[12, 7], "FontMatrix", ["num", "num", "num", "num", "num", "num"], [0.001, 0, 0, 0.001, 0, 0]], [13, "UniqueID", "num", null], [5, "FontBBox", ["num", "num", "num", "num"], [0, 0, 0, 0]], [[12, 8], "StrokeWidth", "num", 0], [14, "XUID", "array", null], [15, "charset", "offset", 0], [16, "Encoding", "offset", 0], [17, "CharStrings", "offset", 0], [18, "Private", ["offset", "offset"], null], [[12, 21], "PostScript", "sid", null], [[12, 22], "BaseFontName", "sid", null], [[12, 23], "BaseFontBlend", "delta", null], [[12, 31], "CIDFontVersion", "num", 0], [[12, 32], "CIDFontRevision", "num", 0], [[12, 33], "CIDFontType", "num", 0], [[12, 34], "CIDCount", "num", 8720], [[12, 35], "UIDBase", "num", null], [[12, 37], "FDSelect", "offset", null], [[12, 36], "FDArray", "offset", null], [[12, 38], "FontName", "sid", null]]; var tables = null; - function CFFTopDict(strings) { - if (tables === null) { - tables = CFFDict.createTables(layout); + class CFFTopDict extends CFFDict { + constructor(strings) { + if (tables === null) { + tables = CFFDict.createTables(layout); + } + + super(tables, strings); + this.privateDict = null; } - CFFDict.call(this, tables, strings); - this.privateDict = null; } - CFFTopDict.prototype = Object.create(CFFDict.prototype); return CFFTopDict; }(); @@ -29106,16 +30662,18 @@ var CFFPrivateDict = function CFFPrivateDictClosure() { var layout = [[6, "BlueValues", "delta", null], [7, "OtherBlues", "delta", null], [8, "FamilyBlues", "delta", null], [9, "FamilyOtherBlues", "delta", null], [[12, 9], "BlueScale", "num", 0.039625], [[12, 10], "BlueShift", "num", 7], [[12, 11], "BlueFuzz", "num", 1], [10, "StdHW", "num", null], [11, "StdVW", "num", null], [[12, 12], "StemSnapH", "delta", null], [[12, 13], "StemSnapV", "delta", null], [[12, 14], "ForceBold", "num", 0], [[12, 17], "LanguageGroup", "num", 0], [[12, 18], "ExpansionFactor", "num", 0.06], [[12, 19], "initialRandomSeed", "num", 0], [20, "defaultWidthX", "num", 0], [21, "nominalWidthX", "num", 0], [19, "Subrs", "offset", null]]; var tables = null; - function CFFPrivateDict(strings) { - if (tables === null) { - tables = CFFDict.createTables(layout); + class CFFPrivateDict extends CFFDict { + constructor(strings) { + if (tables === null) { + tables = CFFDict.createTables(layout); + } + + super(tables, strings); + this.subrsIndex = null; } - CFFDict.call(this, tables, strings); - this.subrsIndex = null; } - CFFPrivateDict.prototype = Object.create(CFFDict.prototype); return CFFPrivateDict; }(); @@ -29126,584 +30684,598 @@ var CFFCharsetPredefinedTypes = { EXPERT_SUBSET: 2 }; -var CFFCharset = function CFFCharsetClosure() { - function CFFCharset(predefined, format, charset, raw) { +class CFFCharset { + constructor(predefined, format, charset, raw) { this.predefined = predefined; this.format = format; this.charset = charset; this.raw = raw; } - return CFFCharset; -}(); +} exports.CFFCharset = CFFCharset; -var CFFEncoding = function CFFEncodingClosure() { - function CFFEncoding(predefined, format, encoding, raw) { +class CFFEncoding { + constructor(predefined, format, encoding, raw) { this.predefined = predefined; this.format = format; this.encoding = encoding; this.raw = raw; } - return CFFEncoding; -}(); +} -var CFFFDSelect = function CFFFDSelectClosure() { - function CFFFDSelect(format, fdSelect) { +class CFFFDSelect { + constructor(format, fdSelect) { this.format = format; this.fdSelect = fdSelect; } - CFFFDSelect.prototype = { - getFDIndex: function CFFFDSelect_get(glyphIndex) { - if (glyphIndex < 0 || glyphIndex >= this.fdSelect.length) { - return -1; - } - - return this.fdSelect[glyphIndex]; + getFDIndex(glyphIndex) { + if (glyphIndex < 0 || glyphIndex >= this.fdSelect.length) { + return -1; } - }; - return CFFFDSelect; -}(); + + return this.fdSelect[glyphIndex]; + } + +} exports.CFFFDSelect = CFFFDSelect; -var CFFOffsetTracker = function CFFOffsetTrackerClosure() { - function CFFOffsetTracker() { +class CFFOffsetTracker { + constructor() { this.offsets = Object.create(null); } - CFFOffsetTracker.prototype = { - isTracking: function CFFOffsetTracker_isTracking(key) { - return key in this.offsets; - }, - track: function CFFOffsetTracker_track(key, location) { - if (key in this.offsets) { - throw new _util.FormatError(`Already tracking location of ${key}`); - } + isTracking(key) { + return key in this.offsets; + } - this.offsets[key] = location; - }, - offset: function CFFOffsetTracker_offset(value) { - for (var key in this.offsets) { - this.offsets[key] += value; - } - }, - setEntryLocation: function CFFOffsetTracker_setEntryLocation(key, values, output) { - if (!(key in this.offsets)) { - throw new _util.FormatError(`Not tracking location of ${key}`); - } + track(key, location) { + if (key in this.offsets) { + throw new _util.FormatError(`Already tracking location of ${key}`); + } - var data = output.data; - var dataOffset = this.offsets[key]; - var size = 5; + this.offsets[key] = location; + } - for (var i = 0, ii = values.length; i < ii; ++i) { - var offset0 = i * size + dataOffset; - var offset1 = offset0 + 1; - var offset2 = offset0 + 2; - var offset3 = offset0 + 3; - var offset4 = offset0 + 4; + offset(value) { + for (var key in this.offsets) { + this.offsets[key] += value; + } + } - if (data[offset0] !== 0x1d || data[offset1] !== 0 || data[offset2] !== 0 || data[offset3] !== 0 || data[offset4] !== 0) { - throw new _util.FormatError("writing to an offset that is not empty"); - } + setEntryLocation(key, values, output) { + if (!(key in this.offsets)) { + throw new _util.FormatError(`Not tracking location of ${key}`); + } + + var data = output.data; + var dataOffset = this.offsets[key]; + var size = 5; + + for (var i = 0, ii = values.length; i < ii; ++i) { + var offset0 = i * size + dataOffset; + var offset1 = offset0 + 1; + var offset2 = offset0 + 2; + var offset3 = offset0 + 3; + var offset4 = offset0 + 4; - var value = values[i]; - data[offset0] = 0x1d; - data[offset1] = value >> 24 & 0xff; - data[offset2] = value >> 16 & 0xff; - data[offset3] = value >> 8 & 0xff; - data[offset4] = value & 0xff; + if (data[offset0] !== 0x1d || data[offset1] !== 0 || data[offset2] !== 0 || data[offset3] !== 0 || data[offset4] !== 0) { + throw new _util.FormatError("writing to an offset that is not empty"); } + + var value = values[i]; + data[offset0] = 0x1d; + data[offset1] = value >> 24 & 0xff; + data[offset2] = value >> 16 & 0xff; + data[offset3] = value >> 8 & 0xff; + data[offset4] = value & 0xff; } - }; - return CFFOffsetTracker; -}(); + } + +} -var CFFCompiler = function CFFCompilerClosure() { - function CFFCompiler(cff) { +class CFFCompiler { + constructor(cff) { this.cff = cff; } - CFFCompiler.prototype = { - compile: function CFFCompiler_compile() { - var cff = this.cff; - var output = { - data: [], - length: 0, - add: function CFFCompiler_add(data) { - this.data = this.data.concat(data); - this.length = this.data.length; - } - }; - var header = this.compileHeader(cff.header); - output.add(header); - var nameIndex = this.compileNameIndex(cff.names); - output.add(nameIndex); - - if (cff.isCIDFont) { - if (cff.topDict.hasName("FontMatrix")) { - var base = cff.topDict.getByName("FontMatrix"); - cff.topDict.removeByName("FontMatrix"); + compile() { + var cff = this.cff; + var output = { + data: [], + length: 0, + add: function CFFCompiler_add(data) { + this.data = this.data.concat(data); + this.length = this.data.length; + } + }; + var header = this.compileHeader(cff.header); + output.add(header); + var nameIndex = this.compileNameIndex(cff.names); + output.add(nameIndex); - for (var i = 0, ii = cff.fdArray.length; i < ii; i++) { - var subDict = cff.fdArray[i]; - var matrix = base.slice(0); + if (cff.isCIDFont) { + if (cff.topDict.hasName("FontMatrix")) { + var base = cff.topDict.getByName("FontMatrix"); + cff.topDict.removeByName("FontMatrix"); - if (subDict.hasName("FontMatrix")) { - matrix = _util.Util.transform(matrix, subDict.getByName("FontMatrix")); - } + for (var i = 0, ii = cff.fdArray.length; i < ii; i++) { + var subDict = cff.fdArray[i]; + var matrix = base.slice(0); - subDict.setByName("FontMatrix", matrix); + if (subDict.hasName("FontMatrix")) { + matrix = _util.Util.transform(matrix, subDict.getByName("FontMatrix")); } - } - } - cff.topDict.setByName("charset", 0); - var compiled = this.compileTopDicts([cff.topDict], output.length, cff.isCIDFont); - output.add(compiled.output); - var topDictTracker = compiled.trackers[0]; - var stringIndex = this.compileStringIndex(cff.strings.strings); - output.add(stringIndex); - var globalSubrIndex = this.compileIndex(cff.globalSubrIndex); - output.add(globalSubrIndex); - - if (cff.encoding && cff.topDict.hasName("Encoding")) { - if (cff.encoding.predefined) { - topDictTracker.setEntryLocation("Encoding", [cff.encoding.format], output); - } else { - var encoding = this.compileEncoding(cff.encoding); - topDictTracker.setEntryLocation("Encoding", [output.length], output); - output.add(encoding); + subDict.setByName("FontMatrix", matrix); } } + } - var charset = this.compileCharset(cff.charset, cff.charStrings.count, cff.strings, cff.isCIDFont); - topDictTracker.setEntryLocation("charset", [output.length], output); - output.add(charset); - var charStrings = this.compileCharStrings(cff.charStrings); - topDictTracker.setEntryLocation("CharStrings", [output.length], output); - output.add(charStrings); + cff.topDict.setByName("charset", 0); + var compiled = this.compileTopDicts([cff.topDict], output.length, cff.isCIDFont); + output.add(compiled.output); + var topDictTracker = compiled.trackers[0]; + var stringIndex = this.compileStringIndex(cff.strings.strings); + output.add(stringIndex); + var globalSubrIndex = this.compileIndex(cff.globalSubrIndex); + output.add(globalSubrIndex); - if (cff.isCIDFont) { - topDictTracker.setEntryLocation("FDSelect", [output.length], output); - var fdSelect = this.compileFDSelect(cff.fdSelect); - output.add(fdSelect); - compiled = this.compileTopDicts(cff.fdArray, output.length, true); - topDictTracker.setEntryLocation("FDArray", [output.length], output); - output.add(compiled.output); - var fontDictTrackers = compiled.trackers; - this.compilePrivateDicts(cff.fdArray, fontDictTrackers, output); - } - - this.compilePrivateDicts([cff.topDict], [topDictTracker], output); - output.add([0]); - return output.data; - }, - encodeNumber: function CFFCompiler_encodeNumber(value) { - if (parseFloat(value) === parseInt(value, 10) && !isNaN(value)) { - return this.encodeInteger(value); + if (cff.encoding && cff.topDict.hasName("Encoding")) { + if (cff.encoding.predefined) { + topDictTracker.setEntryLocation("Encoding", [cff.encoding.format], output); + } else { + var encoding = this.compileEncoding(cff.encoding); + topDictTracker.setEntryLocation("Encoding", [output.length], output); + output.add(encoding); } + } - return this.encodeFloat(value); - }, - encodeFloat: function CFFCompiler_encodeFloat(num) { - var value = num.toString(); - var m = /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(value); + var charset = this.compileCharset(cff.charset, cff.charStrings.count, cff.strings, cff.isCIDFont); + topDictTracker.setEntryLocation("charset", [output.length], output); + output.add(charset); + var charStrings = this.compileCharStrings(cff.charStrings); + topDictTracker.setEntryLocation("CharStrings", [output.length], output); + output.add(charStrings); - if (m) { - var epsilon = parseFloat("1e" + ((m[2] ? +m[2] : 0) + m[1].length)); - value = (Math.round(num * epsilon) / epsilon).toString(); - } + if (cff.isCIDFont) { + topDictTracker.setEntryLocation("FDSelect", [output.length], output); + var fdSelect = this.compileFDSelect(cff.fdSelect); + output.add(fdSelect); + compiled = this.compileTopDicts(cff.fdArray, output.length, true); + topDictTracker.setEntryLocation("FDArray", [output.length], output); + output.add(compiled.output); + var fontDictTrackers = compiled.trackers; + this.compilePrivateDicts(cff.fdArray, fontDictTrackers, output); + } - var nibbles = ""; - var i, ii; + this.compilePrivateDicts([cff.topDict], [topDictTracker], output); + output.add([0]); + return output.data; + } - for (i = 0, ii = value.length; i < ii; ++i) { - var a = value[i]; + encodeNumber(value) { + if (Number.isInteger(value)) { + return this.encodeInteger(value); + } - if (a === "e") { - nibbles += value[++i] === "-" ? "c" : "b"; - } else if (a === ".") { - nibbles += "a"; - } else if (a === "-") { - nibbles += "e"; - } else { - nibbles += a; - } - } + return this.encodeFloat(value); + } - nibbles += nibbles.length & 1 ? "f" : "ff"; - var out = [30]; + static get EncodeFloatRegExp() { + return (0, _util.shadow)(this, "EncodeFloatRegExp", /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/); + } - for (i = 0, ii = nibbles.length; i < ii; i += 2) { - out.push(parseInt(nibbles.substring(i, i + 2), 16)); - } + encodeFloat(num) { + var value = num.toString(); + var m = CFFCompiler.EncodeFloatRegExp.exec(value); - return out; - }, - encodeInteger: function CFFCompiler_encodeInteger(value) { - var code; + if (m) { + var epsilon = parseFloat("1e" + ((m[2] ? +m[2] : 0) + m[1].length)); + value = (Math.round(num * epsilon) / epsilon).toString(); + } + + var nibbles = ""; + var i, ii; + + for (i = 0, ii = value.length; i < ii; ++i) { + var a = value[i]; - if (value >= -107 && value <= 107) { - code = [value + 139]; - } else if (value >= 108 && value <= 1131) { - value = value - 108; - code = [(value >> 8) + 247, value & 0xff]; - } else if (value >= -1131 && value <= -108) { - value = -value - 108; - code = [(value >> 8) + 251, value & 0xff]; - } else if (value >= -32768 && value <= 32767) { - code = [0x1c, value >> 8 & 0xff, value & 0xff]; + if (a === "e") { + nibbles += value[++i] === "-" ? "c" : "b"; + } else if (a === ".") { + nibbles += "a"; + } else if (a === "-") { + nibbles += "e"; } else { - code = [0x1d, value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff]; + nibbles += a; } + } - return code; - }, - compileHeader: function CFFCompiler_compileHeader(header) { - return [header.major, header.minor, header.hdrSize, header.offSize]; - }, - compileNameIndex: function CFFCompiler_compileNameIndex(names) { - var nameIndex = new CFFIndex(); + nibbles += nibbles.length & 1 ? "f" : "ff"; + var out = [30]; - for (var i = 0, ii = names.length; i < ii; ++i) { - var name = names[i]; - var length = Math.min(name.length, 127); - var sanitizedName = new Array(length); + for (i = 0, ii = nibbles.length; i < ii; i += 2) { + out.push(parseInt(nibbles.substring(i, i + 2), 16)); + } - for (var j = 0; j < length; j++) { - var char = name[j]; + return out; + } - if (char < "!" || char > "~" || char === "[" || char === "]" || char === "(" || char === ")" || char === "{" || char === "}" || char === "<" || char === ">" || char === "/" || char === "%") { - char = "_"; - } + encodeInteger(value) { + var code; - sanitizedName[j] = char; - } + if (value >= -107 && value <= 107) { + code = [value + 139]; + } else if (value >= 108 && value <= 1131) { + value = value - 108; + code = [(value >> 8) + 247, value & 0xff]; + } else if (value >= -1131 && value <= -108) { + value = -value - 108; + code = [(value >> 8) + 251, value & 0xff]; + } else if (value >= -32768 && value <= 32767) { + code = [0x1c, value >> 8 & 0xff, value & 0xff]; + } else { + code = [0x1d, value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff]; + } + + return code; + } + + compileHeader(header) { + return [header.major, header.minor, header.hdrSize, header.offSize]; + } - sanitizedName = sanitizedName.join(""); + compileNameIndex(names) { + var nameIndex = new CFFIndex(); - if (sanitizedName === "") { - sanitizedName = "Bad_Font_Name"; + for (var i = 0, ii = names.length; i < ii; ++i) { + var name = names[i]; + var length = Math.min(name.length, 127); + var sanitizedName = new Array(length); + + for (var j = 0; j < length; j++) { + var char = name[j]; + + if (char < "!" || char > "~" || char === "[" || char === "]" || char === "(" || char === ")" || char === "{" || char === "}" || char === "<" || char === ">" || char === "/" || char === "%") { + char = "_"; } - nameIndex.add((0, _util.stringToBytes)(sanitizedName)); + sanitizedName[j] = char; } - return this.compileIndex(nameIndex); - }, - compileTopDicts: function CFFCompiler_compileTopDicts(dicts, length, removeCidKeys) { - var fontDictTrackers = []; - var fdArrayIndex = new CFFIndex(); + sanitizedName = sanitizedName.join(""); - for (var i = 0, ii = dicts.length; i < ii; ++i) { - var fontDict = dicts[i]; + if (sanitizedName === "") { + sanitizedName = "Bad_Font_Name"; + } - if (removeCidKeys) { - fontDict.removeByName("CIDFontVersion"); - fontDict.removeByName("CIDFontRevision"); - fontDict.removeByName("CIDFontType"); - fontDict.removeByName("CIDCount"); - fontDict.removeByName("UIDBase"); - } + nameIndex.add((0, _util.stringToBytes)(sanitizedName)); + } - var fontDictTracker = new CFFOffsetTracker(); - var fontDictData = this.compileDict(fontDict, fontDictTracker); - fontDictTrackers.push(fontDictTracker); - fdArrayIndex.add(fontDictData); - fontDictTracker.offset(length); + return this.compileIndex(nameIndex); + } + + compileTopDicts(dicts, length, removeCidKeys) { + var fontDictTrackers = []; + var fdArrayIndex = new CFFIndex(); + + for (var i = 0, ii = dicts.length; i < ii; ++i) { + var fontDict = dicts[i]; + + if (removeCidKeys) { + fontDict.removeByName("CIDFontVersion"); + fontDict.removeByName("CIDFontRevision"); + fontDict.removeByName("CIDFontType"); + fontDict.removeByName("CIDCount"); + fontDict.removeByName("UIDBase"); } - fdArrayIndex = this.compileIndex(fdArrayIndex, fontDictTrackers); - return { - trackers: fontDictTrackers, - output: fdArrayIndex - }; - }, - compilePrivateDicts: function CFFCompiler_compilePrivateDicts(dicts, trackers, output) { - for (var i = 0, ii = dicts.length; i < ii; ++i) { - var fontDict = dicts[i]; - var privateDict = fontDict.privateDict; + var fontDictTracker = new CFFOffsetTracker(); + var fontDictData = this.compileDict(fontDict, fontDictTracker); + fontDictTrackers.push(fontDictTracker); + fdArrayIndex.add(fontDictData); + fontDictTracker.offset(length); + } - if (!privateDict || !fontDict.hasName("Private")) { - throw new _util.FormatError("There must be a private dictionary."); - } + fdArrayIndex = this.compileIndex(fdArrayIndex, fontDictTrackers); + return { + trackers: fontDictTrackers, + output: fdArrayIndex + }; + } - var privateDictTracker = new CFFOffsetTracker(); - var privateDictData = this.compileDict(privateDict, privateDictTracker); - var outputLength = output.length; - privateDictTracker.offset(outputLength); + compilePrivateDicts(dicts, trackers, output) { + for (var i = 0, ii = dicts.length; i < ii; ++i) { + var fontDict = dicts[i]; + var privateDict = fontDict.privateDict; - if (!privateDictData.length) { - outputLength = 0; - } + if (!privateDict || !fontDict.hasName("Private")) { + throw new _util.FormatError("There must be a private dictionary."); + } - trackers[i].setEntryLocation("Private", [privateDictData.length, outputLength], output); - output.add(privateDictData); + var privateDictTracker = new CFFOffsetTracker(); + var privateDictData = this.compileDict(privateDict, privateDictTracker); + var outputLength = output.length; + privateDictTracker.offset(outputLength); - if (privateDict.subrsIndex && privateDict.hasName("Subrs")) { - var subrs = this.compileIndex(privateDict.subrsIndex); - privateDictTracker.setEntryLocation("Subrs", [privateDictData.length], output); - output.add(subrs); - } + if (!privateDictData.length) { + outputLength = 0; } - }, - compileDict: function CFFCompiler_compileDict(dict, offsetTracker) { - var out = []; - var order = dict.order; - for (var i = 0; i < order.length; ++i) { - var key = order[i]; + trackers[i].setEntryLocation("Private", [privateDictData.length, outputLength], output); + output.add(privateDictData); - if (!(key in dict.values)) { - continue; - } + if (privateDict.subrsIndex && privateDict.hasName("Subrs")) { + var subrs = this.compileIndex(privateDict.subrsIndex); + privateDictTracker.setEntryLocation("Subrs", [privateDictData.length], output); + output.add(subrs); + } + } + } - var values = dict.values[key]; - var types = dict.types[key]; + compileDict(dict, offsetTracker) { + var out = []; + var order = dict.order; - if (!Array.isArray(types)) { - types = [types]; - } + for (var i = 0; i < order.length; ++i) { + var key = order[i]; - if (!Array.isArray(values)) { - values = [values]; - } + if (!(key in dict.values)) { + continue; + } - if (values.length === 0) { - continue; - } + var values = dict.values[key]; + var types = dict.types[key]; - for (var j = 0, jj = types.length; j < jj; ++j) { - var type = types[j]; - var value = values[j]; + if (!Array.isArray(types)) { + types = [types]; + } - switch (type) { - case "num": - case "sid": - out = out.concat(this.encodeNumber(value)); - break; + if (!Array.isArray(values)) { + values = [values]; + } - case "offset": - var name = dict.keyToNameMap[key]; + if (values.length === 0) { + continue; + } - if (!offsetTracker.isTracking(name)) { - offsetTracker.track(name, out.length); - } + for (var j = 0, jj = types.length; j < jj; ++j) { + var type = types[j]; + var value = values[j]; - out = out.concat([0x1d, 0, 0, 0, 0]); - break; + switch (type) { + case "num": + case "sid": + out = out.concat(this.encodeNumber(value)); + break; - case "array": - case "delta": - out = out.concat(this.encodeNumber(value)); + case "offset": + var name = dict.keyToNameMap[key]; - for (var k = 1, kk = values.length; k < kk; ++k) { - out = out.concat(this.encodeNumber(values[k])); - } + if (!offsetTracker.isTracking(name)) { + offsetTracker.track(name, out.length); + } - break; + out = out.concat([0x1d, 0, 0, 0, 0]); + break; - default: - throw new _util.FormatError(`Unknown data type of ${type}`); - } - } + case "array": + case "delta": + out = out.concat(this.encodeNumber(value)); - out = out.concat(dict.opcodes[key]); - } + for (var k = 1, kk = values.length; k < kk; ++k) { + out = out.concat(this.encodeNumber(values[k])); + } - return out; - }, - compileStringIndex: function CFFCompiler_compileStringIndex(strings) { - var stringIndex = new CFFIndex(); + break; - for (var i = 0, ii = strings.length; i < ii; ++i) { - stringIndex.add((0, _util.stringToBytes)(strings[i])); + default: + throw new _util.FormatError(`Unknown data type of ${type}`); + } } - return this.compileIndex(stringIndex); - }, - compileGlobalSubrIndex: function CFFCompiler_compileGlobalSubrIndex() { - var globalSubrIndex = this.cff.globalSubrIndex; - this.out.writeByteArray(this.compileIndex(globalSubrIndex)); - }, - compileCharStrings: function CFFCompiler_compileCharStrings(charStrings) { - var charStringsIndex = new CFFIndex(); + out = out.concat(dict.opcodes[key]); + } + + return out; + } - for (var i = 0; i < charStrings.count; i++) { - var glyph = charStrings.get(i); + compileStringIndex(strings) { + var stringIndex = new CFFIndex(); - if (glyph.length === 0) { - charStringsIndex.add(new Uint8Array([0x8b, 0x0e])); - continue; - } + for (var i = 0, ii = strings.length; i < ii; ++i) { + stringIndex.add((0, _util.stringToBytes)(strings[i])); + } - charStringsIndex.add(glyph); + return this.compileIndex(stringIndex); + } + + compileGlobalSubrIndex() { + var globalSubrIndex = this.cff.globalSubrIndex; + this.out.writeByteArray(this.compileIndex(globalSubrIndex)); + } + + compileCharStrings(charStrings) { + var charStringsIndex = new CFFIndex(); + + for (var i = 0; i < charStrings.count; i++) { + var glyph = charStrings.get(i); + + if (glyph.length === 0) { + charStringsIndex.add(new Uint8Array([0x8b, 0x0e])); + continue; } - return this.compileIndex(charStringsIndex); - }, - compileCharset: function CFFCompiler_compileCharset(charset, numGlyphs, strings, isCIDFont) { - let out; - const numGlyphsLessNotDef = numGlyphs - 1; + charStringsIndex.add(glyph); + } - if (isCIDFont) { - out = new Uint8Array([2, 0, 0, numGlyphsLessNotDef >> 8 & 0xff, numGlyphsLessNotDef & 0xff]); - } else { - const length = 1 + numGlyphsLessNotDef * 2; - out = new Uint8Array(length); - out[0] = 0; - let charsetIndex = 0; - const numCharsets = charset.charset.length; - let warned = false; - - for (let i = 1; i < out.length; i += 2) { - let sid = 0; - - if (charsetIndex < numCharsets) { - const name = charset.charset[charsetIndex++]; - sid = strings.getSID(name); - - if (sid === -1) { - sid = 0; - - if (!warned) { - warned = true; - (0, _util.warn)(`Couldn't find ${name} in CFF strings`); - } + return this.compileIndex(charStringsIndex); + } + + compileCharset(charset, numGlyphs, strings, isCIDFont) { + let out; + const numGlyphsLessNotDef = numGlyphs - 1; + + if (isCIDFont) { + out = new Uint8Array([2, 0, 0, numGlyphsLessNotDef >> 8 & 0xff, numGlyphsLessNotDef & 0xff]); + } else { + const length = 1 + numGlyphsLessNotDef * 2; + out = new Uint8Array(length); + out[0] = 0; + let charsetIndex = 0; + const numCharsets = charset.charset.length; + let warned = false; + + for (let i = 1; i < out.length; i += 2) { + let sid = 0; + + if (charsetIndex < numCharsets) { + const name = charset.charset[charsetIndex++]; + sid = strings.getSID(name); + + if (sid === -1) { + sid = 0; + + if (!warned) { + warned = true; + (0, _util.warn)(`Couldn't find ${name} in CFF strings`); } } - - out[i] = sid >> 8 & 0xff; - out[i + 1] = sid & 0xff; } + + out[i] = sid >> 8 & 0xff; + out[i + 1] = sid & 0xff; } + } - return this.compileTypedArray(out); - }, - compileEncoding: function CFFCompiler_compileEncoding(encoding) { - return this.compileTypedArray(encoding.raw); - }, - compileFDSelect: function CFFCompiler_compileFDSelect(fdSelect) { - const format = fdSelect.format; - let out, i; + return this.compileTypedArray(out); + } - switch (format) { - case 0: - out = new Uint8Array(1 + fdSelect.fdSelect.length); - out[0] = format; + compileEncoding(encoding) { + return this.compileTypedArray(encoding.raw); + } - for (i = 0; i < fdSelect.fdSelect.length; i++) { - out[i + 1] = fdSelect.fdSelect[i]; - } + compileFDSelect(fdSelect) { + const format = fdSelect.format; + let out, i; - break; + switch (format) { + case 0: + out = new Uint8Array(1 + fdSelect.fdSelect.length); + out[0] = format; - case 3: - const start = 0; - let lastFD = fdSelect.fdSelect[0]; - const ranges = [format, 0, 0, start >> 8 & 0xff, start & 0xff, lastFD]; + for (i = 0; i < fdSelect.fdSelect.length; i++) { + out[i + 1] = fdSelect.fdSelect[i]; + } + + break; - for (i = 1; i < fdSelect.fdSelect.length; i++) { - const currentFD = fdSelect.fdSelect[i]; + case 3: + const start = 0; + let lastFD = fdSelect.fdSelect[0]; + const ranges = [format, 0, 0, start >> 8 & 0xff, start & 0xff, lastFD]; - if (currentFD !== lastFD) { - ranges.push(i >> 8 & 0xff, i & 0xff, currentFD); - lastFD = currentFD; - } + for (i = 1; i < fdSelect.fdSelect.length; i++) { + const currentFD = fdSelect.fdSelect[i]; + + if (currentFD !== lastFD) { + ranges.push(i >> 8 & 0xff, i & 0xff, currentFD); + lastFD = currentFD; } + } - const numRanges = (ranges.length - 3) / 3; - ranges[1] = numRanges >> 8 & 0xff; - ranges[2] = numRanges & 0xff; - ranges.push(i >> 8 & 0xff, i & 0xff); - out = new Uint8Array(ranges); - break; - } + const numRanges = (ranges.length - 3) / 3; + ranges[1] = numRanges >> 8 & 0xff; + ranges[2] = numRanges & 0xff; + ranges.push(i >> 8 & 0xff, i & 0xff); + out = new Uint8Array(ranges); + break; + } - return this.compileTypedArray(out); - }, - compileTypedArray: function CFFCompiler_compileTypedArray(data) { - var out = []; + return this.compileTypedArray(out); + } - for (var i = 0, ii = data.length; i < ii; ++i) { - out[i] = data[i]; - } + compileTypedArray(data) { + var out = []; - return out; - }, - compileIndex: function CFFCompiler_compileIndex(index, trackers) { - trackers = trackers || []; - var objects = index.objects; - var count = objects.length; + for (var i = 0, ii = data.length; i < ii; ++i) { + out[i] = data[i]; + } - if (count === 0) { - return [0, 0, 0]; - } + return out; + } - var data = [count >> 8 & 0xff, count & 0xff]; - var lastOffset = 1, - i; + compileIndex(index, trackers = []) { + var objects = index.objects; + var count = objects.length; - for (i = 0; i < count; ++i) { - lastOffset += objects[i].length; - } + if (count === 0) { + return [0, 0, 0]; + } - var offsetSize; + var data = [count >> 8 & 0xff, count & 0xff]; + var lastOffset = 1, + i; - if (lastOffset < 0x100) { - offsetSize = 1; - } else if (lastOffset < 0x10000) { - offsetSize = 2; - } else if (lastOffset < 0x1000000) { - offsetSize = 3; - } else { - offsetSize = 4; - } + for (i = 0; i < count; ++i) { + lastOffset += objects[i].length; + } - data.push(offsetSize); - var relativeOffset = 1; + var offsetSize; - for (i = 0; i < count + 1; i++) { - if (offsetSize === 1) { - data.push(relativeOffset & 0xff); - } else if (offsetSize === 2) { - data.push(relativeOffset >> 8 & 0xff, relativeOffset & 0xff); - } else if (offsetSize === 3) { - data.push(relativeOffset >> 16 & 0xff, relativeOffset >> 8 & 0xff, relativeOffset & 0xff); - } else { - data.push(relativeOffset >>> 24 & 0xff, relativeOffset >> 16 & 0xff, relativeOffset >> 8 & 0xff, relativeOffset & 0xff); - } + if (lastOffset < 0x100) { + offsetSize = 1; + } else if (lastOffset < 0x10000) { + offsetSize = 2; + } else if (lastOffset < 0x1000000) { + offsetSize = 3; + } else { + offsetSize = 4; + } - if (objects[i]) { - relativeOffset += objects[i].length; - } + data.push(offsetSize); + var relativeOffset = 1; + + for (i = 0; i < count + 1; i++) { + if (offsetSize === 1) { + data.push(relativeOffset & 0xff); + } else if (offsetSize === 2) { + data.push(relativeOffset >> 8 & 0xff, relativeOffset & 0xff); + } else if (offsetSize === 3) { + data.push(relativeOffset >> 16 & 0xff, relativeOffset >> 8 & 0xff, relativeOffset & 0xff); + } else { + data.push(relativeOffset >>> 24 & 0xff, relativeOffset >> 16 & 0xff, relativeOffset >> 8 & 0xff, relativeOffset & 0xff); } - for (i = 0; i < count; i++) { - if (trackers[i]) { - trackers[i].offset(data.length); - } + if (objects[i]) { + relativeOffset += objects[i].length; + } + } - for (var j = 0, jj = objects[i].length; j < jj; j++) { - data.push(objects[i][j]); - } + for (i = 0; i < count; i++) { + if (trackers[i]) { + trackers[i].offset(data.length); } - return data; + for (var j = 0, jj = objects[i].length; j < jj; j++) { + data.push(objects[i][j]); + } } - }; - return CFFCompiler; -}(); + + return data; + } + +} exports.CFFCompiler = CFFCompiler; /***/ }), -/* 31 */ +/* 32 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -29721,7 +31293,7 @@ const ExpertSubsetCharset = [".notdef", "space", "dollaroldstyle", "dollarsuperi exports.ExpertSubsetCharset = ExpertSubsetCharset; /***/ }), -/* 32 */ +/* 33 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -29775,7 +31347,7 @@ function getEncoding(encodingName) { } /***/ }), -/* 33 */ +/* 34 */ /***/ (function(module, exports, __w_pdfjs_require__) { var getLookupTableFactory = __w_pdfjs_require__(8).getLookupTableFactory; @@ -34312,7 +35884,7 @@ exports.getGlyphsUnicode = getGlyphsUnicode; exports.getDingbatsGlyphsUnicode = getDingbatsGlyphsUnicode; /***/ }), -/* 34 */ +/* 35 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -35056,7 +36628,7 @@ const getSupplementalGlyphMapForCalibri = (0, _core_utils.getLookupTableFactory) exports.getSupplementalGlyphMapForCalibri = getSupplementalGlyphMapForCalibri; /***/ }), -/* 35 */ +/* 36 */ /***/ (function(module, exports, __w_pdfjs_require__) { var getLookupTableFactory = __w_pdfjs_require__(8).getLookupTableFactory; @@ -37033,7 +38605,7 @@ exports.getNormalizedUnicodes = getNormalizedUnicodes; exports.getUnicodeForGlyph = getUnicodeForGlyph; /***/ }), -/* 36 */ +/* 37 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -37046,11 +38618,11 @@ exports.FontRendererFactory = void 0; var _util = __w_pdfjs_require__(2); -var _cff_parser = __w_pdfjs_require__(30); +var _cff_parser = __w_pdfjs_require__(31); -var _glyphlist = __w_pdfjs_require__(33); +var _glyphlist = __w_pdfjs_require__(34); -var _encodings = __w_pdfjs_require__(32); +var _encodings = __w_pdfjs_require__(33); var _stream = __w_pdfjs_require__(12); @@ -37999,7 +39571,7 @@ var FontRendererFactory = function FontRendererFactoryClosure() { exports.FontRendererFactory = FontRendererFactory; /***/ }), -/* 37 */ +/* 38 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -38010,7 +39582,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.Type1Parser = void 0; -var _encodings = __w_pdfjs_require__(32); +var _encodings = __w_pdfjs_require__(33); var _core_utils = __w_pdfjs_require__(8); @@ -38201,7 +39773,9 @@ var Type1CharString = function Type1CharStringClosure() { case (12 << 8) + 6: if (seacAnalysisEnabled) { + const asb = this.stack[this.stack.length - 5]; this.seac = this.stack.splice(-4, 4); + this.seac[0] += this.lsb - asb; error = this.executeCommand(0, COMMAND_MAP.endchar); } else { error = this.executeCommand(4, COMMAND_MAP.endchar); @@ -38710,7 +40284,7 @@ var Type1Parser = function Type1ParserClosure() { exports.Type1Parser = Type1Parser; /***/ }), -/* 38 */ +/* 39 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -38751,7 +40325,7 @@ var Pattern = function PatternClosure() { } }; - Pattern.parseShading = function (shading, matrix, xref, res, handler, pdfFunctionFactory) { + Pattern.parseShading = function (shading, matrix, xref, res, handler, pdfFunctionFactory, localColorSpaceCache) { var dict = (0, _primitives.isStream)(shading) ? shading.dict : shading; var type = dict.get("ShadingType"); @@ -38759,13 +40333,13 @@ var Pattern = function PatternClosure() { switch (type) { case ShadingType.AXIAL: case ShadingType.RADIAL: - return new Shadings.RadialAxial(dict, matrix, xref, res, pdfFunctionFactory); + return new Shadings.RadialAxial(dict, matrix, xref, res, pdfFunctionFactory, localColorSpaceCache); case ShadingType.FREE_FORM_MESH: case ShadingType.LATTICE_FORM_MESH: case ShadingType.COONS_PATCH_MESH: case ShadingType.TENSOR_PATCH_MESH: - return new Shadings.Mesh(shading, matrix, xref, res, pdfFunctionFactory); + return new Shadings.Mesh(shading, matrix, xref, res, pdfFunctionFactory, localColorSpaceCache); default: throw new _util.FormatError("Unsupported ShadingType: " + type); @@ -38791,13 +40365,20 @@ var Shadings = {}; Shadings.SMALL_NUMBER = 1e-6; Shadings.RadialAxial = function RadialAxialClosure() { - function RadialAxial(dict, matrix, xref, res, pdfFunctionFactory) { + function RadialAxial(dict, matrix, xref, resources, pdfFunctionFactory, localColorSpaceCache) { this.matrix = matrix; this.coordsArr = dict.getArray("Coords"); this.shadingType = dict.get("ShadingType"); this.type = "Pattern"; - var cs = dict.get("ColorSpace", "CS"); - cs = _colorspace.ColorSpace.parse(cs, xref, res, pdfFunctionFactory); + + const cs = _colorspace.ColorSpace.parse({ + cs: dict.getRaw("ColorSpace") || dict.getRaw("CS"), + xref, + resources, + pdfFunctionFactory, + localColorSpaceCache + }); + this.cs = cs; const bbox = dict.getArray("BBox"); @@ -38841,7 +40422,7 @@ Shadings.RadialAxial = function RadialAxialClosure() { this.extendStart = extendStart; this.extendEnd = extendEnd; - var fnObj = dict.get("Function"); + var fnObj = dict.getRaw("Function"); var fn = pdfFunctionFactory.createFromArray(fnObj); const NUMBER_OF_SAMPLES = 10; const step = (t1 - t0) / NUMBER_OF_SAMPLES; @@ -39530,7 +41111,7 @@ Shadings.Mesh = function MeshClosure() { } } - function Mesh(stream, matrix, xref, res, pdfFunctionFactory) { + function Mesh(stream, matrix, xref, resources, pdfFunctionFactory, localColorSpaceCache) { if (!(0, _primitives.isStream)(stream)) { throw new _util.FormatError("Mesh data is not a stream"); } @@ -39547,11 +41128,17 @@ Shadings.Mesh = function MeshClosure() { this.bbox = null; } - var cs = dict.get("ColorSpace", "CS"); - cs = _colorspace.ColorSpace.parse(cs, xref, res, pdfFunctionFactory); + const cs = _colorspace.ColorSpace.parse({ + cs: dict.getRaw("ColorSpace") || dict.getRaw("CS"), + xref, + resources, + pdfFunctionFactory, + localColorSpaceCache + }); + this.cs = cs; this.background = dict.has("Background") ? cs.getRgb(dict.get("Background"), 0) : null; - var fnObj = dict.get("Function"); + var fnObj = dict.getRaw("Function"); var fn = fnObj ? pdfFunctionFactory.createFromArray(fnObj) : null; this.coords = []; this.colors = []; @@ -39649,7 +41236,1684 @@ function getTilingPatternIR(operatorList, dict, args) { } /***/ }), -/* 39 */ +/* 40 */ +/***/ (function(module, exports, __w_pdfjs_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isPDFFunction = isPDFFunction; +exports.PostScriptCompiler = exports.PostScriptEvaluator = exports.PDFFunctionFactory = void 0; + +var _primitives = __w_pdfjs_require__(5); + +var _util = __w_pdfjs_require__(2); + +var _ps_parser = __w_pdfjs_require__(41); + +var _image_utils = __w_pdfjs_require__(24); + +class PDFFunctionFactory { + constructor({ + xref, + isEvalSupported = true + }) { + this.xref = xref; + this.isEvalSupported = isEvalSupported !== false; + this._localFunctionCache = null; + } + + create(fn) { + const cachedFunction = this.getCached(fn); + + if (cachedFunction) { + return cachedFunction; + } + + const parsedFunction = PDFFunction.parse({ + xref: this.xref, + isEvalSupported: this.isEvalSupported, + fn: fn instanceof _primitives.Ref ? this.xref.fetch(fn) : fn + }); + + this._cache(fn, parsedFunction); + + return parsedFunction; + } + + createFromArray(fnObj) { + const cachedFunction = this.getCached(fnObj); + + if (cachedFunction) { + return cachedFunction; + } + + const parsedFunction = PDFFunction.parseArray({ + xref: this.xref, + isEvalSupported: this.isEvalSupported, + fnObj: fnObj instanceof _primitives.Ref ? this.xref.fetch(fnObj) : fnObj + }); + + this._cache(fnObj, parsedFunction); + + return parsedFunction; + } + + getCached(cacheKey) { + let fnRef; + + if (cacheKey instanceof _primitives.Ref) { + fnRef = cacheKey; + } else if (cacheKey instanceof _primitives.Dict) { + fnRef = cacheKey.objId; + } else if ((0, _primitives.isStream)(cacheKey)) { + fnRef = cacheKey.dict && cacheKey.dict.objId; + } + + if (fnRef) { + if (!this._localFunctionCache) { + this._localFunctionCache = new _image_utils.LocalFunctionCache(); + } + + const localFunction = this._localFunctionCache.getByRef(fnRef); + + if (localFunction) { + return localFunction; + } + } + + return null; + } + + _cache(cacheKey, parsedFunction) { + if (!parsedFunction) { + throw new Error('PDFFunctionFactory._cache - expected "parsedFunction" argument.'); + } + + let fnRef; + + if (cacheKey instanceof _primitives.Ref) { + fnRef = cacheKey; + } else if (cacheKey instanceof _primitives.Dict) { + fnRef = cacheKey.objId; + } else if ((0, _primitives.isStream)(cacheKey)) { + fnRef = cacheKey.dict && cacheKey.dict.objId; + } + + if (fnRef) { + if (!this._localFunctionCache) { + this._localFunctionCache = new _image_utils.LocalFunctionCache(); + } + + this._localFunctionCache.set(null, fnRef, parsedFunction); + } + } + +} + +exports.PDFFunctionFactory = PDFFunctionFactory; + +function toNumberArray(arr) { + if (!Array.isArray(arr)) { + return null; + } + + const length = arr.length; + + for (let i = 0; i < length; i++) { + if (typeof arr[i] !== "number") { + const result = new Array(length); + + for (let j = 0; j < length; j++) { + result[j] = +arr[j]; + } + + return result; + } + } + + return arr; +} + +var PDFFunction = function PDFFunctionClosure() { + const CONSTRUCT_SAMPLED = 0; + const CONSTRUCT_INTERPOLATED = 2; + const CONSTRUCT_STICHED = 3; + const CONSTRUCT_POSTSCRIPT = 4; + return { + getSampleArray(size, outputSize, bps, stream) { + var i, ii; + var length = 1; + + for (i = 0, ii = size.length; i < ii; i++) { + length *= size[i]; + } + + length *= outputSize; + var array = new Array(length); + var codeSize = 0; + var codeBuf = 0; + var sampleMul = 1.0 / (2.0 ** bps - 1); + var strBytes = stream.getBytes((length * bps + 7) / 8); + var strIdx = 0; + + for (i = 0; i < length; i++) { + while (codeSize < bps) { + codeBuf <<= 8; + codeBuf |= strBytes[strIdx++]; + codeSize += 8; + } + + codeSize -= bps; + array[i] = (codeBuf >> codeSize) * sampleMul; + codeBuf &= (1 << codeSize) - 1; + } + + return array; + }, + + getIR({ + xref, + isEvalSupported, + fn + }) { + var dict = fn.dict; + + if (!dict) { + dict = fn; + } + + var types = [this.constructSampled, null, this.constructInterpolated, this.constructStiched, this.constructPostScript]; + var typeNum = dict.get("FunctionType"); + var typeFn = types[typeNum]; + + if (!typeFn) { + throw new _util.FormatError("Unknown type of function"); + } + + return typeFn.call(this, { + xref, + isEvalSupported, + fn, + dict + }); + }, + + fromIR({ + xref, + isEvalSupported, + IR + }) { + var type = IR[0]; + + switch (type) { + case CONSTRUCT_SAMPLED: + return this.constructSampledFromIR({ + xref, + isEvalSupported, + IR + }); + + case CONSTRUCT_INTERPOLATED: + return this.constructInterpolatedFromIR({ + xref, + isEvalSupported, + IR + }); + + case CONSTRUCT_STICHED: + return this.constructStichedFromIR({ + xref, + isEvalSupported, + IR + }); + + default: + return this.constructPostScriptFromIR({ + xref, + isEvalSupported, + IR + }); + } + }, + + parse({ + xref, + isEvalSupported, + fn + }) { + const IR = this.getIR({ + xref, + isEvalSupported, + fn + }); + return this.fromIR({ + xref, + isEvalSupported, + IR + }); + }, + + parseArray({ + xref, + isEvalSupported, + fnObj + }) { + if (!Array.isArray(fnObj)) { + return this.parse({ + xref, + isEvalSupported, + fn: fnObj + }); + } + + var fnArray = []; + + for (var j = 0, jj = fnObj.length; j < jj; j++) { + fnArray.push(this.parse({ + xref, + isEvalSupported, + fn: xref.fetchIfRef(fnObj[j]) + })); + } + + return function (src, srcOffset, dest, destOffset) { + for (var i = 0, ii = fnArray.length; i < ii; i++) { + fnArray[i](src, srcOffset, dest, destOffset + i); + } + }; + }, + + constructSampled({ + xref, + isEvalSupported, + fn, + dict + }) { + function toMultiArray(arr) { + var inputLength = arr.length; + var out = []; + var index = 0; + + for (var i = 0; i < inputLength; i += 2) { + out[index] = [arr[i], arr[i + 1]]; + ++index; + } + + return out; + } + + var domain = toNumberArray(dict.getArray("Domain")); + var range = toNumberArray(dict.getArray("Range")); + + if (!domain || !range) { + throw new _util.FormatError("No domain or range"); + } + + var inputSize = domain.length / 2; + var outputSize = range.length / 2; + domain = toMultiArray(domain); + range = toMultiArray(range); + var size = toNumberArray(dict.getArray("Size")); + var bps = dict.get("BitsPerSample"); + var order = dict.get("Order") || 1; + + if (order !== 1) { + (0, _util.info)("No support for cubic spline interpolation: " + order); + } + + var encode = toNumberArray(dict.getArray("Encode")); + + if (!encode) { + encode = []; + + for (var i = 0; i < inputSize; ++i) { + encode.push([0, size[i] - 1]); + } + } else { + encode = toMultiArray(encode); + } + + var decode = toNumberArray(dict.getArray("Decode")); + + if (!decode) { + decode = range; + } else { + decode = toMultiArray(decode); + } + + var samples = this.getSampleArray(size, outputSize, bps, fn); + return [CONSTRUCT_SAMPLED, inputSize, domain, encode, decode, samples, size, outputSize, 2 ** bps - 1, range]; + }, + + constructSampledFromIR({ + xref, + isEvalSupported, + IR + }) { + function interpolate(x, xmin, xmax, ymin, ymax) { + return ymin + (x - xmin) * ((ymax - ymin) / (xmax - xmin)); + } + + return function constructSampledFromIRResult(src, srcOffset, dest, destOffset) { + var m = IR[1]; + var domain = IR[2]; + var encode = IR[3]; + var decode = IR[4]; + var samples = IR[5]; + var size = IR[6]; + var n = IR[7]; + var range = IR[9]; + var cubeVertices = 1 << m; + var cubeN = new Float64Array(cubeVertices); + var cubeVertex = new Uint32Array(cubeVertices); + var i, j; + + for (j = 0; j < cubeVertices; j++) { + cubeN[j] = 1; + } + + var k = n, + pos = 1; + + for (i = 0; i < m; ++i) { + var domain_2i = domain[i][0]; + var domain_2i_1 = domain[i][1]; + var xi = Math.min(Math.max(src[srcOffset + i], domain_2i), domain_2i_1); + var e = interpolate(xi, domain_2i, domain_2i_1, encode[i][0], encode[i][1]); + var size_i = size[i]; + e = Math.min(Math.max(e, 0), size_i - 1); + var e0 = e < size_i - 1 ? Math.floor(e) : e - 1; + var n0 = e0 + 1 - e; + var n1 = e - e0; + var offset0 = e0 * k; + var offset1 = offset0 + k; + + for (j = 0; j < cubeVertices; j++) { + if (j & pos) { + cubeN[j] *= n1; + cubeVertex[j] += offset1; + } else { + cubeN[j] *= n0; + cubeVertex[j] += offset0; + } + } + + k *= size_i; + pos <<= 1; + } + + for (j = 0; j < n; ++j) { + var rj = 0; + + for (i = 0; i < cubeVertices; i++) { + rj += samples[cubeVertex[i] + j] * cubeN[i]; + } + + rj = interpolate(rj, 0, 1, decode[j][0], decode[j][1]); + dest[destOffset + j] = Math.min(Math.max(rj, range[j][0]), range[j][1]); + } + }; + }, + + constructInterpolated({ + xref, + isEvalSupported, + fn, + dict + }) { + var c0 = toNumberArray(dict.getArray("C0")) || [0]; + var c1 = toNumberArray(dict.getArray("C1")) || [1]; + var n = dict.get("N"); + var length = c0.length; + var diff = []; + + for (var i = 0; i < length; ++i) { + diff.push(c1[i] - c0[i]); + } + + return [CONSTRUCT_INTERPOLATED, c0, diff, n]; + }, + + constructInterpolatedFromIR({ + xref, + isEvalSupported, + IR + }) { + var c0 = IR[1]; + var diff = IR[2]; + var n = IR[3]; + var length = diff.length; + return function constructInterpolatedFromIRResult(src, srcOffset, dest, destOffset) { + var x = n === 1 ? src[srcOffset] : src[srcOffset] ** n; + + for (var j = 0; j < length; ++j) { + dest[destOffset + j] = c0[j] + x * diff[j]; + } + }; + }, + + constructStiched({ + xref, + isEvalSupported, + fn, + dict + }) { + var domain = toNumberArray(dict.getArray("Domain")); + + if (!domain) { + throw new _util.FormatError("No domain"); + } + + var inputSize = domain.length / 2; + + if (inputSize !== 1) { + throw new _util.FormatError("Bad domain for stiched function"); + } + + var fnRefs = dict.get("Functions"); + var fns = []; + + for (var i = 0, ii = fnRefs.length; i < ii; ++i) { + fns.push(this.parse({ + xref, + isEvalSupported, + fn: xref.fetchIfRef(fnRefs[i]) + })); + } + + var bounds = toNumberArray(dict.getArray("Bounds")); + var encode = toNumberArray(dict.getArray("Encode")); + return [CONSTRUCT_STICHED, domain, bounds, encode, fns]; + }, + + constructStichedFromIR({ + xref, + isEvalSupported, + IR + }) { + var domain = IR[1]; + var bounds = IR[2]; + var encode = IR[3]; + var fns = IR[4]; + var tmpBuf = new Float32Array(1); + return function constructStichedFromIRResult(src, srcOffset, dest, destOffset) { + var clip = function constructStichedFromIRClip(v, min, max) { + if (v > max) { + v = max; + } else if (v < min) { + v = min; + } + + return v; + }; + + var v = clip(src[srcOffset], domain[0], domain[1]); + + for (var i = 0, ii = bounds.length; i < ii; ++i) { + if (v < bounds[i]) { + break; + } + } + + var dmin = domain[0]; + + if (i > 0) { + dmin = bounds[i - 1]; + } + + var dmax = domain[1]; + + if (i < bounds.length) { + dmax = bounds[i]; + } + + var rmin = encode[2 * i]; + var rmax = encode[2 * i + 1]; + tmpBuf[0] = dmin === dmax ? rmin : rmin + (v - dmin) * (rmax - rmin) / (dmax - dmin); + fns[i](tmpBuf, 0, dest, destOffset); + }; + }, + + constructPostScript({ + xref, + isEvalSupported, + fn, + dict + }) { + var domain = toNumberArray(dict.getArray("Domain")); + var range = toNumberArray(dict.getArray("Range")); + + if (!domain) { + throw new _util.FormatError("No domain."); + } + + if (!range) { + throw new _util.FormatError("No range."); + } + + var lexer = new _ps_parser.PostScriptLexer(fn); + var parser = new _ps_parser.PostScriptParser(lexer); + var code = parser.parse(); + return [CONSTRUCT_POSTSCRIPT, domain, range, code]; + }, + + constructPostScriptFromIR({ + xref, + isEvalSupported, + IR + }) { + var domain = IR[1]; + var range = IR[2]; + var code = IR[3]; + + if (isEvalSupported && _util.IsEvalSupportedCached.value) { + const compiled = new PostScriptCompiler().compile(code, domain, range); + + if (compiled) { + return new Function("src", "srcOffset", "dest", "destOffset", compiled); + } + } + + (0, _util.info)("Unable to compile PS function"); + var numOutputs = range.length >> 1; + var numInputs = domain.length >> 1; + var evaluator = new PostScriptEvaluator(code); + var cache = Object.create(null); + var MAX_CACHE_SIZE = 2048 * 4; + var cache_available = MAX_CACHE_SIZE; + var tmpBuf = new Float32Array(numInputs); + return function constructPostScriptFromIRResult(src, srcOffset, dest, destOffset) { + var i, value; + var key = ""; + var input = tmpBuf; + + for (i = 0; i < numInputs; i++) { + value = src[srcOffset + i]; + input[i] = value; + key += value + "_"; + } + + var cachedValue = cache[key]; + + if (cachedValue !== undefined) { + dest.set(cachedValue, destOffset); + return; + } + + var output = new Float32Array(numOutputs); + var stack = evaluator.execute(input); + var stackIndex = stack.length - numOutputs; + + for (i = 0; i < numOutputs; i++) { + value = stack[stackIndex + i]; + var bound = range[i * 2]; + + if (value < bound) { + value = bound; + } else { + bound = range[i * 2 + 1]; + + if (value > bound) { + value = bound; + } + } + + output[i] = value; + } + + if (cache_available > 0) { + cache_available--; + cache[key] = output; + } + + dest.set(output, destOffset); + }; + } + + }; +}(); + +function isPDFFunction(v) { + var fnDict; + + if (typeof v !== "object") { + return false; + } else if ((0, _primitives.isDict)(v)) { + fnDict = v; + } else if ((0, _primitives.isStream)(v)) { + fnDict = v.dict; + } else { + return false; + } + + return fnDict.has("FunctionType"); +} + +var PostScriptStack = function PostScriptStackClosure() { + var MAX_STACK_SIZE = 100; + + function PostScriptStack(initialStack) { + this.stack = !initialStack ? [] : Array.prototype.slice.call(initialStack, 0); + } + + PostScriptStack.prototype = { + push: function PostScriptStack_push(value) { + if (this.stack.length >= MAX_STACK_SIZE) { + throw new Error("PostScript function stack overflow."); + } + + this.stack.push(value); + }, + pop: function PostScriptStack_pop() { + if (this.stack.length <= 0) { + throw new Error("PostScript function stack underflow."); + } + + return this.stack.pop(); + }, + copy: function PostScriptStack_copy(n) { + if (this.stack.length + n >= MAX_STACK_SIZE) { + throw new Error("PostScript function stack overflow."); + } + + var stack = this.stack; + + for (var i = stack.length - n, j = n - 1; j >= 0; j--, i++) { + stack.push(stack[i]); + } + }, + index: function PostScriptStack_index(n) { + this.push(this.stack[this.stack.length - n - 1]); + }, + roll: function PostScriptStack_roll(n, p) { + var stack = this.stack; + var l = stack.length - n; + var r = stack.length - 1, + c = l + (p - Math.floor(p / n) * n), + i, + j, + t; + + for (i = l, j = r; i < j; i++, j--) { + t = stack[i]; + stack[i] = stack[j]; + stack[j] = t; + } + + for (i = l, j = c - 1; i < j; i++, j--) { + t = stack[i]; + stack[i] = stack[j]; + stack[j] = t; + } + + for (i = c, j = r; i < j; i++, j--) { + t = stack[i]; + stack[i] = stack[j]; + stack[j] = t; + } + } + }; + return PostScriptStack; +}(); + +var PostScriptEvaluator = function PostScriptEvaluatorClosure() { + function PostScriptEvaluator(operators) { + this.operators = operators; + } + + PostScriptEvaluator.prototype = { + execute: function PostScriptEvaluator_execute(initialStack) { + var stack = new PostScriptStack(initialStack); + var counter = 0; + var operators = this.operators; + var length = operators.length; + var operator, a, b; + + while (counter < length) { + operator = operators[counter++]; + + if (typeof operator === "number") { + stack.push(operator); + continue; + } + + switch (operator) { + case "jz": + b = stack.pop(); + a = stack.pop(); + + if (!a) { + counter = b; + } + + break; + + case "j": + a = stack.pop(); + counter = a; + break; + + case "abs": + a = stack.pop(); + stack.push(Math.abs(a)); + break; + + case "add": + b = stack.pop(); + a = stack.pop(); + stack.push(a + b); + break; + + case "and": + b = stack.pop(); + a = stack.pop(); + + if ((0, _util.isBool)(a) && (0, _util.isBool)(b)) { + stack.push(a && b); + } else { + stack.push(a & b); + } + + break; + + case "atan": + a = stack.pop(); + stack.push(Math.atan(a)); + break; + + case "bitshift": + b = stack.pop(); + a = stack.pop(); + + if (a > 0) { + stack.push(a << b); + } else { + stack.push(a >> b); + } + + break; + + case "ceiling": + a = stack.pop(); + stack.push(Math.ceil(a)); + break; + + case "copy": + a = stack.pop(); + stack.copy(a); + break; + + case "cos": + a = stack.pop(); + stack.push(Math.cos(a)); + break; + + case "cvi": + a = stack.pop() | 0; + stack.push(a); + break; + + case "cvr": + break; + + case "div": + b = stack.pop(); + a = stack.pop(); + stack.push(a / b); + break; + + case "dup": + stack.copy(1); + break; + + case "eq": + b = stack.pop(); + a = stack.pop(); + stack.push(a === b); + break; + + case "exch": + stack.roll(2, 1); + break; + + case "exp": + b = stack.pop(); + a = stack.pop(); + stack.push(a ** b); + break; + + case "false": + stack.push(false); + break; + + case "floor": + a = stack.pop(); + stack.push(Math.floor(a)); + break; + + case "ge": + b = stack.pop(); + a = stack.pop(); + stack.push(a >= b); + break; + + case "gt": + b = stack.pop(); + a = stack.pop(); + stack.push(a > b); + break; + + case "idiv": + b = stack.pop(); + a = stack.pop(); + stack.push(a / b | 0); + break; + + case "index": + a = stack.pop(); + stack.index(a); + break; + + case "le": + b = stack.pop(); + a = stack.pop(); + stack.push(a <= b); + break; + + case "ln": + a = stack.pop(); + stack.push(Math.log(a)); + break; + + case "log": + a = stack.pop(); + stack.push(Math.log(a) / Math.LN10); + break; + + case "lt": + b = stack.pop(); + a = stack.pop(); + stack.push(a < b); + break; + + case "mod": + b = stack.pop(); + a = stack.pop(); + stack.push(a % b); + break; + + case "mul": + b = stack.pop(); + a = stack.pop(); + stack.push(a * b); + break; + + case "ne": + b = stack.pop(); + a = stack.pop(); + stack.push(a !== b); + break; + + case "neg": + a = stack.pop(); + stack.push(-a); + break; + + case "not": + a = stack.pop(); + + if ((0, _util.isBool)(a)) { + stack.push(!a); + } else { + stack.push(~a); + } + + break; + + case "or": + b = stack.pop(); + a = stack.pop(); + + if ((0, _util.isBool)(a) && (0, _util.isBool)(b)) { + stack.push(a || b); + } else { + stack.push(a | b); + } + + break; + + case "pop": + stack.pop(); + break; + + case "roll": + b = stack.pop(); + a = stack.pop(); + stack.roll(a, b); + break; + + case "round": + a = stack.pop(); + stack.push(Math.round(a)); + break; + + case "sin": + a = stack.pop(); + stack.push(Math.sin(a)); + break; + + case "sqrt": + a = stack.pop(); + stack.push(Math.sqrt(a)); + break; + + case "sub": + b = stack.pop(); + a = stack.pop(); + stack.push(a - b); + break; + + case "true": + stack.push(true); + break; + + case "truncate": + a = stack.pop(); + a = a < 0 ? Math.ceil(a) : Math.floor(a); + stack.push(a); + break; + + case "xor": + b = stack.pop(); + a = stack.pop(); + + if ((0, _util.isBool)(a) && (0, _util.isBool)(b)) { + stack.push(a !== b); + } else { + stack.push(a ^ b); + } + + break; + + default: + throw new _util.FormatError(`Unknown operator ${operator}`); + } + } + + return stack.stack; + } + }; + return PostScriptEvaluator; +}(); + +exports.PostScriptEvaluator = PostScriptEvaluator; + +var PostScriptCompiler = function PostScriptCompilerClosure() { + function AstNode(type) { + this.type = type; + } + + AstNode.prototype.visit = function (visitor) { + (0, _util.unreachable)("abstract method"); + }; + + function AstArgument(index, min, max) { + AstNode.call(this, "args"); + this.index = index; + this.min = min; + this.max = max; + } + + AstArgument.prototype = Object.create(AstNode.prototype); + + AstArgument.prototype.visit = function (visitor) { + visitor.visitArgument(this); + }; + + function AstLiteral(number) { + AstNode.call(this, "literal"); + this.number = number; + this.min = number; + this.max = number; + } + + AstLiteral.prototype = Object.create(AstNode.prototype); + + AstLiteral.prototype.visit = function (visitor) { + visitor.visitLiteral(this); + }; + + function AstBinaryOperation(op, arg1, arg2, min, max) { + AstNode.call(this, "binary"); + this.op = op; + this.arg1 = arg1; + this.arg2 = arg2; + this.min = min; + this.max = max; + } + + AstBinaryOperation.prototype = Object.create(AstNode.prototype); + + AstBinaryOperation.prototype.visit = function (visitor) { + visitor.visitBinaryOperation(this); + }; + + function AstMin(arg, max) { + AstNode.call(this, "max"); + this.arg = arg; + this.min = arg.min; + this.max = max; + } + + AstMin.prototype = Object.create(AstNode.prototype); + + AstMin.prototype.visit = function (visitor) { + visitor.visitMin(this); + }; + + function AstVariable(index, min, max) { + AstNode.call(this, "var"); + this.index = index; + this.min = min; + this.max = max; + } + + AstVariable.prototype = Object.create(AstNode.prototype); + + AstVariable.prototype.visit = function (visitor) { + visitor.visitVariable(this); + }; + + function AstVariableDefinition(variable, arg) { + AstNode.call(this, "definition"); + this.variable = variable; + this.arg = arg; + } + + AstVariableDefinition.prototype = Object.create(AstNode.prototype); + + AstVariableDefinition.prototype.visit = function (visitor) { + visitor.visitVariableDefinition(this); + }; + + function ExpressionBuilderVisitor() { + this.parts = []; + } + + ExpressionBuilderVisitor.prototype = { + visitArgument(arg) { + this.parts.push("Math.max(", arg.min, ", Math.min(", arg.max, ", src[srcOffset + ", arg.index, "]))"); + }, + + visitVariable(variable) { + this.parts.push("v", variable.index); + }, + + visitLiteral(literal) { + this.parts.push(literal.number); + }, + + visitBinaryOperation(operation) { + this.parts.push("("); + operation.arg1.visit(this); + this.parts.push(" ", operation.op, " "); + operation.arg2.visit(this); + this.parts.push(")"); + }, + + visitVariableDefinition(definition) { + this.parts.push("var "); + definition.variable.visit(this); + this.parts.push(" = "); + definition.arg.visit(this); + this.parts.push(";"); + }, + + visitMin(max) { + this.parts.push("Math.min("); + max.arg.visit(this); + this.parts.push(", ", max.max, ")"); + }, + + toString() { + return this.parts.join(""); + } + + }; + + function buildAddOperation(num1, num2) { + if (num2.type === "literal" && num2.number === 0) { + return num1; + } + + if (num1.type === "literal" && num1.number === 0) { + return num2; + } + + if (num2.type === "literal" && num1.type === "literal") { + return new AstLiteral(num1.number + num2.number); + } + + return new AstBinaryOperation("+", num1, num2, num1.min + num2.min, num1.max + num2.max); + } + + function buildMulOperation(num1, num2) { + if (num2.type === "literal") { + if (num2.number === 0) { + return new AstLiteral(0); + } else if (num2.number === 1) { + return num1; + } else if (num1.type === "literal") { + return new AstLiteral(num1.number * num2.number); + } + } + + if (num1.type === "literal") { + if (num1.number === 0) { + return new AstLiteral(0); + } else if (num1.number === 1) { + return num2; + } + } + + var min = Math.min(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max); + var max = Math.max(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max); + return new AstBinaryOperation("*", num1, num2, min, max); + } + + function buildSubOperation(num1, num2) { + if (num2.type === "literal") { + if (num2.number === 0) { + return num1; + } else if (num1.type === "literal") { + return new AstLiteral(num1.number - num2.number); + } + } + + if (num2.type === "binary" && num2.op === "-" && num1.type === "literal" && num1.number === 1 && num2.arg1.type === "literal" && num2.arg1.number === 1) { + return num2.arg2; + } + + return new AstBinaryOperation("-", num1, num2, num1.min - num2.max, num1.max - num2.min); + } + + function buildMinOperation(num1, max) { + if (num1.min >= max) { + return new AstLiteral(max); + } else if (num1.max <= max) { + return num1; + } + + return new AstMin(num1, max); + } + + function PostScriptCompiler() {} + + PostScriptCompiler.prototype = { + compile: function PostScriptCompiler_compile(code, domain, range) { + var stack = []; + var instructions = []; + var inputSize = domain.length >> 1, + outputSize = range.length >> 1; + var lastRegister = 0; + var n, j; + var num1, num2, ast1, ast2, tmpVar, item; + + for (let i = 0; i < inputSize; i++) { + stack.push(new AstArgument(i, domain[i * 2], domain[i * 2 + 1])); + } + + for (let i = 0, ii = code.length; i < ii; i++) { + item = code[i]; + + if (typeof item === "number") { + stack.push(new AstLiteral(item)); + continue; + } + + switch (item) { + case "add": + if (stack.length < 2) { + return null; + } + + num2 = stack.pop(); + num1 = stack.pop(); + stack.push(buildAddOperation(num1, num2)); + break; + + case "cvr": + if (stack.length < 1) { + return null; + } + + break; + + case "mul": + if (stack.length < 2) { + return null; + } + + num2 = stack.pop(); + num1 = stack.pop(); + stack.push(buildMulOperation(num1, num2)); + break; + + case "sub": + if (stack.length < 2) { + return null; + } + + num2 = stack.pop(); + num1 = stack.pop(); + stack.push(buildSubOperation(num1, num2)); + break; + + case "exch": + if (stack.length < 2) { + return null; + } + + ast1 = stack.pop(); + ast2 = stack.pop(); + stack.push(ast1, ast2); + break; + + case "pop": + if (stack.length < 1) { + return null; + } + + stack.pop(); + break; + + case "index": + if (stack.length < 1) { + return null; + } + + num1 = stack.pop(); + + if (num1.type !== "literal") { + return null; + } + + n = num1.number; + + if (n < 0 || !Number.isInteger(n) || stack.length < n) { + return null; + } + + ast1 = stack[stack.length - n - 1]; + + if (ast1.type === "literal" || ast1.type === "var") { + stack.push(ast1); + break; + } + + tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); + stack[stack.length - n - 1] = tmpVar; + stack.push(tmpVar); + instructions.push(new AstVariableDefinition(tmpVar, ast1)); + break; + + case "dup": + if (stack.length < 1) { + return null; + } + + if (typeof code[i + 1] === "number" && code[i + 2] === "gt" && code[i + 3] === i + 7 && code[i + 4] === "jz" && code[i + 5] === "pop" && code[i + 6] === code[i + 1]) { + num1 = stack.pop(); + stack.push(buildMinOperation(num1, code[i + 1])); + i += 6; + break; + } + + ast1 = stack[stack.length - 1]; + + if (ast1.type === "literal" || ast1.type === "var") { + stack.push(ast1); + break; + } + + tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); + stack[stack.length - 1] = tmpVar; + stack.push(tmpVar); + instructions.push(new AstVariableDefinition(tmpVar, ast1)); + break; + + case "roll": + if (stack.length < 2) { + return null; + } + + num2 = stack.pop(); + num1 = stack.pop(); + + if (num2.type !== "literal" || num1.type !== "literal") { + return null; + } + + j = num2.number; + n = num1.number; + + if (n <= 0 || !Number.isInteger(n) || !Number.isInteger(j) || stack.length < n) { + return null; + } + + j = (j % n + n) % n; + + if (j === 0) { + break; + } + + Array.prototype.push.apply(stack, stack.splice(stack.length - n, n - j)); + break; + + default: + return null; + } + } + + if (stack.length !== outputSize) { + return null; + } + + var result = []; + instructions.forEach(function (instruction) { + var statementBuilder = new ExpressionBuilderVisitor(); + instruction.visit(statementBuilder); + result.push(statementBuilder.toString()); + }); + stack.forEach(function (expr, i) { + var statementBuilder = new ExpressionBuilderVisitor(); + expr.visit(statementBuilder); + var min = range[i * 2], + max = range[i * 2 + 1]; + var out = [statementBuilder.toString()]; + + if (min > expr.min) { + out.unshift("Math.max(", min, ", "); + out.push(")"); + } + + if (max < expr.max) { + out.unshift("Math.min(", max, ", "); + out.push(")"); + } + + out.unshift("dest[destOffset + ", i, "] = "); + out.push(";"); + result.push(out.join("")); + }); + return result.join("\n"); + } + }; + return PostScriptCompiler; +}(); + +exports.PostScriptCompiler = PostScriptCompiler; + +/***/ }), +/* 41 */ +/***/ (function(module, exports, __w_pdfjs_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.PostScriptParser = exports.PostScriptLexer = void 0; + +var _util = __w_pdfjs_require__(2); + +var _primitives = __w_pdfjs_require__(5); + +var _core_utils = __w_pdfjs_require__(8); + +class PostScriptParser { + constructor(lexer) { + this.lexer = lexer; + this.operators = []; + this.token = null; + this.prev = null; + } + + nextToken() { + this.prev = this.token; + this.token = this.lexer.getToken(); + } + + accept(type) { + if (this.token.type === type) { + this.nextToken(); + return true; + } + + return false; + } + + expect(type) { + if (this.accept(type)) { + return true; + } + + throw new _util.FormatError(`Unexpected symbol: found ${this.token.type} expected ${type}.`); + } + + parse() { + this.nextToken(); + this.expect(PostScriptTokenTypes.LBRACE); + this.parseBlock(); + this.expect(PostScriptTokenTypes.RBRACE); + return this.operators; + } + + parseBlock() { + while (true) { + if (this.accept(PostScriptTokenTypes.NUMBER)) { + this.operators.push(this.prev.value); + } else if (this.accept(PostScriptTokenTypes.OPERATOR)) { + this.operators.push(this.prev.value); + } else if (this.accept(PostScriptTokenTypes.LBRACE)) { + this.parseCondition(); + } else { + return; + } + } + } + + parseCondition() { + const conditionLocation = this.operators.length; + this.operators.push(null, null); + this.parseBlock(); + this.expect(PostScriptTokenTypes.RBRACE); + + if (this.accept(PostScriptTokenTypes.IF)) { + this.operators[conditionLocation] = this.operators.length; + this.operators[conditionLocation + 1] = "jz"; + } else if (this.accept(PostScriptTokenTypes.LBRACE)) { + const jumpLocation = this.operators.length; + this.operators.push(null, null); + const endOfTrue = this.operators.length; + this.parseBlock(); + this.expect(PostScriptTokenTypes.RBRACE); + this.expect(PostScriptTokenTypes.IFELSE); + this.operators[jumpLocation] = this.operators.length; + this.operators[jumpLocation + 1] = "j"; + this.operators[conditionLocation] = endOfTrue; + this.operators[conditionLocation + 1] = "jz"; + } else { + throw new _util.FormatError("PS Function: error parsing conditional."); + } + } + +} + +exports.PostScriptParser = PostScriptParser; +const PostScriptTokenTypes = { + LBRACE: 0, + RBRACE: 1, + NUMBER: 2, + OPERATOR: 3, + IF: 4, + IFELSE: 5 +}; + +const PostScriptToken = function PostScriptTokenClosure() { + const opCache = Object.create(null); + + class PostScriptToken { + constructor(type, value) { + this.type = type; + this.value = value; + } + + static getOperator(op) { + const opValue = opCache[op]; + + if (opValue) { + return opValue; + } + + return opCache[op] = new PostScriptToken(PostScriptTokenTypes.OPERATOR, op); + } + + static get LBRACE() { + return (0, _util.shadow)(this, "LBRACE", new PostScriptToken(PostScriptTokenTypes.LBRACE, "{")); + } + + static get RBRACE() { + return (0, _util.shadow)(this, "RBRACE", new PostScriptToken(PostScriptTokenTypes.RBRACE, "}")); + } + + static get IF() { + return (0, _util.shadow)(this, "IF", new PostScriptToken(PostScriptTokenTypes.IF, "IF")); + } + + static get IFELSE() { + return (0, _util.shadow)(this, "IFELSE", new PostScriptToken(PostScriptTokenTypes.IFELSE, "IFELSE")); + } + + } + + return PostScriptToken; +}(); + +class PostScriptLexer { + constructor(stream) { + this.stream = stream; + this.nextChar(); + this.strBuf = []; + } + + nextChar() { + return this.currentChar = this.stream.getByte(); + } + + getToken() { + let comment = false; + let ch = this.currentChar; + + while (true) { + if (ch < 0) { + return _primitives.EOF; + } + + if (comment) { + if (ch === 0x0a || ch === 0x0d) { + comment = false; + } + } else if (ch === 0x25) { + comment = true; + } else if (!(0, _core_utils.isWhiteSpace)(ch)) { + break; + } + + ch = this.nextChar(); + } + + switch (ch | 0) { + case 0x30: + case 0x31: + case 0x32: + case 0x33: + case 0x34: + case 0x35: + case 0x36: + case 0x37: + case 0x38: + case 0x39: + case 0x2b: + case 0x2d: + case 0x2e: + return new PostScriptToken(PostScriptTokenTypes.NUMBER, this.getNumber()); + + case 0x7b: + this.nextChar(); + return PostScriptToken.LBRACE; + + case 0x7d: + this.nextChar(); + return PostScriptToken.RBRACE; + } + + const strBuf = this.strBuf; + strBuf.length = 0; + strBuf[0] = String.fromCharCode(ch); + + while ((ch = this.nextChar()) >= 0 && (ch >= 0x41 && ch <= 0x5a || ch >= 0x61 && ch <= 0x7a)) { + strBuf.push(String.fromCharCode(ch)); + } + + const str = strBuf.join(""); + + switch (str.toLowerCase()) { + case "if": + return PostScriptToken.IF; + + case "ifelse": + return PostScriptToken.IFELSE; + + default: + return PostScriptToken.getOperator(str); + } + } + + getNumber() { + let ch = this.currentChar; + const strBuf = this.strBuf; + strBuf.length = 0; + strBuf[0] = String.fromCharCode(ch); + + while ((ch = this.nextChar()) >= 0) { + if (ch >= 0x30 && ch <= 0x39 || ch === 0x2d || ch === 0x2e) { + strBuf.push(String.fromCharCode(ch)); + } else { + break; + } + } + + const value = parseFloat(strBuf.join("")); + + if (isNaN(value)) { + throw new _util.FormatError(`Invalid floating point number: ${value}`); + } + + return value; + } + +} + +exports.PostScriptLexer = PostScriptLexer; + +/***/ }), +/* 42 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -39961,7 +43225,7 @@ function bidi(str, startLevel, vertical) { } /***/ }), -/* 40 */ +/* 43 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -42915,1611 +46179,7 @@ var getMetrics = (0, _core_utils.getLookupTableFactory)(function (t) { exports.getMetrics = getMetrics; /***/ }), -/* 41 */ -/***/ (function(module, exports, __w_pdfjs_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isPDFFunction = isPDFFunction; -exports.PostScriptCompiler = exports.PostScriptEvaluator = exports.PDFFunctionFactory = void 0; - -var _util = __w_pdfjs_require__(2); - -var _primitives = __w_pdfjs_require__(5); - -var _ps_parser = __w_pdfjs_require__(42); - -class PDFFunctionFactory { - constructor({ - xref, - isEvalSupported = true - }) { - this.xref = xref; - this.isEvalSupported = isEvalSupported !== false; - } - - create(fn) { - return PDFFunction.parse({ - xref: this.xref, - isEvalSupported: this.isEvalSupported, - fn - }); - } - - createFromArray(fnObj) { - return PDFFunction.parseArray({ - xref: this.xref, - isEvalSupported: this.isEvalSupported, - fnObj - }); - } - -} - -exports.PDFFunctionFactory = PDFFunctionFactory; - -function toNumberArray(arr) { - if (!Array.isArray(arr)) { - return null; - } - - const length = arr.length; - - for (let i = 0; i < length; i++) { - if (typeof arr[i] !== "number") { - const result = new Array(length); - - for (let j = 0; j < length; j++) { - result[j] = +arr[j]; - } - - return result; - } - } - - return arr; -} - -var PDFFunction = function PDFFunctionClosure() { - const CONSTRUCT_SAMPLED = 0; - const CONSTRUCT_INTERPOLATED = 2; - const CONSTRUCT_STICHED = 3; - const CONSTRUCT_POSTSCRIPT = 4; - return { - getSampleArray(size, outputSize, bps, stream) { - var i, ii; - var length = 1; - - for (i = 0, ii = size.length; i < ii; i++) { - length *= size[i]; - } - - length *= outputSize; - var array = new Array(length); - var codeSize = 0; - var codeBuf = 0; - var sampleMul = 1.0 / (2.0 ** bps - 1); - var strBytes = stream.getBytes((length * bps + 7) / 8); - var strIdx = 0; - - for (i = 0; i < length; i++) { - while (codeSize < bps) { - codeBuf <<= 8; - codeBuf |= strBytes[strIdx++]; - codeSize += 8; - } - - codeSize -= bps; - array[i] = (codeBuf >> codeSize) * sampleMul; - codeBuf &= (1 << codeSize) - 1; - } - - return array; - }, - - getIR({ - xref, - isEvalSupported, - fn - }) { - var dict = fn.dict; - - if (!dict) { - dict = fn; - } - - var types = [this.constructSampled, null, this.constructInterpolated, this.constructStiched, this.constructPostScript]; - var typeNum = dict.get("FunctionType"); - var typeFn = types[typeNum]; - - if (!typeFn) { - throw new _util.FormatError("Unknown type of function"); - } - - return typeFn.call(this, { - xref, - isEvalSupported, - fn, - dict - }); - }, - - fromIR({ - xref, - isEvalSupported, - IR - }) { - var type = IR[0]; - - switch (type) { - case CONSTRUCT_SAMPLED: - return this.constructSampledFromIR({ - xref, - isEvalSupported, - IR - }); - - case CONSTRUCT_INTERPOLATED: - return this.constructInterpolatedFromIR({ - xref, - isEvalSupported, - IR - }); - - case CONSTRUCT_STICHED: - return this.constructStichedFromIR({ - xref, - isEvalSupported, - IR - }); - - default: - return this.constructPostScriptFromIR({ - xref, - isEvalSupported, - IR - }); - } - }, - - parse({ - xref, - isEvalSupported, - fn - }) { - const IR = this.getIR({ - xref, - isEvalSupported, - fn - }); - return this.fromIR({ - xref, - isEvalSupported, - IR - }); - }, - - parseArray({ - xref, - isEvalSupported, - fnObj - }) { - if (!Array.isArray(fnObj)) { - return this.parse({ - xref, - isEvalSupported, - fn: fnObj - }); - } - - var fnArray = []; - - for (var j = 0, jj = fnObj.length; j < jj; j++) { - fnArray.push(this.parse({ - xref, - isEvalSupported, - fn: xref.fetchIfRef(fnObj[j]) - })); - } - - return function (src, srcOffset, dest, destOffset) { - for (var i = 0, ii = fnArray.length; i < ii; i++) { - fnArray[i](src, srcOffset, dest, destOffset + i); - } - }; - }, - - constructSampled({ - xref, - isEvalSupported, - fn, - dict - }) { - function toMultiArray(arr) { - var inputLength = arr.length; - var out = []; - var index = 0; - - for (var i = 0; i < inputLength; i += 2) { - out[index] = [arr[i], arr[i + 1]]; - ++index; - } - - return out; - } - - var domain = toNumberArray(dict.getArray("Domain")); - var range = toNumberArray(dict.getArray("Range")); - - if (!domain || !range) { - throw new _util.FormatError("No domain or range"); - } - - var inputSize = domain.length / 2; - var outputSize = range.length / 2; - domain = toMultiArray(domain); - range = toMultiArray(range); - var size = toNumberArray(dict.getArray("Size")); - var bps = dict.get("BitsPerSample"); - var order = dict.get("Order") || 1; - - if (order !== 1) { - (0, _util.info)("No support for cubic spline interpolation: " + order); - } - - var encode = toNumberArray(dict.getArray("Encode")); - - if (!encode) { - encode = []; - - for (var i = 0; i < inputSize; ++i) { - encode.push([0, size[i] - 1]); - } - } else { - encode = toMultiArray(encode); - } - - var decode = toNumberArray(dict.getArray("Decode")); - - if (!decode) { - decode = range; - } else { - decode = toMultiArray(decode); - } - - var samples = this.getSampleArray(size, outputSize, bps, fn); - return [CONSTRUCT_SAMPLED, inputSize, domain, encode, decode, samples, size, outputSize, 2 ** bps - 1, range]; - }, - - constructSampledFromIR({ - xref, - isEvalSupported, - IR - }) { - function interpolate(x, xmin, xmax, ymin, ymax) { - return ymin + (x - xmin) * ((ymax - ymin) / (xmax - xmin)); - } - - return function constructSampledFromIRResult(src, srcOffset, dest, destOffset) { - var m = IR[1]; - var domain = IR[2]; - var encode = IR[3]; - var decode = IR[4]; - var samples = IR[5]; - var size = IR[6]; - var n = IR[7]; - var range = IR[9]; - var cubeVertices = 1 << m; - var cubeN = new Float64Array(cubeVertices); - var cubeVertex = new Uint32Array(cubeVertices); - var i, j; - - for (j = 0; j < cubeVertices; j++) { - cubeN[j] = 1; - } - - var k = n, - pos = 1; - - for (i = 0; i < m; ++i) { - var domain_2i = domain[i][0]; - var domain_2i_1 = domain[i][1]; - var xi = Math.min(Math.max(src[srcOffset + i], domain_2i), domain_2i_1); - var e = interpolate(xi, domain_2i, domain_2i_1, encode[i][0], encode[i][1]); - var size_i = size[i]; - e = Math.min(Math.max(e, 0), size_i - 1); - var e0 = e < size_i - 1 ? Math.floor(e) : e - 1; - var n0 = e0 + 1 - e; - var n1 = e - e0; - var offset0 = e0 * k; - var offset1 = offset0 + k; - - for (j = 0; j < cubeVertices; j++) { - if (j & pos) { - cubeN[j] *= n1; - cubeVertex[j] += offset1; - } else { - cubeN[j] *= n0; - cubeVertex[j] += offset0; - } - } - - k *= size_i; - pos <<= 1; - } - - for (j = 0; j < n; ++j) { - var rj = 0; - - for (i = 0; i < cubeVertices; i++) { - rj += samples[cubeVertex[i] + j] * cubeN[i]; - } - - rj = interpolate(rj, 0, 1, decode[j][0], decode[j][1]); - dest[destOffset + j] = Math.min(Math.max(rj, range[j][0]), range[j][1]); - } - }; - }, - - constructInterpolated({ - xref, - isEvalSupported, - fn, - dict - }) { - var c0 = toNumberArray(dict.getArray("C0")) || [0]; - var c1 = toNumberArray(dict.getArray("C1")) || [1]; - var n = dict.get("N"); - var length = c0.length; - var diff = []; - - for (var i = 0; i < length; ++i) { - diff.push(c1[i] - c0[i]); - } - - return [CONSTRUCT_INTERPOLATED, c0, diff, n]; - }, - - constructInterpolatedFromIR({ - xref, - isEvalSupported, - IR - }) { - var c0 = IR[1]; - var diff = IR[2]; - var n = IR[3]; - var length = diff.length; - return function constructInterpolatedFromIRResult(src, srcOffset, dest, destOffset) { - var x = n === 1 ? src[srcOffset] : src[srcOffset] ** n; - - for (var j = 0; j < length; ++j) { - dest[destOffset + j] = c0[j] + x * diff[j]; - } - }; - }, - - constructStiched({ - xref, - isEvalSupported, - fn, - dict - }) { - var domain = toNumberArray(dict.getArray("Domain")); - - if (!domain) { - throw new _util.FormatError("No domain"); - } - - var inputSize = domain.length / 2; - - if (inputSize !== 1) { - throw new _util.FormatError("Bad domain for stiched function"); - } - - var fnRefs = dict.get("Functions"); - var fns = []; - - for (var i = 0, ii = fnRefs.length; i < ii; ++i) { - fns.push(this.parse({ - xref, - isEvalSupported, - fn: xref.fetchIfRef(fnRefs[i]) - })); - } - - var bounds = toNumberArray(dict.getArray("Bounds")); - var encode = toNumberArray(dict.getArray("Encode")); - return [CONSTRUCT_STICHED, domain, bounds, encode, fns]; - }, - - constructStichedFromIR({ - xref, - isEvalSupported, - IR - }) { - var domain = IR[1]; - var bounds = IR[2]; - var encode = IR[3]; - var fns = IR[4]; - var tmpBuf = new Float32Array(1); - return function constructStichedFromIRResult(src, srcOffset, dest, destOffset) { - var clip = function constructStichedFromIRClip(v, min, max) { - if (v > max) { - v = max; - } else if (v < min) { - v = min; - } - - return v; - }; - - var v = clip(src[srcOffset], domain[0], domain[1]); - - for (var i = 0, ii = bounds.length; i < ii; ++i) { - if (v < bounds[i]) { - break; - } - } - - var dmin = domain[0]; - - if (i > 0) { - dmin = bounds[i - 1]; - } - - var dmax = domain[1]; - - if (i < bounds.length) { - dmax = bounds[i]; - } - - var rmin = encode[2 * i]; - var rmax = encode[2 * i + 1]; - tmpBuf[0] = dmin === dmax ? rmin : rmin + (v - dmin) * (rmax - rmin) / (dmax - dmin); - fns[i](tmpBuf, 0, dest, destOffset); - }; - }, - - constructPostScript({ - xref, - isEvalSupported, - fn, - dict - }) { - var domain = toNumberArray(dict.getArray("Domain")); - var range = toNumberArray(dict.getArray("Range")); - - if (!domain) { - throw new _util.FormatError("No domain."); - } - - if (!range) { - throw new _util.FormatError("No range."); - } - - var lexer = new _ps_parser.PostScriptLexer(fn); - var parser = new _ps_parser.PostScriptParser(lexer); - var code = parser.parse(); - return [CONSTRUCT_POSTSCRIPT, domain, range, code]; - }, - - constructPostScriptFromIR({ - xref, - isEvalSupported, - IR - }) { - var domain = IR[1]; - var range = IR[2]; - var code = IR[3]; - - if (isEvalSupported && _util.IsEvalSupportedCached.value) { - const compiled = new PostScriptCompiler().compile(code, domain, range); - - if (compiled) { - return new Function("src", "srcOffset", "dest", "destOffset", compiled); - } - } - - (0, _util.info)("Unable to compile PS function"); - var numOutputs = range.length >> 1; - var numInputs = domain.length >> 1; - var evaluator = new PostScriptEvaluator(code); - var cache = Object.create(null); - var MAX_CACHE_SIZE = 2048 * 4; - var cache_available = MAX_CACHE_SIZE; - var tmpBuf = new Float32Array(numInputs); - return function constructPostScriptFromIRResult(src, srcOffset, dest, destOffset) { - var i, value; - var key = ""; - var input = tmpBuf; - - for (i = 0; i < numInputs; i++) { - value = src[srcOffset + i]; - input[i] = value; - key += value + "_"; - } - - var cachedValue = cache[key]; - - if (cachedValue !== undefined) { - dest.set(cachedValue, destOffset); - return; - } - - var output = new Float32Array(numOutputs); - var stack = evaluator.execute(input); - var stackIndex = stack.length - numOutputs; - - for (i = 0; i < numOutputs; i++) { - value = stack[stackIndex + i]; - var bound = range[i * 2]; - - if (value < bound) { - value = bound; - } else { - bound = range[i * 2 + 1]; - - if (value > bound) { - value = bound; - } - } - - output[i] = value; - } - - if (cache_available > 0) { - cache_available--; - cache[key] = output; - } - - dest.set(output, destOffset); - }; - } - - }; -}(); - -function isPDFFunction(v) { - var fnDict; - - if (typeof v !== "object") { - return false; - } else if ((0, _primitives.isDict)(v)) { - fnDict = v; - } else if ((0, _primitives.isStream)(v)) { - fnDict = v.dict; - } else { - return false; - } - - return fnDict.has("FunctionType"); -} - -var PostScriptStack = function PostScriptStackClosure() { - var MAX_STACK_SIZE = 100; - - function PostScriptStack(initialStack) { - this.stack = !initialStack ? [] : Array.prototype.slice.call(initialStack, 0); - } - - PostScriptStack.prototype = { - push: function PostScriptStack_push(value) { - if (this.stack.length >= MAX_STACK_SIZE) { - throw new Error("PostScript function stack overflow."); - } - - this.stack.push(value); - }, - pop: function PostScriptStack_pop() { - if (this.stack.length <= 0) { - throw new Error("PostScript function stack underflow."); - } - - return this.stack.pop(); - }, - copy: function PostScriptStack_copy(n) { - if (this.stack.length + n >= MAX_STACK_SIZE) { - throw new Error("PostScript function stack overflow."); - } - - var stack = this.stack; - - for (var i = stack.length - n, j = n - 1; j >= 0; j--, i++) { - stack.push(stack[i]); - } - }, - index: function PostScriptStack_index(n) { - this.push(this.stack[this.stack.length - n - 1]); - }, - roll: function PostScriptStack_roll(n, p) { - var stack = this.stack; - var l = stack.length - n; - var r = stack.length - 1, - c = l + (p - Math.floor(p / n) * n), - i, - j, - t; - - for (i = l, j = r; i < j; i++, j--) { - t = stack[i]; - stack[i] = stack[j]; - stack[j] = t; - } - - for (i = l, j = c - 1; i < j; i++, j--) { - t = stack[i]; - stack[i] = stack[j]; - stack[j] = t; - } - - for (i = c, j = r; i < j; i++, j--) { - t = stack[i]; - stack[i] = stack[j]; - stack[j] = t; - } - } - }; - return PostScriptStack; -}(); - -var PostScriptEvaluator = function PostScriptEvaluatorClosure() { - function PostScriptEvaluator(operators) { - this.operators = operators; - } - - PostScriptEvaluator.prototype = { - execute: function PostScriptEvaluator_execute(initialStack) { - var stack = new PostScriptStack(initialStack); - var counter = 0; - var operators = this.operators; - var length = operators.length; - var operator, a, b; - - while (counter < length) { - operator = operators[counter++]; - - if (typeof operator === "number") { - stack.push(operator); - continue; - } - - switch (operator) { - case "jz": - b = stack.pop(); - a = stack.pop(); - - if (!a) { - counter = b; - } - - break; - - case "j": - a = stack.pop(); - counter = a; - break; - - case "abs": - a = stack.pop(); - stack.push(Math.abs(a)); - break; - - case "add": - b = stack.pop(); - a = stack.pop(); - stack.push(a + b); - break; - - case "and": - b = stack.pop(); - a = stack.pop(); - - if ((0, _util.isBool)(a) && (0, _util.isBool)(b)) { - stack.push(a && b); - } else { - stack.push(a & b); - } - - break; - - case "atan": - a = stack.pop(); - stack.push(Math.atan(a)); - break; - - case "bitshift": - b = stack.pop(); - a = stack.pop(); - - if (a > 0) { - stack.push(a << b); - } else { - stack.push(a >> b); - } - - break; - - case "ceiling": - a = stack.pop(); - stack.push(Math.ceil(a)); - break; - - case "copy": - a = stack.pop(); - stack.copy(a); - break; - - case "cos": - a = stack.pop(); - stack.push(Math.cos(a)); - break; - - case "cvi": - a = stack.pop() | 0; - stack.push(a); - break; - - case "cvr": - break; - - case "div": - b = stack.pop(); - a = stack.pop(); - stack.push(a / b); - break; - - case "dup": - stack.copy(1); - break; - - case "eq": - b = stack.pop(); - a = stack.pop(); - stack.push(a === b); - break; - - case "exch": - stack.roll(2, 1); - break; - - case "exp": - b = stack.pop(); - a = stack.pop(); - stack.push(a ** b); - break; - - case "false": - stack.push(false); - break; - - case "floor": - a = stack.pop(); - stack.push(Math.floor(a)); - break; - - case "ge": - b = stack.pop(); - a = stack.pop(); - stack.push(a >= b); - break; - - case "gt": - b = stack.pop(); - a = stack.pop(); - stack.push(a > b); - break; - - case "idiv": - b = stack.pop(); - a = stack.pop(); - stack.push(a / b | 0); - break; - - case "index": - a = stack.pop(); - stack.index(a); - break; - - case "le": - b = stack.pop(); - a = stack.pop(); - stack.push(a <= b); - break; - - case "ln": - a = stack.pop(); - stack.push(Math.log(a)); - break; - - case "log": - a = stack.pop(); - stack.push(Math.log(a) / Math.LN10); - break; - - case "lt": - b = stack.pop(); - a = stack.pop(); - stack.push(a < b); - break; - - case "mod": - b = stack.pop(); - a = stack.pop(); - stack.push(a % b); - break; - - case "mul": - b = stack.pop(); - a = stack.pop(); - stack.push(a * b); - break; - - case "ne": - b = stack.pop(); - a = stack.pop(); - stack.push(a !== b); - break; - - case "neg": - a = stack.pop(); - stack.push(-a); - break; - - case "not": - a = stack.pop(); - - if ((0, _util.isBool)(a)) { - stack.push(!a); - } else { - stack.push(~a); - } - - break; - - case "or": - b = stack.pop(); - a = stack.pop(); - - if ((0, _util.isBool)(a) && (0, _util.isBool)(b)) { - stack.push(a || b); - } else { - stack.push(a | b); - } - - break; - - case "pop": - stack.pop(); - break; - - case "roll": - b = stack.pop(); - a = stack.pop(); - stack.roll(a, b); - break; - - case "round": - a = stack.pop(); - stack.push(Math.round(a)); - break; - - case "sin": - a = stack.pop(); - stack.push(Math.sin(a)); - break; - - case "sqrt": - a = stack.pop(); - stack.push(Math.sqrt(a)); - break; - - case "sub": - b = stack.pop(); - a = stack.pop(); - stack.push(a - b); - break; - - case "true": - stack.push(true); - break; - - case "truncate": - a = stack.pop(); - a = a < 0 ? Math.ceil(a) : Math.floor(a); - stack.push(a); - break; - - case "xor": - b = stack.pop(); - a = stack.pop(); - - if ((0, _util.isBool)(a) && (0, _util.isBool)(b)) { - stack.push(a !== b); - } else { - stack.push(a ^ b); - } - - break; - - default: - throw new _util.FormatError(`Unknown operator ${operator}`); - } - } - - return stack.stack; - } - }; - return PostScriptEvaluator; -}(); - -exports.PostScriptEvaluator = PostScriptEvaluator; - -var PostScriptCompiler = function PostScriptCompilerClosure() { - function AstNode(type) { - this.type = type; - } - - AstNode.prototype.visit = function (visitor) { - (0, _util.unreachable)("abstract method"); - }; - - function AstArgument(index, min, max) { - AstNode.call(this, "args"); - this.index = index; - this.min = min; - this.max = max; - } - - AstArgument.prototype = Object.create(AstNode.prototype); - - AstArgument.prototype.visit = function (visitor) { - visitor.visitArgument(this); - }; - - function AstLiteral(number) { - AstNode.call(this, "literal"); - this.number = number; - this.min = number; - this.max = number; - } - - AstLiteral.prototype = Object.create(AstNode.prototype); - - AstLiteral.prototype.visit = function (visitor) { - visitor.visitLiteral(this); - }; - - function AstBinaryOperation(op, arg1, arg2, min, max) { - AstNode.call(this, "binary"); - this.op = op; - this.arg1 = arg1; - this.arg2 = arg2; - this.min = min; - this.max = max; - } - - AstBinaryOperation.prototype = Object.create(AstNode.prototype); - - AstBinaryOperation.prototype.visit = function (visitor) { - visitor.visitBinaryOperation(this); - }; - - function AstMin(arg, max) { - AstNode.call(this, "max"); - this.arg = arg; - this.min = arg.min; - this.max = max; - } - - AstMin.prototype = Object.create(AstNode.prototype); - - AstMin.prototype.visit = function (visitor) { - visitor.visitMin(this); - }; - - function AstVariable(index, min, max) { - AstNode.call(this, "var"); - this.index = index; - this.min = min; - this.max = max; - } - - AstVariable.prototype = Object.create(AstNode.prototype); - - AstVariable.prototype.visit = function (visitor) { - visitor.visitVariable(this); - }; - - function AstVariableDefinition(variable, arg) { - AstNode.call(this, "definition"); - this.variable = variable; - this.arg = arg; - } - - AstVariableDefinition.prototype = Object.create(AstNode.prototype); - - AstVariableDefinition.prototype.visit = function (visitor) { - visitor.visitVariableDefinition(this); - }; - - function ExpressionBuilderVisitor() { - this.parts = []; - } - - ExpressionBuilderVisitor.prototype = { - visitArgument(arg) { - this.parts.push("Math.max(", arg.min, ", Math.min(", arg.max, ", src[srcOffset + ", arg.index, "]))"); - }, - - visitVariable(variable) { - this.parts.push("v", variable.index); - }, - - visitLiteral(literal) { - this.parts.push(literal.number); - }, - - visitBinaryOperation(operation) { - this.parts.push("("); - operation.arg1.visit(this); - this.parts.push(" ", operation.op, " "); - operation.arg2.visit(this); - this.parts.push(")"); - }, - - visitVariableDefinition(definition) { - this.parts.push("var "); - definition.variable.visit(this); - this.parts.push(" = "); - definition.arg.visit(this); - this.parts.push(";"); - }, - - visitMin(max) { - this.parts.push("Math.min("); - max.arg.visit(this); - this.parts.push(", ", max.max, ")"); - }, - - toString() { - return this.parts.join(""); - } - - }; - - function buildAddOperation(num1, num2) { - if (num2.type === "literal" && num2.number === 0) { - return num1; - } - - if (num1.type === "literal" && num1.number === 0) { - return num2; - } - - if (num2.type === "literal" && num1.type === "literal") { - return new AstLiteral(num1.number + num2.number); - } - - return new AstBinaryOperation("+", num1, num2, num1.min + num2.min, num1.max + num2.max); - } - - function buildMulOperation(num1, num2) { - if (num2.type === "literal") { - if (num2.number === 0) { - return new AstLiteral(0); - } else if (num2.number === 1) { - return num1; - } else if (num1.type === "literal") { - return new AstLiteral(num1.number * num2.number); - } - } - - if (num1.type === "literal") { - if (num1.number === 0) { - return new AstLiteral(0); - } else if (num1.number === 1) { - return num2; - } - } - - var min = Math.min(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max); - var max = Math.max(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max); - return new AstBinaryOperation("*", num1, num2, min, max); - } - - function buildSubOperation(num1, num2) { - if (num2.type === "literal") { - if (num2.number === 0) { - return num1; - } else if (num1.type === "literal") { - return new AstLiteral(num1.number - num2.number); - } - } - - if (num2.type === "binary" && num2.op === "-" && num1.type === "literal" && num1.number === 1 && num2.arg1.type === "literal" && num2.arg1.number === 1) { - return num2.arg2; - } - - return new AstBinaryOperation("-", num1, num2, num1.min - num2.max, num1.max - num2.min); - } - - function buildMinOperation(num1, max) { - if (num1.min >= max) { - return new AstLiteral(max); - } else if (num1.max <= max) { - return num1; - } - - return new AstMin(num1, max); - } - - function PostScriptCompiler() {} - - PostScriptCompiler.prototype = { - compile: function PostScriptCompiler_compile(code, domain, range) { - var stack = []; - var instructions = []; - var inputSize = domain.length >> 1, - outputSize = range.length >> 1; - var lastRegister = 0; - var n, j; - var num1, num2, ast1, ast2, tmpVar, item; - - for (let i = 0; i < inputSize; i++) { - stack.push(new AstArgument(i, domain[i * 2], domain[i * 2 + 1])); - } - - for (let i = 0, ii = code.length; i < ii; i++) { - item = code[i]; - - if (typeof item === "number") { - stack.push(new AstLiteral(item)); - continue; - } - - switch (item) { - case "add": - if (stack.length < 2) { - return null; - } - - num2 = stack.pop(); - num1 = stack.pop(); - stack.push(buildAddOperation(num1, num2)); - break; - - case "cvr": - if (stack.length < 1) { - return null; - } - - break; - - case "mul": - if (stack.length < 2) { - return null; - } - - num2 = stack.pop(); - num1 = stack.pop(); - stack.push(buildMulOperation(num1, num2)); - break; - - case "sub": - if (stack.length < 2) { - return null; - } - - num2 = stack.pop(); - num1 = stack.pop(); - stack.push(buildSubOperation(num1, num2)); - break; - - case "exch": - if (stack.length < 2) { - return null; - } - - ast1 = stack.pop(); - ast2 = stack.pop(); - stack.push(ast1, ast2); - break; - - case "pop": - if (stack.length < 1) { - return null; - } - - stack.pop(); - break; - - case "index": - if (stack.length < 1) { - return null; - } - - num1 = stack.pop(); - - if (num1.type !== "literal") { - return null; - } - - n = num1.number; - - if (n < 0 || !Number.isInteger(n) || stack.length < n) { - return null; - } - - ast1 = stack[stack.length - n - 1]; - - if (ast1.type === "literal" || ast1.type === "var") { - stack.push(ast1); - break; - } - - tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); - stack[stack.length - n - 1] = tmpVar; - stack.push(tmpVar); - instructions.push(new AstVariableDefinition(tmpVar, ast1)); - break; - - case "dup": - if (stack.length < 1) { - return null; - } - - if (typeof code[i + 1] === "number" && code[i + 2] === "gt" && code[i + 3] === i + 7 && code[i + 4] === "jz" && code[i + 5] === "pop" && code[i + 6] === code[i + 1]) { - num1 = stack.pop(); - stack.push(buildMinOperation(num1, code[i + 1])); - i += 6; - break; - } - - ast1 = stack[stack.length - 1]; - - if (ast1.type === "literal" || ast1.type === "var") { - stack.push(ast1); - break; - } - - tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); - stack[stack.length - 1] = tmpVar; - stack.push(tmpVar); - instructions.push(new AstVariableDefinition(tmpVar, ast1)); - break; - - case "roll": - if (stack.length < 2) { - return null; - } - - num2 = stack.pop(); - num1 = stack.pop(); - - if (num2.type !== "literal" || num1.type !== "literal") { - return null; - } - - j = num2.number; - n = num1.number; - - if (n <= 0 || !Number.isInteger(n) || !Number.isInteger(j) || stack.length < n) { - return null; - } - - j = (j % n + n) % n; - - if (j === 0) { - break; - } - - Array.prototype.push.apply(stack, stack.splice(stack.length - n, n - j)); - break; - - default: - return null; - } - } - - if (stack.length !== outputSize) { - return null; - } - - var result = []; - instructions.forEach(function (instruction) { - var statementBuilder = new ExpressionBuilderVisitor(); - instruction.visit(statementBuilder); - result.push(statementBuilder.toString()); - }); - stack.forEach(function (expr, i) { - var statementBuilder = new ExpressionBuilderVisitor(); - expr.visit(statementBuilder); - var min = range[i * 2], - max = range[i * 2 + 1]; - var out = [statementBuilder.toString()]; - - if (min > expr.min) { - out.unshift("Math.max(", min, ", "); - out.push(")"); - } - - if (max < expr.max) { - out.unshift("Math.min(", max, ", "); - out.push(")"); - } - - out.unshift("dest[destOffset + ", i, "] = "); - out.push(";"); - result.push(out.join("")); - }); - return result.join("\n"); - } - }; - return PostScriptCompiler; -}(); - -exports.PostScriptCompiler = PostScriptCompiler; - -/***/ }), -/* 42 */ -/***/ (function(module, exports, __w_pdfjs_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.PostScriptParser = exports.PostScriptLexer = void 0; - -var _util = __w_pdfjs_require__(2); - -var _primitives = __w_pdfjs_require__(5); - -var _core_utils = __w_pdfjs_require__(8); - -class PostScriptParser { - constructor(lexer) { - this.lexer = lexer; - this.operators = []; - this.token = null; - this.prev = null; - } - - nextToken() { - this.prev = this.token; - this.token = this.lexer.getToken(); - } - - accept(type) { - if (this.token.type === type) { - this.nextToken(); - return true; - } - - return false; - } - - expect(type) { - if (this.accept(type)) { - return true; - } - - throw new _util.FormatError(`Unexpected symbol: found ${this.token.type} expected ${type}.`); - } - - parse() { - this.nextToken(); - this.expect(PostScriptTokenTypes.LBRACE); - this.parseBlock(); - this.expect(PostScriptTokenTypes.RBRACE); - return this.operators; - } - - parseBlock() { - while (true) { - if (this.accept(PostScriptTokenTypes.NUMBER)) { - this.operators.push(this.prev.value); - } else if (this.accept(PostScriptTokenTypes.OPERATOR)) { - this.operators.push(this.prev.value); - } else if (this.accept(PostScriptTokenTypes.LBRACE)) { - this.parseCondition(); - } else { - return; - } - } - } - - parseCondition() { - const conditionLocation = this.operators.length; - this.operators.push(null, null); - this.parseBlock(); - this.expect(PostScriptTokenTypes.RBRACE); - - if (this.accept(PostScriptTokenTypes.IF)) { - this.operators[conditionLocation] = this.operators.length; - this.operators[conditionLocation + 1] = "jz"; - } else if (this.accept(PostScriptTokenTypes.LBRACE)) { - const jumpLocation = this.operators.length; - this.operators.push(null, null); - const endOfTrue = this.operators.length; - this.parseBlock(); - this.expect(PostScriptTokenTypes.RBRACE); - this.expect(PostScriptTokenTypes.IFELSE); - this.operators[jumpLocation] = this.operators.length; - this.operators[jumpLocation + 1] = "j"; - this.operators[conditionLocation] = endOfTrue; - this.operators[conditionLocation + 1] = "jz"; - } else { - throw new _util.FormatError("PS Function: error parsing conditional."); - } - } - -} - -exports.PostScriptParser = PostScriptParser; -const PostScriptTokenTypes = { - LBRACE: 0, - RBRACE: 1, - NUMBER: 2, - OPERATOR: 3, - IF: 4, - IFELSE: 5 -}; - -const PostScriptToken = function PostScriptTokenClosure() { - const opCache = Object.create(null); - - class PostScriptToken { - constructor(type, value) { - this.type = type; - this.value = value; - } - - static getOperator(op) { - const opValue = opCache[op]; - - if (opValue) { - return opValue; - } - - return opCache[op] = new PostScriptToken(PostScriptTokenTypes.OPERATOR, op); - } - - static get LBRACE() { - return (0, _util.shadow)(this, "LBRACE", new PostScriptToken(PostScriptTokenTypes.LBRACE, "{")); - } - - static get RBRACE() { - return (0, _util.shadow)(this, "RBRACE", new PostScriptToken(PostScriptTokenTypes.RBRACE, "}")); - } - - static get IF() { - return (0, _util.shadow)(this, "IF", new PostScriptToken(PostScriptTokenTypes.IF, "IF")); - } - - static get IFELSE() { - return (0, _util.shadow)(this, "IFELSE", new PostScriptToken(PostScriptTokenTypes.IFELSE, "IFELSE")); - } - - } - - return PostScriptToken; -}(); - -class PostScriptLexer { - constructor(stream) { - this.stream = stream; - this.nextChar(); - this.strBuf = []; - } - - nextChar() { - return this.currentChar = this.stream.getByte(); - } - - getToken() { - let comment = false; - let ch = this.currentChar; - - while (true) { - if (ch < 0) { - return _primitives.EOF; - } - - if (comment) { - if (ch === 0x0a || ch === 0x0d) { - comment = false; - } - } else if (ch === 0x25) { - comment = true; - } else if (!(0, _core_utils.isWhiteSpace)(ch)) { - break; - } - - ch = this.nextChar(); - } - - switch (ch | 0) { - case 0x30: - case 0x31: - case 0x32: - case 0x33: - case 0x34: - case 0x35: - case 0x36: - case 0x37: - case 0x38: - case 0x39: - case 0x2b: - case 0x2d: - case 0x2e: - return new PostScriptToken(PostScriptTokenTypes.NUMBER, this.getNumber()); - - case 0x7b: - this.nextChar(); - return PostScriptToken.LBRACE; - - case 0x7d: - this.nextChar(); - return PostScriptToken.RBRACE; - } - - const strBuf = this.strBuf; - strBuf.length = 0; - strBuf[0] = String.fromCharCode(ch); - - while ((ch = this.nextChar()) >= 0 && (ch >= 0x41 && ch <= 0x5a || ch >= 0x61 && ch <= 0x7a)) { - strBuf.push(String.fromCharCode(ch)); - } - - const str = strBuf.join(""); - - switch (str.toLowerCase()) { - case "if": - return PostScriptToken.IF; - - case "ifelse": - return PostScriptToken.IFELSE; - - default: - return PostScriptToken.getOperator(str); - } - } - - getNumber() { - let ch = this.currentChar; - const strBuf = this.strBuf; - strBuf.length = 0; - strBuf[0] = String.fromCharCode(ch); - - while ((ch = this.nextChar()) >= 0) { - if (ch >= 0x30 && ch <= 0x39 || ch === 0x2d || ch === 0x2e) { - strBuf.push(String.fromCharCode(ch)); - } else { - break; - } - } - - const value = parseFloat(strBuf.join("")); - - if (isNaN(value)) { - throw new _util.FormatError(`Invalid floating point number: ${value}`); - } - - return value; - } - -} - -exports.PostScriptLexer = PostScriptLexer; - -/***/ }), -/* 43 */ +/* 44 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -44645,7 +46305,7 @@ class MurmurHash3_64 { exports.MurmurHash3_64 = MurmurHash3_64; /***/ }), -/* 44 */ +/* 45 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -44668,58 +46328,58 @@ var _jpeg_stream = __w_pdfjs_require__(18); var _jpx = __w_pdfjs_require__(21); -var PDFImage = function PDFImageClosure() { - function decodeAndClamp(value, addend, coefficient, max) { - value = addend + value * coefficient; - - if (value < 0) { - value = 0; - } else if (value > max) { - value = max; - } +function decodeAndClamp(value, addend, coefficient, max) { + value = addend + value * coefficient; - return value; + if (value < 0) { + value = 0; + } else if (value > max) { + value = max; } - function resizeImageMask(src, bpc, w1, h1, w2, h2) { - var length = w2 * h2; - let dest; + return value; +} - if (bpc <= 8) { - dest = new Uint8Array(length); - } else if (bpc <= 16) { - dest = new Uint16Array(length); - } else { - dest = new Uint32Array(length); - } +function resizeImageMask(src, bpc, w1, h1, w2, h2) { + var length = w2 * h2; + let dest; - var xRatio = w1 / w2; - var yRatio = h1 / h2; - var i, - j, - py, - newIndex = 0, - oldIndex; - var xScaled = new Uint16Array(w2); - var w1Scanline = w1; + if (bpc <= 8) { + dest = new Uint8Array(length); + } else if (bpc <= 16) { + dest = new Uint16Array(length); + } else { + dest = new Uint32Array(length); + } - for (i = 0; i < w2; i++) { - xScaled[i] = Math.floor(i * xRatio); - } + var xRatio = w1 / w2; + var yRatio = h1 / h2; + var i, + j, + py, + newIndex = 0, + oldIndex; + var xScaled = new Uint16Array(w2); + var w1Scanline = w1; - for (i = 0; i < h2; i++) { - py = Math.floor(i * yRatio) * w1Scanline; + for (i = 0; i < w2; i++) { + xScaled[i] = Math.floor(i * xRatio); + } - for (j = 0; j < w2; j++) { - oldIndex = py + xScaled[j]; - dest[newIndex++] = src[oldIndex]; - } - } + for (i = 0; i < h2; i++) { + py = Math.floor(i * yRatio) * w1Scanline; - return dest; + for (j = 0; j < w2; j++) { + oldIndex = py + xScaled[j]; + dest[newIndex++] = src[oldIndex]; + } } - function PDFImage({ + return dest; +} + +class PDFImage { + constructor({ xref, res, image, @@ -44727,7 +46387,8 @@ var PDFImage = function PDFImageClosure() { smask = null, mask = null, isMask = false, - pdfFunctionFactory + pdfFunctionFactory, + localColorSpaceCache }) { this.image = image; var dict = image.dict; @@ -44787,7 +46448,7 @@ var PDFImage = function PDFImageClosure() { this.bpc = bitsPerComponent; if (!this.imageMask) { - var colorSpace = dict.get("ColorSpace", "CS"); + let colorSpace = dict.getRaw("ColorSpace") || dict.getRaw("CS"); if (!colorSpace) { (0, _util.info)("JPX images (which do not require color spaces)"); @@ -44810,8 +46471,13 @@ var PDFImage = function PDFImageClosure() { } } - const resources = isInline ? res : null; - this.colorSpace = _colorspace.ColorSpace.parse(colorSpace, xref, resources, pdfFunctionFactory); + this.colorSpace = _colorspace.ColorSpace.parse({ + cs: colorSpace, + xref, + resources: isInline ? res : null, + pdfFunctionFactory, + localColorSpaceCache + }); this.numComps = this.colorSpace.numComps; } @@ -44839,7 +46505,8 @@ var PDFImage = function PDFImageClosure() { res, image: smask, isInline, - pdfFunctionFactory + pdfFunctionFactory, + localColorSpaceCache }); } else if (mask) { if ((0, _primitives.isStream)(mask)) { @@ -44855,7 +46522,8 @@ var PDFImage = function PDFImageClosure() { image: mask, isInline, isMask: true, - pdfFunctionFactory + pdfFunctionFactory, + localColorSpaceCache }); } } else { @@ -44864,12 +46532,13 @@ var PDFImage = function PDFImageClosure() { } } - PDFImage.buildImage = function ({ + static async buildImage({ xref, res, image, isInline = false, - pdfFunctionFactory + pdfFunctionFactory, + localColorSpaceCache }) { const imageData = image; let smaskData = null; @@ -44887,18 +46556,19 @@ var PDFImage = function PDFImageClosure() { } } - return Promise.resolve(new PDFImage({ + return new PDFImage({ xref, res, image: imageData, isInline, smask: smaskData, mask: maskData, - pdfFunctionFactory - })); - }; + pdfFunctionFactory, + localColorSpaceCache + }); + } - PDFImage.createMask = function ({ + static createMask({ imgArray, width, height, @@ -44935,384 +46605,381 @@ var PDFImage = function PDFImageClosure() { width, height }; - }; - - PDFImage.prototype = { - get drawWidth() { - return Math.max(this.width, this.smask && this.smask.width || 0, this.mask && this.mask.width || 0); - }, + } - get drawHeight() { - return Math.max(this.height, this.smask && this.smask.height || 0, this.mask && this.mask.height || 0); - }, + get drawWidth() { + return Math.max(this.width, this.smask && this.smask.width || 0, this.mask && this.mask.width || 0); + } - decodeBuffer(buffer) { - var bpc = this.bpc; - var numComps = this.numComps; - var decodeAddends = this.decodeAddends; - var decodeCoefficients = this.decodeCoefficients; - var max = (1 << bpc) - 1; - var i, ii; + get drawHeight() { + return Math.max(this.height, this.smask && this.smask.height || 0, this.mask && this.mask.height || 0); + } - if (bpc === 1) { - for (i = 0, ii = buffer.length; i < ii; i++) { - buffer[i] = +!buffer[i]; - } + decodeBuffer(buffer) { + var bpc = this.bpc; + var numComps = this.numComps; + var decodeAddends = this.decodeAddends; + var decodeCoefficients = this.decodeCoefficients; + var max = (1 << bpc) - 1; + var i, ii; - return; + if (bpc === 1) { + for (i = 0, ii = buffer.length; i < ii; i++) { + buffer[i] = +!buffer[i]; } - var index = 0; - - for (i = 0, ii = this.width * this.height; i < ii; i++) { - for (var j = 0; j < numComps; j++) { - buffer[index] = decodeAndClamp(buffer[index], decodeAddends[j], decodeCoefficients[j], max); - index++; - } - } - }, + return; + } - getComponents(buffer) { - var bpc = this.bpc; + var index = 0; - if (bpc === 8) { - return buffer; + for (i = 0, ii = this.width * this.height; i < ii; i++) { + for (var j = 0; j < numComps; j++) { + buffer[index] = decodeAndClamp(buffer[index], decodeAddends[j], decodeCoefficients[j], max); + index++; } + } + } - var width = this.width; - var height = this.height; - var numComps = this.numComps; - var length = width * height * numComps; - var bufferPos = 0; - let output; + getComponents(buffer) { + var bpc = this.bpc; - if (bpc <= 8) { - output = new Uint8Array(length); - } else if (bpc <= 16) { - output = new Uint16Array(length); - } else { - output = new Uint32Array(length); - } + if (bpc === 8) { + return buffer; + } - var rowComps = width * numComps; - var max = (1 << bpc) - 1; - var i = 0, - ii, - buf; - - if (bpc === 1) { - var mask, loop1End, loop2End; - - for (var j = 0; j < height; j++) { - loop1End = i + (rowComps & ~7); - loop2End = i + rowComps; - - while (i < loop1End) { - buf = buffer[bufferPos++]; - output[i] = buf >> 7 & 1; - output[i + 1] = buf >> 6 & 1; - output[i + 2] = buf >> 5 & 1; - output[i + 3] = buf >> 4 & 1; - output[i + 4] = buf >> 3 & 1; - output[i + 5] = buf >> 2 & 1; - output[i + 6] = buf >> 1 & 1; - output[i + 7] = buf & 1; - i += 8; - } - - if (i < loop2End) { - buf = buffer[bufferPos++]; - mask = 128; - - while (i < loop2End) { - output[i++] = +!!(buf & mask); - mask >>= 1; - } - } + var width = this.width; + var height = this.height; + var numComps = this.numComps; + var length = width * height * numComps; + var bufferPos = 0; + let output; + + if (bpc <= 8) { + output = new Uint8Array(length); + } else if (bpc <= 16) { + output = new Uint16Array(length); + } else { + output = new Uint32Array(length); + } + + var rowComps = width * numComps; + var max = (1 << bpc) - 1; + var i = 0, + ii, + buf; + + if (bpc === 1) { + var mask, loop1End, loop2End; + + for (var j = 0; j < height; j++) { + loop1End = i + (rowComps & ~7); + loop2End = i + rowComps; + + while (i < loop1End) { + buf = buffer[bufferPos++]; + output[i] = buf >> 7 & 1; + output[i + 1] = buf >> 6 & 1; + output[i + 2] = buf >> 5 & 1; + output[i + 3] = buf >> 4 & 1; + output[i + 4] = buf >> 3 & 1; + output[i + 5] = buf >> 2 & 1; + output[i + 6] = buf >> 1 & 1; + output[i + 7] = buf & 1; + i += 8; } - } else { - var bits = 0; - buf = 0; - for (i = 0, ii = length; i < ii; ++i) { - if (i % rowComps === 0) { - buf = 0; - bits = 0; - } + if (i < loop2End) { + buf = buffer[bufferPos++]; + mask = 128; - while (bits < bpc) { - buf = buf << 8 | buffer[bufferPos++]; - bits += 8; + while (i < loop2End) { + output[i++] = +!!(buf & mask); + mask >>= 1; } + } + } + } else { + var bits = 0; + buf = 0; - var remainingBits = bits - bpc; - let value = buf >> remainingBits; + for (i = 0, ii = length; i < ii; ++i) { + if (i % rowComps === 0) { + buf = 0; + bits = 0; + } - if (value < 0) { - value = 0; - } else if (value > max) { - value = max; - } + while (bits < bpc) { + buf = buf << 8 | buffer[bufferPos++]; + bits += 8; + } - output[i] = value; - buf = buf & (1 << remainingBits) - 1; - bits = remainingBits; + var remainingBits = bits - bpc; + let value = buf >> remainingBits; + + if (value < 0) { + value = 0; + } else if (value > max) { + value = max; } + + output[i] = value; + buf = buf & (1 << remainingBits) - 1; + bits = remainingBits; } + } - return output; - }, + return output; + } - fillOpacity(rgbaBuf, width, height, actualHeight, image) { - var smask = this.smask; - var mask = this.mask; - var alphaBuf, sw, sh, i, ii, j; + fillOpacity(rgbaBuf, width, height, actualHeight, image) { + var smask = this.smask; + var mask = this.mask; + var alphaBuf, sw, sh, i, ii, j; + + if (smask) { + sw = smask.width; + sh = smask.height; + alphaBuf = new Uint8ClampedArray(sw * sh); + smask.fillGrayBuffer(alphaBuf); - if (smask) { - sw = smask.width; - sh = smask.height; + if (sw !== width || sh !== height) { + alphaBuf = resizeImageMask(alphaBuf, smask.bpc, sw, sh, width, height); + } + } else if (mask) { + if (mask instanceof PDFImage) { + sw = mask.width; + sh = mask.height; alphaBuf = new Uint8ClampedArray(sw * sh); - smask.fillGrayBuffer(alphaBuf); + mask.numComps = 1; + mask.fillGrayBuffer(alphaBuf); - if (sw !== width || sh !== height) { - alphaBuf = resizeImageMask(alphaBuf, smask.bpc, sw, sh, width, height); + for (i = 0, ii = sw * sh; i < ii; ++i) { + alphaBuf[i] = 255 - alphaBuf[i]; } - } else if (mask) { - if (mask instanceof PDFImage) { - sw = mask.width; - sh = mask.height; - alphaBuf = new Uint8ClampedArray(sw * sh); - mask.numComps = 1; - mask.fillGrayBuffer(alphaBuf); - for (i = 0, ii = sw * sh; i < ii; ++i) { - alphaBuf[i] = 255 - alphaBuf[i]; - } - - if (sw !== width || sh !== height) { - alphaBuf = resizeImageMask(alphaBuf, mask.bpc, sw, sh, width, height); - } - } else if (Array.isArray(mask)) { - alphaBuf = new Uint8ClampedArray(width * height); - var numComps = this.numComps; + if (sw !== width || sh !== height) { + alphaBuf = resizeImageMask(alphaBuf, mask.bpc, sw, sh, width, height); + } + } else if (Array.isArray(mask)) { + alphaBuf = new Uint8ClampedArray(width * height); + var numComps = this.numComps; - for (i = 0, ii = width * height; i < ii; ++i) { - var opacity = 0; - var imageOffset = i * numComps; + for (i = 0, ii = width * height; i < ii; ++i) { + var opacity = 0; + var imageOffset = i * numComps; - for (j = 0; j < numComps; ++j) { - var color = image[imageOffset + j]; - var maskOffset = j * 2; + for (j = 0; j < numComps; ++j) { + var color = image[imageOffset + j]; + var maskOffset = j * 2; - if (color < mask[maskOffset] || color > mask[maskOffset + 1]) { - opacity = 255; - break; - } + if (color < mask[maskOffset] || color > mask[maskOffset + 1]) { + opacity = 255; + break; } - - alphaBuf[i] = opacity; } - } else { - throw new _util.FormatError("Unknown mask format."); - } - } - if (alphaBuf) { - for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { - rgbaBuf[j] = alphaBuf[i]; + alphaBuf[i] = opacity; } } else { - for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { - rgbaBuf[j] = 255; - } + throw new _util.FormatError("Unknown mask format."); } - }, - - undoPreblend(buffer, width, height) { - var matte = this.smask && this.smask.matte; + } - if (!matte) { - return; + if (alphaBuf) { + for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { + rgbaBuf[j] = alphaBuf[i]; } + } else { + for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { + rgbaBuf[j] = 255; + } + } + } - var matteRgb = this.colorSpace.getRgb(matte, 0); - var matteR = matteRgb[0]; - var matteG = matteRgb[1]; - var matteB = matteRgb[2]; - var length = width * height * 4; - - for (var i = 0; i < length; i += 4) { - var alpha = buffer[i + 3]; + undoPreblend(buffer, width, height) { + var matte = this.smask && this.smask.matte; - if (alpha === 0) { - buffer[i] = 255; - buffer[i + 1] = 255; - buffer[i + 2] = 255; - continue; - } + if (!matte) { + return; + } - var k = 255 / alpha; - buffer[i] = (buffer[i] - matteR) * k + matteR; - buffer[i + 1] = (buffer[i + 1] - matteG) * k + matteG; - buffer[i + 2] = (buffer[i + 2] - matteB) * k + matteB; - } - }, + var matteRgb = this.colorSpace.getRgb(matte, 0); + var matteR = matteRgb[0]; + var matteG = matteRgb[1]; + var matteB = matteRgb[2]; + var length = width * height * 4; - createImageData(forceRGBA = false) { - var drawWidth = this.drawWidth; - var drawHeight = this.drawHeight; - var imgData = { - width: drawWidth, - height: drawHeight, - kind: 0, - data: null - }; - var numComps = this.numComps; - var originalWidth = this.width; - var originalHeight = this.height; - var bpc = this.bpc; - var rowBytes = originalWidth * numComps * bpc + 7 >> 3; - var imgArray; + for (var i = 0; i < length; i += 4) { + var alpha = buffer[i + 3]; - if (!forceRGBA) { - var kind; + if (alpha === 0) { + buffer[i] = 255; + buffer[i + 1] = 255; + buffer[i + 2] = 255; + continue; + } - if (this.colorSpace.name === "DeviceGray" && bpc === 1) { - kind = _util.ImageKind.GRAYSCALE_1BPP; - } else if (this.colorSpace.name === "DeviceRGB" && bpc === 8 && !this.needsDecode) { - kind = _util.ImageKind.RGB_24BPP; - } + var k = 255 / alpha; + buffer[i] = (buffer[i] - matteR) * k + matteR; + buffer[i + 1] = (buffer[i + 1] - matteG) * k + matteG; + buffer[i + 2] = (buffer[i + 2] - matteB) * k + matteB; + } + } - if (kind && !this.smask && !this.mask && drawWidth === originalWidth && drawHeight === originalHeight) { - imgData.kind = kind; - imgArray = this.getImageBytes(originalHeight * rowBytes); + createImageData(forceRGBA = false) { + var drawWidth = this.drawWidth; + var drawHeight = this.drawHeight; + var imgData = { + width: drawWidth, + height: drawHeight, + kind: 0, + data: null + }; + var numComps = this.numComps; + var originalWidth = this.width; + var originalHeight = this.height; + var bpc = this.bpc; + var rowBytes = originalWidth * numComps * bpc + 7 >> 3; + var imgArray; - if (this.image instanceof _stream.DecodeStream) { - imgData.data = imgArray; - } else { - var newArray = new Uint8ClampedArray(imgArray.length); - newArray.set(imgArray); - imgData.data = newArray; - } + if (!forceRGBA) { + var kind; - if (this.needsDecode) { - (0, _util.assert)(kind === _util.ImageKind.GRAYSCALE_1BPP, "PDFImage.createImageData: The image must be grayscale."); - var buffer = imgData.data; + if (this.colorSpace.name === "DeviceGray" && bpc === 1) { + kind = _util.ImageKind.GRAYSCALE_1BPP; + } else if (this.colorSpace.name === "DeviceRGB" && bpc === 8 && !this.needsDecode) { + kind = _util.ImageKind.RGB_24BPP; + } - for (var i = 0, ii = buffer.length; i < ii; i++) { - buffer[i] ^= 0xff; - } - } + if (kind && !this.smask && !this.mask && drawWidth === originalWidth && drawHeight === originalHeight) { + imgData.kind = kind; + imgArray = this.getImageBytes(originalHeight * rowBytes); - return imgData; + if (this.image instanceof _stream.DecodeStream) { + imgData.data = imgArray; + } else { + var newArray = new Uint8ClampedArray(imgArray.length); + newArray.set(imgArray); + imgData.data = newArray; } - if (this.image instanceof _jpeg_stream.JpegStream && !this.smask && !this.mask) { - let imageLength = originalHeight * rowBytes; - - switch (this.colorSpace.name) { - case "DeviceGray": - imageLength *= 3; + if (this.needsDecode) { + (0, _util.assert)(kind === _util.ImageKind.GRAYSCALE_1BPP, "PDFImage.createImageData: The image must be grayscale."); + var buffer = imgData.data; - case "DeviceRGB": - case "DeviceCMYK": - imgData.kind = _util.ImageKind.RGB_24BPP; - imgData.data = this.getImageBytes(imageLength, drawWidth, drawHeight, true); - return imgData; + for (var i = 0, ii = buffer.length; i < ii; i++) { + buffer[i] ^= 0xff; } } + + return imgData; } - imgArray = this.getImageBytes(originalHeight * rowBytes); - var actualHeight = 0 | imgArray.length / rowBytes * drawHeight / originalHeight; - var comps = this.getComponents(imgArray); - var alpha01, maybeUndoPreblend; + if (this.image instanceof _jpeg_stream.JpegStream && !this.smask && !this.mask) { + let imageLength = originalHeight * rowBytes; - if (!forceRGBA && !this.smask && !this.mask) { - imgData.kind = _util.ImageKind.RGB_24BPP; - imgData.data = new Uint8ClampedArray(drawWidth * drawHeight * 3); - alpha01 = 0; - maybeUndoPreblend = false; - } else { - imgData.kind = _util.ImageKind.RGBA_32BPP; - imgData.data = new Uint8ClampedArray(drawWidth * drawHeight * 4); - alpha01 = 1; - maybeUndoPreblend = true; - this.fillOpacity(imgData.data, drawWidth, drawHeight, actualHeight, comps); - } + switch (this.colorSpace.name) { + case "DeviceGray": + imageLength *= 3; - if (this.needsDecode) { - this.decodeBuffer(comps); + case "DeviceRGB": + case "DeviceCMYK": + imgData.kind = _util.ImageKind.RGB_24BPP; + imgData.data = this.getImageBytes(imageLength, drawWidth, drawHeight, true); + return imgData; + } } + } - this.colorSpace.fillRgb(imgData.data, originalWidth, originalHeight, drawWidth, drawHeight, actualHeight, bpc, comps, alpha01); + imgArray = this.getImageBytes(originalHeight * rowBytes); + var actualHeight = 0 | imgArray.length / rowBytes * drawHeight / originalHeight; + var comps = this.getComponents(imgArray); + var alpha01, maybeUndoPreblend; - if (maybeUndoPreblend) { - this.undoPreblend(imgData.data, drawWidth, actualHeight); - } + if (!forceRGBA && !this.smask && !this.mask) { + imgData.kind = _util.ImageKind.RGB_24BPP; + imgData.data = new Uint8ClampedArray(drawWidth * drawHeight * 3); + alpha01 = 0; + maybeUndoPreblend = false; + } else { + imgData.kind = _util.ImageKind.RGBA_32BPP; + imgData.data = new Uint8ClampedArray(drawWidth * drawHeight * 4); + alpha01 = 1; + maybeUndoPreblend = true; + this.fillOpacity(imgData.data, drawWidth, drawHeight, actualHeight, comps); + } - return imgData; - }, + if (this.needsDecode) { + this.decodeBuffer(comps); + } - fillGrayBuffer(buffer) { - var numComps = this.numComps; + this.colorSpace.fillRgb(imgData.data, originalWidth, originalHeight, drawWidth, drawHeight, actualHeight, bpc, comps, alpha01); - if (numComps !== 1) { - throw new _util.FormatError(`Reading gray scale from a color image: ${numComps}`); - } + if (maybeUndoPreblend) { + this.undoPreblend(imgData.data, drawWidth, actualHeight); + } - var width = this.width; - var height = this.height; - var bpc = this.bpc; - var rowBytes = width * numComps * bpc + 7 >> 3; - var imgArray = this.getImageBytes(height * rowBytes); - var comps = this.getComponents(imgArray); - var i, length; + return imgData; + } - if (bpc === 1) { - length = width * height; + fillGrayBuffer(buffer) { + var numComps = this.numComps; - if (this.needsDecode) { - for (i = 0; i < length; ++i) { - buffer[i] = comps[i] - 1 & 255; - } - } else { - for (i = 0; i < length; ++i) { - buffer[i] = -comps[i] & 255; - } - } + if (numComps !== 1) { + throw new _util.FormatError(`Reading gray scale from a color image: ${numComps}`); + } - return; - } + var width = this.width; + var height = this.height; + var bpc = this.bpc; + var rowBytes = width * numComps * bpc + 7 >> 3; + var imgArray = this.getImageBytes(height * rowBytes); + var comps = this.getComponents(imgArray); + var i, length; + + if (bpc === 1) { + length = width * height; if (this.needsDecode) { - this.decodeBuffer(comps); + for (i = 0; i < length; ++i) { + buffer[i] = comps[i] - 1 & 255; + } + } else { + for (i = 0; i < length; ++i) { + buffer[i] = -comps[i] & 255; + } } - length = width * height; - var scale = 255 / ((1 << bpc) - 1); + return; + } - for (i = 0; i < length; ++i) { - buffer[i] = scale * comps[i]; - } - }, + if (this.needsDecode) { + this.decodeBuffer(comps); + } + + length = width * height; + var scale = 255 / ((1 << bpc) - 1); - getImageBytes(length, drawWidth, drawHeight, forceRGB = false) { - this.image.reset(); - this.image.drawWidth = drawWidth || this.width; - this.image.drawHeight = drawHeight || this.height; - this.image.forceRGB = !!forceRGB; - return this.image.getBytes(length, true); + for (i = 0; i < length; ++i) { + buffer[i] = scale * comps[i]; } + } - }; - return PDFImage; -}(); + getImageBytes(length, drawWidth, drawHeight, forceRGB = false) { + this.image.reset(); + this.image.drawWidth = drawWidth || this.width; + this.image.drawHeight = drawHeight || this.height; + this.image.forceRGB = !!forceRGB; + return this.image.getBytes(length, true); + } + +} exports.PDFImage = PDFImage; /***/ }), -/* 45 */ +/* 46 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -45813,7 +47480,7 @@ class MessageHandler { exports.MessageHandler = MessageHandler; /***/ }), -/* 46 */ +/* 47 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; diff --git a/third-party/pdfjs/pdfjs.gresource.xml b/third-party/pdfjs/pdfjs.gresource.xml index 7788e8752..36708560c 100644 --- a/third-party/pdfjs/pdfjs.gresource.xml +++ b/third-party/pdfjs/pdfjs.gresource.xml @@ -1,13 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> <gresources> <gresource prefix="/org/gnome/epiphany/pdfjs"> - <file compressed="true">build/pdf.js</file> - <file compressed="true">build/pdf.worker.js</file> - <file compressed="true">web/viewer.html</file> - <file compressed="true">web/viewer.css</file> - <file compressed="true">web/viewer.js</file> <file compressed="true">web/compressed.tracemonkey-pldi-09.pdf</file> <file compressed="true">web/debugger.js</file> + <file compressed="true">web/viewer.js</file> + <file compressed="true">web/viewer.css</file> + <file compressed="true">web/viewer.html</file> <file compressed="true">web/cmaps/78-EUC-H.bcmap</file> <file compressed="true">web/cmaps/78-EUC-V.bcmap</file> <file compressed="true">web/cmaps/78-H.bcmap</file> @@ -186,79 +184,80 @@ <file compressed="true">web/images/annotation-noicon.svg</file> <file compressed="true">web/images/annotation-note.svg</file> <file compressed="true">web/images/annotation-paragraph.svg</file> - <file compressed="true">web/images/findbarButton-next.png</file> - <file compressed="true">web/images/findbarButton-next@2x.png</file> - <file compressed="true">web/images/findbarButton-previous.png</file> - <file compressed="true">web/images/findbarButton-previous@2x.png</file> + <file compressed="true">web/images/findbarButton-next-dark.svg</file> + <file compressed="true">web/images/findbarButton-next.svg</file> + <file compressed="true">web/images/findbarButton-previous-dark.svg</file> + <file compressed="true">web/images/findbarButton-previous.svg</file> <file compressed="true">web/images/grab.cur</file> <file compressed="true">web/images/grabbing.cur</file> + <file compressed="true">web/images/loading-dark.svg</file> <file compressed="true">web/images/loading-icon.gif</file> - <file compressed="true">web/images/loading-small.png</file> - <file compressed="true">web/images/loading-small@2x.png</file> - <file compressed="true">web/images/secondaryToolbarButton-documentProperties.png</file> - <file compressed="true">web/images/secondaryToolbarButton-documentProperties@2x.png</file> - <file compressed="true">web/images/secondaryToolbarButton-firstPage.png</file> - <file compressed="true">web/images/secondaryToolbarButton-firstPage@2x.png</file> - <file compressed="true">web/images/secondaryToolbarButton-handTool.png</file> - <file compressed="true">web/images/secondaryToolbarButton-handTool@2x.png</file> - <file compressed="true">web/images/secondaryToolbarButton-lastPage.png</file> - <file compressed="true">web/images/secondaryToolbarButton-lastPage@2x.png</file> - <file compressed="true">web/images/secondaryToolbarButton-rotateCcw.png</file> - <file compressed="true">web/images/secondaryToolbarButton-rotateCcw@2x.png</file> - <file compressed="true">web/images/secondaryToolbarButton-rotateCw.png</file> - <file compressed="true">web/images/secondaryToolbarButton-rotateCw@2x.png</file> - <file compressed="true">web/images/secondaryToolbarButton-scrollHorizontal.png</file> - <file compressed="true">web/images/secondaryToolbarButton-scrollHorizontal@2x.png</file> - <file compressed="true">web/images/secondaryToolbarButton-scrollVertical.png</file> - <file compressed="true">web/images/secondaryToolbarButton-scrollVertical@2x.png</file> - <file compressed="true">web/images/secondaryToolbarButton-scrollWrapped.png</file> - <file compressed="true">web/images/secondaryToolbarButton-scrollWrapped@2x.png</file> - <file compressed="true">web/images/secondaryToolbarButton-selectTool.png</file> - <file compressed="true">web/images/secondaryToolbarButton-selectTool@2x.png</file> - <file compressed="true">web/images/secondaryToolbarButton-spreadEven.png</file> - <file compressed="true">web/images/secondaryToolbarButton-spreadEven@2x.png</file> - <file compressed="true">web/images/secondaryToolbarButton-spreadNone.png</file> - <file compressed="true">web/images/secondaryToolbarButton-spreadNone@2x.png</file> - <file compressed="true">web/images/secondaryToolbarButton-spreadOdd.png</file> - <file compressed="true">web/images/secondaryToolbarButton-spreadOdd@2x.png</file> + <file compressed="true">web/images/loading.svg</file> + <file compressed="true">web/images/secondaryToolbarButton-documentProperties-dark.svg</file> + <file compressed="true">web/images/secondaryToolbarButton-documentProperties.svg</file> + <file compressed="true">web/images/secondaryToolbarButton-firstPage-dark.svg</file> + <file compressed="true">web/images/secondaryToolbarButton-firstPage.svg</file> + <file compressed="true">web/images/secondaryToolbarButton-handTool-dark.svg</file> + <file compressed="true">web/images/secondaryToolbarButton-handTool.svg</file> + <file compressed="true">web/images/secondaryToolbarButton-lastPage-dark.svg</file> + <file compressed="true">web/images/secondaryToolbarButton-lastPage.svg</file> + <file compressed="true">web/images/secondaryToolbarButton-rotateCcw-dark.svg</file> + <file compressed="true">web/images/secondaryToolbarButton-rotateCcw.svg</file> + <file compressed="true">web/images/secondaryToolbarButton-rotateCw-dark.svg</file> + <file compressed="true">web/images/secondaryToolbarButton-rotateCw.svg</file> + <file compressed="true">web/images/secondaryToolbarButton-scrollHorizontal-dark.svg</file> + <file compressed="true">web/images/secondaryToolbarButton-scrollHorizontal.svg</file> + <file compressed="true">web/images/secondaryToolbarButton-scrollVertical-dark.svg</file> + <file compressed="true">web/images/secondaryToolbarButton-scrollVertical.svg</file> + <file compressed="true">web/images/secondaryToolbarButton-scrollWrapped-dark.svg</file> + <file compressed="true">web/images/secondaryToolbarButton-scrollWrapped.svg</file> + <file compressed="true">web/images/secondaryToolbarButton-selectTool-dark.svg</file> + <file compressed="true">web/images/secondaryToolbarButton-selectTool.svg</file> + <file compressed="true">web/images/secondaryToolbarButton-spreadEven-dark.svg</file> + <file compressed="true">web/images/secondaryToolbarButton-spreadEven.svg</file> + <file compressed="true">web/images/secondaryToolbarButton-spreadNone-dark.svg</file> + <file compressed="true">web/images/secondaryToolbarButton-spreadNone.svg</file> + <file compressed="true">web/images/secondaryToolbarButton-spreadOdd-dark.svg</file> + <file compressed="true">web/images/secondaryToolbarButton-spreadOdd.svg</file> <file compressed="true">web/images/shadow.png</file> - <file compressed="true">web/images/texture.png</file> - <file compressed="true">web/images/toolbarButton-bookmark.png</file> - <file compressed="true">web/images/toolbarButton-bookmark@2x.png</file> - <file compressed="true">web/images/toolbarButton-download.png</file> - <file compressed="true">web/images/toolbarButton-download@2x.png</file> - <file compressed="true">web/images/toolbarButton-menuArrows.png</file> - <file compressed="true">web/images/toolbarButton-menuArrows@2x.png</file> - <file compressed="true">web/images/toolbarButton-openFile.png</file> - <file compressed="true">web/images/toolbarButton-openFile@2x.png</file> - <file compressed="true">web/images/toolbarButton-pageDown.png</file> - <file compressed="true">web/images/toolbarButton-pageDown@2x.png</file> - <file compressed="true">web/images/toolbarButton-pageUp.png</file> - <file compressed="true">web/images/toolbarButton-pageUp@2x.png</file> - <file compressed="true">web/images/toolbarButton-presentationMode.png</file> - <file compressed="true">web/images/toolbarButton-presentationMode@2x.png</file> - <file compressed="true">web/images/toolbarButton-print.png</file> - <file compressed="true">web/images/toolbarButton-print@2x.png</file> - <file compressed="true">web/images/toolbarButton-search.png</file> - <file compressed="true">web/images/toolbarButton-search@2x.png</file> - <file compressed="true">web/images/toolbarButton-secondaryToolbarToggle.png</file> - <file compressed="true">web/images/toolbarButton-secondaryToolbarToggle@2x.png</file> - <file compressed="true">web/images/toolbarButton-sidebarToggle.png</file> - <file compressed="true">web/images/toolbarButton-sidebarToggle@2x.png</file> - <file compressed="true">web/images/toolbarButton-viewAttachments.png</file> - <file compressed="true">web/images/toolbarButton-viewAttachments@2x.png</file> - <file compressed="true">web/images/toolbarButton-viewOutline.png</file> - <file compressed="true">web/images/toolbarButton-viewOutline@2x.png</file> - <file compressed="true">web/images/toolbarButton-viewThumbnail.png</file> - <file compressed="true">web/images/toolbarButton-viewThumbnail@2x.png</file> - <file compressed="true">web/images/toolbarButton-zoomIn.png</file> - <file compressed="true">web/images/toolbarButton-zoomIn@2x.png</file> - <file compressed="true">web/images/toolbarButton-zoomOut.png</file> - <file compressed="true">web/images/toolbarButton-zoomOut@2x.png</file> - <file compressed="true">web/images/treeitem-collapsed.png</file> - <file compressed="true">web/images/treeitem-collapsed@2x.png</file> - <file compressed="true">web/images/treeitem-expanded.png</file> - <file compressed="true">web/images/treeitem-expanded@2x.png</file> + <file compressed="true">web/images/toolbarButton-bookmark-dark.svg</file> + <file compressed="true">web/images/toolbarButton-bookmark.svg</file> + <file compressed="true">web/images/toolbarButton-download-dark.svg</file> + <file compressed="true">web/images/toolbarButton-download.svg</file> + <file compressed="true">web/images/toolbarButton-menuArrow-dark.svg</file> + <file compressed="true">web/images/toolbarButton-menuArrow.svg</file> + <file compressed="true">web/images/toolbarButton-openFile-dark.svg</file> + <file compressed="true">web/images/toolbarButton-openFile.svg</file> + <file compressed="true">web/images/toolbarButton-pageDown-dark.svg</file> + <file compressed="true">web/images/toolbarButton-pageDown.svg</file> + <file compressed="true">web/images/toolbarButton-pageUp-dark.svg</file> + <file compressed="true">web/images/toolbarButton-pageUp.svg</file> + <file compressed="true">web/images/toolbarButton-presentationMode-dark.svg</file> + <file compressed="true">web/images/toolbarButton-presentationMode.svg</file> + <file compressed="true">web/images/toolbarButton-print-dark.svg</file> + <file compressed="true">web/images/toolbarButton-print.svg</file> + <file compressed="true">web/images/toolbarButton-search-dark.svg</file> + <file compressed="true">web/images/toolbarButton-search.svg</file> + <file compressed="true">web/images/toolbarButton-secondaryToolbarToggle-dark.svg</file> + <file compressed="true">web/images/toolbarButton-secondaryToolbarToggle.svg</file> + <file compressed="true">web/images/toolbarButton-sidebarToggle-dark.svg</file> + <file compressed="true">web/images/toolbarButton-sidebarToggle.svg</file> + <file compressed="true">web/images/toolbarButton-viewAttachments-dark.svg</file> + <file compressed="true">web/images/toolbarButton-viewAttachments.svg</file> + <file compressed="true">web/images/toolbarButton-viewLayers-dark.svg</file> + <file compressed="true">web/images/toolbarButton-viewLayers.svg</file> + <file compressed="true">web/images/toolbarButton-viewOutline-dark.svg</file> + <file compressed="true">web/images/toolbarButton-viewOutline.svg</file> + <file compressed="true">web/images/toolbarButton-viewThumbnail-dark.svg</file> + <file compressed="true">web/images/toolbarButton-viewThumbnail.svg</file> + <file compressed="true">web/images/toolbarButton-zoomIn-dark.svg</file> + <file compressed="true">web/images/toolbarButton-zoomIn.svg</file> + <file compressed="true">web/images/toolbarButton-zoomOut-dark.svg</file> + <file compressed="true">web/images/toolbarButton-zoomOut.svg</file> + <file compressed="true">web/images/treeitem-collapsed-dark.svg</file> + <file compressed="true">web/images/treeitem-collapsed.svg</file> + <file compressed="true">web/images/treeitem-expanded-dark.svg</file> + <file compressed="true">web/images/treeitem-expanded.svg</file> <file compressed="true">web/locale/locale.properties</file> <file compressed="true">web/locale/ach/viewer.properties</file> <file compressed="true">web/locale/af/viewer.properties</file> @@ -275,6 +274,7 @@ <file compressed="true">web/locale/bs/viewer.properties</file> <file compressed="true">web/locale/ca/viewer.properties</file> <file compressed="true">web/locale/cak/viewer.properties</file> + <file compressed="true">web/locale/ckb/viewer.properties</file> <file compressed="true">web/locale/cs/viewer.properties</file> <file compressed="true">web/locale/cy/viewer.properties</file> <file compressed="true">web/locale/da/viewer.properties</file> @@ -349,6 +349,7 @@ <file compressed="true">web/locale/sq/viewer.properties</file> <file compressed="true">web/locale/sr/viewer.properties</file> <file compressed="true">web/locale/sv-SE/viewer.properties</file> + <file compressed="true">web/locale/szl/viewer.properties</file> <file compressed="true">web/locale/ta/viewer.properties</file> <file compressed="true">web/locale/te/viewer.properties</file> <file compressed="true">web/locale/th/viewer.properties</file> @@ -363,5 +364,9 @@ <file compressed="true">web/locale/xh/viewer.properties</file> <file compressed="true">web/locale/zh-CN/viewer.properties</file> <file compressed="true">web/locale/zh-TW/viewer.properties</file> + <file compressed="true">build/pdf.js</file> + <file compressed="true">build/pdf.js.map</file> + <file compressed="true">build/pdf.worker.js</file> + <file compressed="true">build/pdf.worker.js.map</file> </gresource> </gresources> diff --git a/third-party/pdfjs/pdfjs_generate_resource.py b/third-party/pdfjs/pdfjs_generate_resource.py index 5387530b3..f20641f80 100755 --- a/third-party/pdfjs/pdfjs_generate_resource.py +++ b/third-party/pdfjs/pdfjs_generate_resource.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 """ Pack pdf.js into a gresource file for Epiphany """ diff --git a/third-party/pdfjs/web/images/findbarButton-next-dark.svg b/third-party/pdfjs/web/images/findbarButton-next-dark.svg new file mode 100644 index 000000000..80df70bc1 --- /dev/null +++ b/third-party/pdfjs/web/images/findbarButton-next-dark.svg @@ -0,0 +1,6 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" +fill="rgba(255,255,255,1)"><path d="M8 12a1 1 0 0 1-.707-.293l-5-5a1 1 0 0 1 1.414-1.414L8 +9.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-5 5A1 1 0 0 1 8 12z"></path></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/findbarButton-next.png b/third-party/pdfjs/web/images/findbarButton-next.png Binary files differdeleted file mode 100644 index de1d0fc90..000000000 --- a/third-party/pdfjs/web/images/findbarButton-next.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/findbarButton-next.svg b/third-party/pdfjs/web/images/findbarButton-next.svg new file mode 100644 index 000000000..a81eb0296 --- /dev/null +++ b/third-party/pdfjs/web/images/findbarButton-next.svg @@ -0,0 +1,4 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M8 12a1 1 0 0 1-.707-.293l-5-5a1 1 0 0 1 1.414-1.414L8 9.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-5 5A1 1 0 0 1 8 12z"></path></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/findbarButton-next@2x.png b/third-party/pdfjs/web/images/findbarButton-next@2x.png Binary files differdeleted file mode 100644 index 0250307c0..000000000 --- a/third-party/pdfjs/web/images/findbarButton-next@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/findbarButton-previous-dark.svg b/third-party/pdfjs/web/images/findbarButton-previous-dark.svg new file mode 100644 index 000000000..d304a9b8c --- /dev/null +++ b/third-party/pdfjs/web/images/findbarButton-previous-dark.svg @@ -0,0 +1,5 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" +fill="rgba(255,255,255,1)"><path d="M13 11a1 1 0 0 1-.707-.293L8 6.414l-4.293 4.293a1 1 0 0 1-1.414-1.414l5-5a1 1 0 0 1 1.414 0l5 5A1 1 0 0 1 13 11z"></path></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/findbarButton-previous.png b/third-party/pdfjs/web/images/findbarButton-previous.png Binary files differdeleted file mode 100644 index bef02743f..000000000 --- a/third-party/pdfjs/web/images/findbarButton-previous.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/findbarButton-previous.svg b/third-party/pdfjs/web/images/findbarButton-previous.svg new file mode 100644 index 000000000..5fd703225 --- /dev/null +++ b/third-party/pdfjs/web/images/findbarButton-previous.svg @@ -0,0 +1,4 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M13 11a1 1 0 0 1-.707-.293L8 6.414l-4.293 4.293a1 1 0 0 1-1.414-1.414l5-5a1 1 0 0 1 1.414 0l5 5A1 1 0 0 1 13 11z"></path></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/findbarButton-previous@2x.png b/third-party/pdfjs/web/images/findbarButton-previous@2x.png Binary files differdeleted file mode 100644 index 1da6dc949..000000000 --- a/third-party/pdfjs/web/images/findbarButton-previous@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/loading-dark.svg b/third-party/pdfjs/web/images/loading-dark.svg new file mode 100644 index 000000000..fa5269b1a --- /dev/null +++ b/third-party/pdfjs/web/images/loading-dark.svg @@ -0,0 +1,24 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" +fill="rgba(255,255,255,1)" style="animation:spinLoadingIcon 1s steps(12,end) +infinite"><style>@keyframes +spinLoadingIcon{to{transform:rotate(360deg)}}</style><path +d="M7 3V1s0-1 1-1 1 1 1 1v2s0 1-1 1-1-1-1-1z"/><path d="M4.63 +4.1l-1-1.73S3.13 1.5 4 1c.87-.5 1.37.37 1.37.37l1 1.73s.5.87-.37 +1.37c-.87.57-1.37-.37-1.37-.37z" fill-opacity=".93"/><path +d="M3.1 6.37l-1.73-1S.5 4.87 1 4c.5-.87 1.37-.37 1.37-.37l1.73 1s.87.5.37 +1.37c-.5.87-1.37.37-1.37.37z" fill-opacity=".86"/><path d="M3 +9H1S0 9 0 8s1-1 1-1h2s1 0 1 1-1 1-1 1z" fill-opacity=".79"/><path d="M4.1 11.37l-1.73 1S1.5 12.87 1 +12c-.5-.87.37-1.37.37-1.37l1.73-1s.87-.5 1.37.37c.5.87-.37 1.37-.37 1.37z" +fill-opacity=".72"/><path d="M3.63 13.56l1-1.73s.5-.87 +1.37-.37c.87.5.37 1.37.37 1.37l-1 1.73s-.5.87-1.37.37c-.87-.5-.37-1.37-.37-1.37z" +fill-opacity=".65"/><path d="M7 15v-2s0-1 1-1 1 1 1 1v2s0 1-1 +1-1-1-1-1z" fill-opacity=".58"/><path d="M10.63 +14.56l-1-1.73s-.5-.87.37-1.37c.87-.5 1.37.37 1.37.37l1 1.73s.5.87-.37 +1.37c-.87.5-1.37-.37-1.37-.37z" fill-opacity=".51"/><path +d="M13.56 12.37l-1.73-1s-.87-.5-.37-1.37c.5-.87 1.37-.37 1.37-.37l1.73 1s.87.5.37 +1.37c-.5.87-1.37.37-1.37.37z" fill-opacity=".44"/><path d="M15 +9h-2s-1 0-1-1 1-1 1-1h2s1 0 1 1-1 1-1 1z" fill-opacity=".37"/><path d="M14.56 5.37l-1.73 +1s-.87.5-1.37-.37c-.5-.87.37-1.37.37-1.37l1.73-1s.87-.5 1.37.37c.5.87-.37 1.37-.37 +1.37z" fill-opacity=".3"/><path d="M9.64 3.1l.98-1.66s.5-.874 +1.37-.37c.87.5.37 1.37.37 1.37l-1 1.73s-.5.87-1.37.37c-.87-.5-.37-1.37-.37-1.37z" +fill-opacity=".23"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/loading-small.png b/third-party/pdfjs/web/images/loading-small.png Binary files differdeleted file mode 100644 index 8831a8058..000000000 --- a/third-party/pdfjs/web/images/loading-small.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/loading-small@2x.png b/third-party/pdfjs/web/images/loading-small@2x.png Binary files differdeleted file mode 100644 index b25b4452a..000000000 --- a/third-party/pdfjs/web/images/loading-small@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/loading.svg b/third-party/pdfjs/web/images/loading.svg new file mode 100644 index 000000000..0a15ff688 --- /dev/null +++ b/third-party/pdfjs/web/images/loading.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" style="animation:spinLoadingIcon 1s steps(12,end) infinite"><style>@keyframes spinLoadingIcon{to{transform:rotate(360deg)}}</style><path d="M7 3V1s0-1 1-1 1 1 1 1v2s0 1-1 1-1-1-1-1z"/><path d="M4.63 4.1l-1-1.73S3.13 1.5 4 1c.87-.5 1.37.37 1.37.37l1 1.73s.5.87-.37 1.37c-.87.57-1.37-.37-1.37-.37z" fill-opacity=".93"/><path d="M3.1 6.37l-1.73-1S.5 4.87 1 4c.5-.87 1.37-.37 1.37-.37l1.73 1s.87.5.37 1.37c-.5.87-1.37.37-1.37.37z" fill-opacity=".86"/><path d="M3 9H1S0 9 0 8s1-1 1-1h2s1 0 1 1-1 1-1 1z" fill-opacity=".79"/><path d="M4.1 11.37l-1.73 1S1.5 12.87 1 12c-.5-.87.37-1.37.37-1.37l1.73-1s.87-.5 1.37.37c.5.87-.37 1.37-.37 1.37z" fill-opacity=".72"/><path d="M3.63 13.56l1-1.73s.5-.87 1.37-.37c.87.5.37 1.37.37 1.37l-1 1.73s-.5.87-1.37.37c-.87-.5-.37-1.37-.37-1.37z" fill-opacity=".65"/><path d="M7 15v-2s0-1 1-1 1 1 1 1v2s0 1-1 1-1-1-1-1z" fill-opacity=".58"/><path d="M10.63 14.56l-1-1.73s-.5-.87.37-1.37c.87-.5 1.37.37 1.37.37l1 1.73s.5.87-.37 1.37c-.87.5-1.37-.37-1.37-.37z" fill-opacity=".51"/><path d="M13.56 12.37l-1.73-1s-.87-.5-.37-1.37c.5-.87 1.37-.37 1.37-.37l1.73 1s.87.5.37 1.37c-.5.87-1.37.37-1.37.37z" fill-opacity=".44"/><path d="M15 9h-2s-1 0-1-1 1-1 1-1h2s1 0 1 1-1 1-1 1z" fill-opacity=".37"/><path d="M14.56 5.37l-1.73 1s-.87.5-1.37-.37c-.5-.87.37-1.37.37-1.37l1.73-1s.87-.5 1.37.37c.5.87-.37 1.37-.37 1.37z" fill-opacity=".3"/><path d="M9.64 3.1l.98-1.66s.5-.874 1.37-.37c.87.5.37 1.37.37 1.37l-1 1.73s-.5.87-1.37.37c-.87-.5-.37-1.37-.37-1.37z" fill-opacity=".23"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-documentProperties-dark.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-documentProperties-dark.svg new file mode 100644 index 000000000..306e628d7 --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-documentProperties-dark.svg @@ -0,0 +1,16 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 +16" +fill="rgba(255,255,255,1)"> +<path + d="M8 16a8 8 0 1 1 8-8 8.009 8.009 0 0 1-8 8zM8 2a6 6 0 1 0 6 6 6.006 6.006 0 0 0-6-6z"> +</path> +<path + d="M8 7a1 1 0 0 0-1 1v3a1 1 0 0 0 2 0V8a1 1 0 0 0-1-1z"> +</path> +<circle + cx="8" cy="5" r="1.188"> +</circle> +</svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-documentProperties.png b/third-party/pdfjs/web/images/secondaryToolbarButton-documentProperties.png Binary files differdeleted file mode 100644 index 40925e25a..000000000 --- a/third-party/pdfjs/web/images/secondaryToolbarButton-documentProperties.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-documentProperties.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-documentProperties.svg new file mode 100644 index 000000000..6bd55cda7 --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-documentProperties.svg @@ -0,0 +1,15 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 +16"> +<path + d="M8 16a8 8 0 1 1 8-8 8.009 8.009 0 0 1-8 8zM8 2a6 6 0 1 0 6 6 6.006 6.006 0 0 0-6-6z"> +</path> +<path + d="M8 7a1 1 0 0 0-1 1v3a1 1 0 0 0 2 0V8a1 1 0 0 0-1-1z"> +</path> +<circle + cx="8" cy="5" r="1.188"> +</circle> +</svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-documentProperties@2x.png b/third-party/pdfjs/web/images/secondaryToolbarButton-documentProperties@2x.png Binary files differdeleted file mode 100644 index adb240eaa..000000000 --- a/third-party/pdfjs/web/images/secondaryToolbarButton-documentProperties@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-firstPage-dark.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-firstPage-dark.svg new file mode 100644 index 000000000..c13ff8671 --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-firstPage-dark.svg @@ -0,0 +1,2 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" +fill="rgba(255,255,255,1)"><path d="M13 13c-.3 0-.5-.1-.7-.3L8 8.4l-4.3 4.3c-.9.9-2.3-.5-1.4-1.4l5-5c.4-.4 1-.4 1.4 0l5 5c.6.6.2 1.7-.7 1.7zm0-11H3C1.7 2 1.7 4 3 4h10c1.3 0 1.3-2 0-2z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-firstPage.png b/third-party/pdfjs/web/images/secondaryToolbarButton-firstPage.png Binary files differdeleted file mode 100644 index e68846aa5..000000000 --- a/third-party/pdfjs/web/images/secondaryToolbarButton-firstPage.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-firstPage.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-firstPage.svg new file mode 100644 index 000000000..2fa0fa6da --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-firstPage.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M13 13c-.3 0-.5-.1-.7-.3L8 8.4l-4.3 4.3c-.9.9-2.3-.5-1.4-1.4l5-5c.4-.4 1-.4 1.4 0l5 5c.6.6.2 1.7-.7 1.7zm0-11H3C1.7 2 1.7 4 3 4h10c1.3 0 1.3-2 0-2z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-firstPage@2x.png b/third-party/pdfjs/web/images/secondaryToolbarButton-firstPage@2x.png Binary files differdeleted file mode 100644 index 3ad8af517..000000000 --- a/third-party/pdfjs/web/images/secondaryToolbarButton-firstPage@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-handTool-dark.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-handTool-dark.svg new file mode 100644 index 000000000..834d8b0da --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-handTool-dark.svg @@ -0,0 +1,2 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" +fill="rgba(255,255,255,1)"><path d="M15 3.7V13c0 1.5-1.53 3-3 3H7.13c-.72 0-1.63-.5-2.13-1l-5-5s.84-1 .87-1c.13-.1.33-.2.53-.2.1 0 .3.1.4.2L4 10.6V2.7c0-.6.4-1 1-1s1 .4 1 1v4.6h1V1c0-.6.4-1 1-1s1 .4 1 1v6.3h1V1.7c0-.6.4-1 1-1s1 .4 1 1v5.7h1V3.7c0-.6.4-1 1-1s1 .4 1 1z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-handTool.png b/third-party/pdfjs/web/images/secondaryToolbarButton-handTool.png Binary files differdeleted file mode 100644 index cb85a841b..000000000 --- a/third-party/pdfjs/web/images/secondaryToolbarButton-handTool.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-handTool.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-handTool.svg new file mode 100644 index 000000000..3d038fabb --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-handTool.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"><path d="M15 3.7V13c0 1.5-1.53 3-3 3H7.13c-.72 0-1.63-.5-2.13-1l-5-5s.84-1 .87-1c.13-.1.33-.2.53-.2.1 0 .3.1.4.2L4 10.6V2.7c0-.6.4-1 1-1s1 .4 1 1v4.6h1V1c0-.6.4-1 1-1s1 .4 1 1v6.3h1V1.7c0-.6.4-1 1-1s1 .4 1 1v5.7h1V3.7c0-.6.4-1 1-1s1 .4 1 1z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-handTool@2x.png b/third-party/pdfjs/web/images/secondaryToolbarButton-handTool@2x.png Binary files differdeleted file mode 100644 index 5c13f77ff..000000000 --- a/third-party/pdfjs/web/images/secondaryToolbarButton-handTool@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-lastPage-dark.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-lastPage-dark.svg new file mode 100644 index 000000000..8633e420a --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-lastPage-dark.svg @@ -0,0 +1,2 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" +fill="rgba(255,255,255,1)"><path d="M8 10c-.3 0-.5-.1-.7-.3l-5-5c-.9-.9.5-2.3 1.4-1.4L8 7.6l4.3-4.3c.9-.9 2.3.5 1.4 1.4l-5 5c-.2.2-.4.3-.7.3zm5 2H3c-1.3 0-1.3 2 0 2h10c1.3 0 1.3-2 0-2z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-lastPage.png b/third-party/pdfjs/web/images/secondaryToolbarButton-lastPage.png Binary files differdeleted file mode 100644 index be763e0c4..000000000 --- a/third-party/pdfjs/web/images/secondaryToolbarButton-lastPage.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-lastPage.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-lastPage.svg new file mode 100644 index 000000000..53fa9a6d0 --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-lastPage.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M8 10c-.3 0-.5-.1-.7-.3l-5-5c-.9-.9.5-2.3 1.4-1.4L8 7.6l4.3-4.3c.9-.9 2.3.5 1.4 1.4l-5 5c-.2.2-.4.3-.7.3zm5 2H3c-1.3 0-1.3 2 0 2h10c1.3 0 1.3-2 0-2z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-lastPage@2x.png b/third-party/pdfjs/web/images/secondaryToolbarButton-lastPage@2x.png Binary files differdeleted file mode 100644 index 8570984f2..000000000 --- a/third-party/pdfjs/web/images/secondaryToolbarButton-lastPage@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCcw-dark.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCcw-dark.svg new file mode 100644 index 000000000..1a92f802c --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCcw-dark.svg @@ -0,0 +1,2 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" +fill="rgba(255,255,255,1)"><path d="M1 1a1 1 0 011 1v2.4A7 7 0 118 15a7 7 0 01-4.9-2 1 1 0 011.4-1.5 5 5 0 10-1-5.5H6a1 1 0 010 2H1a1 1 0 01-1-1V2a1 1 0 011-1z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCcw.png b/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCcw.png Binary files differdeleted file mode 100644 index 675d6da2c..000000000 --- a/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCcw.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCcw.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCcw.svg new file mode 100644 index 000000000..c71ea8e8d --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCcw.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"><path d="M1 1a1 1 0 011 1v2.4A7 7 0 118 15a7 7 0 01-4.9-2 1 1 0 011.4-1.5 5 5 0 10-1-5.5H6a1 1 0 010 2H1a1 1 0 01-1-1V2a1 1 0 011-1z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCcw@2x.png b/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCcw@2x.png Binary files differdeleted file mode 100644 index b9e743122..000000000 --- a/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCcw@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCw-dark.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCw-dark.svg new file mode 100644 index 000000000..2a4ef7385 --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCw-dark.svg @@ -0,0 +1,5 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" +fill="rgba(255,255,255,1)"><path d="M15 1a1 1 0 0 0-1 1v2.418A6.995 6.995 0 1 0 8 15a6.954 6.954 0 0 0 4.95-2.05 1 1 0 0 0-1.414-1.414A5.019 5.019 0 1 1 12.549 6H10a1 1 0 0 0 0 2h5a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1z"></path></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCw.png b/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCw.png Binary files differdeleted file mode 100644 index e1c759888..000000000 --- a/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCw.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCw.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCw.svg new file mode 100644 index 000000000..e1e19e73d --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCw.svg @@ -0,0 +1,4 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M15 1a1 1 0 0 0-1 1v2.418A6.995 6.995 0 1 0 8 15a6.954 6.954 0 0 0 4.95-2.05 1 1 0 0 0-1.414-1.414A5.019 5.019 0 1 1 12.549 6H10a1 1 0 0 0 0 2h5a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1z"></path></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCw@2x.png b/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCw@2x.png Binary files differdeleted file mode 100644 index cb257b41c..000000000 --- a/third-party/pdfjs/web/images/secondaryToolbarButton-rotateCw@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal-dark.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal-dark.svg new file mode 100644 index 000000000..337f85ef4 --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal-dark.svg @@ -0,0 +1,2 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" +fill="rgba(255,255,255,1)"><path d="M0 4h1.5c1 0 1.5.5 1.5 1.5v5c0 1-.5 1.5-1.5 1.5H0zM9.5 4c1 0 1.5.5 1.5 1.5v5c0 1-.5 1.5-1.5 1.5h-3c-1 0-1.5-.5-1.5-1.5v-5C5 4.5 5.5 4 6.5 4zM16 4h-1.5c-1 0-1.5.5-1.5 1.5v5c0 1 .5 1.5 1.5 1.5H16z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal.png b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal.png Binary files differdeleted file mode 100644 index cb702fc4d..000000000 --- a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal.svg new file mode 100644 index 000000000..8693eec39 --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"><path d="M0 4h1.5c1 0 1.5.5 1.5 1.5v5c0 1-.5 1.5-1.5 1.5H0zM9.5 4c1 0 1.5.5 1.5 1.5v5c0 1-.5 1.5-1.5 1.5h-3c-1 0-1.5-.5-1.5-1.5v-5C5 4.5 5.5 4 6.5 4zM16 4h-1.5c-1 0-1.5.5-1.5 1.5v5c0 1 .5 1.5 1.5 1.5H16z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal@2x.png b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal@2x.png Binary files differdeleted file mode 100644 index 7f05289bb..000000000 --- a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollVertical-dark.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollVertical-dark.svg new file mode 100644 index 000000000..41bdd8f14 --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollVertical-dark.svg @@ -0,0 +1,2 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" +fill="rgba(255,255,255,1)"><path d="M9.5 4c1 0 1.5.5 1.5 1.5v5c0 1-.5 1.5-1.5 1.5h-3c-1 0-1.5-.5-1.5-1.5v-5C5 4.5 5.5 4 6.5 4zM11 0v.5c0 1-.5 1.5-1.5 1.5h-3C5.5 2 5 1.5 5 .5V0h6zM11 16v-.5c0-1-.5-1.5-1.5-1.5h-3c-1 0-1.5.5-1.5 1.5v.5h6z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollVertical.png b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollVertical.png Binary files differdeleted file mode 100644 index 0b8427a16..000000000 --- a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollVertical.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollVertical.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollVertical.svg new file mode 100644 index 000000000..ee1cf22f9 --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollVertical.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"><path d="M9.5 4c1 0 1.5.5 1.5 1.5v5c0 1-.5 1.5-1.5 1.5h-3c-1 0-1.5-.5-1.5-1.5v-5C5 4.5 5.5 4 6.5 4zM11 0v.5c0 1-.5 1.5-1.5 1.5h-3C5.5 2 5 1.5 5 .5V0h6zM11 16v-.5c0-1-.5-1.5-1.5-1.5h-3c-1 0-1.5.5-1.5 1.5v.5h6z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollVertical@2x.png b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollVertical@2x.png Binary files differdeleted file mode 100644 index 72ab55ebf..000000000 --- a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollVertical@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollWrapped-dark.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollWrapped-dark.svg new file mode 100644 index 000000000..cd50526ff --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollWrapped-dark.svg @@ -0,0 +1,2 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" +fill="rgba(255,255,255,1)"><path d="M5.5 4c1 0 1.5.5 1.5 1.5v5c0 1-.5 1.5-1.5 1.5h-3c-1 0-1.5-.5-1.5-1.5v-5C1 4.5 1.5 4 2.5 4zM7 0v.5C7 1.5 6.5 2 5.5 2h-3C1.5 2 1 1.5 1 .5V0h6zM7 16v-.5c0-1-.5-1.5-1.5-1.5h-3c-1 0-1.5.5-1.5 1.5v.5h6zM13.5 4c1 0 1.5.5 1.5 1.5v5c0 1-.5 1.5-1.5 1.5h-3c-1 0-1.5-.5-1.5-1.5v-5c0-1 .5-1.5 1.5-1.5zM15 0v.5c0 1-.5 1.5-1.5 1.5h-3C9.5 2 9 1.5 9 .5V0h6zM15 16v-.507c0-1-.5-1.5-1.5-1.5h-3C9.5 14 9 14.5 9 15.5v.5h6z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollWrapped.png b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollWrapped.png Binary files differdeleted file mode 100644 index 165fc8bc0..000000000 --- a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollWrapped.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollWrapped.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollWrapped.svg new file mode 100644 index 000000000..804e7469b --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollWrapped.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M5.5 4c1 0 1.5.5 1.5 1.5v5c0 1-.5 1.5-1.5 1.5h-3c-1 0-1.5-.5-1.5-1.5v-5C1 4.5 1.5 4 2.5 4zM7 0v.5C7 1.5 6.5 2 5.5 2h-3C1.5 2 1 1.5 1 .5V0h6zM7 16v-.5c0-1-.5-1.5-1.5-1.5h-3c-1 0-1.5.5-1.5 1.5v.5h6zM13.5 4c1 0 1.5.5 1.5 1.5v5c0 1-.5 1.5-1.5 1.5h-3c-1 0-1.5-.5-1.5-1.5v-5c0-1 .5-1.5 1.5-1.5zM15 0v.5c0 1-.5 1.5-1.5 1.5h-3C9.5 2 9 1.5 9 .5V0h6zM15 16v-.507c0-1-.5-1.5-1.5-1.5h-3C9.5 14 9 14.5 9 15.5v.5h6z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollWrapped@2x.png b/third-party/pdfjs/web/images/secondaryToolbarButton-scrollWrapped@2x.png Binary files differdeleted file mode 100644 index 424614119..000000000 --- a/third-party/pdfjs/web/images/secondaryToolbarButton-scrollWrapped@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-selectTool-dark.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-selectTool-dark.svg new file mode 100644 index 000000000..7a95098af --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-selectTool-dark.svg @@ -0,0 +1,5 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" +fill="rgba(255,255,255,1)"><path d="M12.408 8.217l-8.083-6.7A.2.2 0 0 0 4 1.672V12.3a.2.2 0 0 0 .333.146l2.56-2.372 1.857 3.9A1.125 1.125 0 1 0 10.782 13L8.913 9.075l3.4-.51a.2.2 0 0 0 .095-.348z"></path></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-selectTool.png b/third-party/pdfjs/web/images/secondaryToolbarButton-selectTool.png Binary files differdeleted file mode 100644 index 25520a6fe..000000000 --- a/third-party/pdfjs/web/images/secondaryToolbarButton-selectTool.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-selectTool.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-selectTool.svg new file mode 100644 index 000000000..43e978944 --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-selectTool.svg @@ -0,0 +1,4 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M12.408 8.217l-8.083-6.7A.2.2 0 0 0 4 1.672V12.3a.2.2 0 0 0 .333.146l2.56-2.372 1.857 3.9A1.125 1.125 0 1 0 10.782 13L8.913 9.075l3.4-.51a.2.2 0 0 0 .095-.348z"></path></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-selectTool@2x.png b/third-party/pdfjs/web/images/secondaryToolbarButton-selectTool@2x.png Binary files differdeleted file mode 100644 index a58aaef4f..000000000 --- a/third-party/pdfjs/web/images/secondaryToolbarButton-selectTool@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadEven-dark.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadEven-dark.svg new file mode 100644 index 000000000..0c9586ed8 --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadEven-dark.svg @@ -0,0 +1,2 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" +fill="rgba(255,255,255,1)"><path d="M1.5 3.5C.5 3.5 0 4 0 5v6.5c0 1 .5 1.5 1.5 1.5h4c1 0 1.5-.5 1.5-1.5V5c0-1-.5-1.5-1.5-1.5zm2 1.2c.8 0 1.4.2 1.8.6.5.4.7 1 .7 1.7 0 .5-.2 1-.5 1.4-.2.3-.5.7-1 1l-.6.4c-.4.3-.6.4-.75.56-.15.14-.25.24-.35.44H6v1.3H1c0-.6.1-1.1.3-1.5.3-.6.7-1 1.5-1.6.7-.4 1.1-.8 1.28-1 .32-.3.42-.6.42-1 0-.3-.1-.6-.23-.8-.17-.2-.37-.3-.77-.3s-.7.1-.9.5c-.04.2-.1.5-.1.9H1.1c0-.6.1-1.1.3-1.5.4-.7 1.1-1.1 2.1-1.1zM10.54 3.54C9.5 3.54 9 4 9 5v6.5c0 1 .5 1.5 1.54 1.5h4c.96 0 1.46-.5 1.46-1.5V5c0-1-.5-1.46-1.5-1.46zm1.9.95c.7 0 1.3.2 1.7.5.4.4.6.8.6 1.4 0 .4-.1.8-.4 1.1-.2.2-.3.3-.5.4.1 0 .3.1.6.3.4.3.5.8.5 1.4 0 .6-.2 1.2-.6 1.6-.4.5-1.1.7-1.9.7-1 0-1.8-.3-2.2-1-.14-.29-.24-.69-.24-1.29h1.4c0 .3 0 .5.1.7.2.4.5.5 1 .5.3 0 .5-.1.7-.3.2-.2.3-.5.3-.8 0-.5-.2-.8-.6-.95-.2-.05-.5-.15-1-.15v-1c.5 0 .8-.1 1-.14.3-.1.5-.4.5-.9 0-.3-.1-.5-.2-.7-.2-.2-.4-.3-.7-.3-.3 0-.6.1-.75.3-.2.2-.2.5-.2.86h-1.34c0-.4.1-.7.19-1.1 0-.12.2-.32.4-.62.2-.2.4-.3.7-.4.3-.1.6-.1 1-.1z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadEven.png b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadEven.png Binary files differdeleted file mode 100644 index 3fa07e703..000000000 --- a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadEven.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadEven.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadEven.svg new file mode 100644 index 000000000..ddec5e68d --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadEven.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M1.5 3.5C.5 3.5 0 4 0 5v6.5c0 1 .5 1.5 1.5 1.5h4c1 0 1.5-.5 1.5-1.5V5c0-1-.5-1.5-1.5-1.5zm2 1.2c.8 0 1.4.2 1.8.6.5.4.7 1 .7 1.7 0 .5-.2 1-.5 1.4-.2.3-.5.7-1 1l-.6.4c-.4.3-.6.4-.75.56-.15.14-.25.24-.35.44H6v1.3H1c0-.6.1-1.1.3-1.5.3-.6.7-1 1.5-1.6.7-.4 1.1-.8 1.28-1 .32-.3.42-.6.42-1 0-.3-.1-.6-.23-.8-.17-.2-.37-.3-.77-.3s-.7.1-.9.5c-.04.2-.1.5-.1.9H1.1c0-.6.1-1.1.3-1.5.4-.7 1.1-1.1 2.1-1.1zM10.54 3.54C9.5 3.54 9 4 9 5v6.5c0 1 .5 1.5 1.54 1.5h4c.96 0 1.46-.5 1.46-1.5V5c0-1-.5-1.46-1.5-1.46zm1.9.95c.7 0 1.3.2 1.7.5.4.4.6.8.6 1.4 0 .4-.1.8-.4 1.1-.2.2-.3.3-.5.4.1 0 .3.1.6.3.4.3.5.8.5 1.4 0 .6-.2 1.2-.6 1.6-.4.5-1.1.7-1.9.7-1 0-1.8-.3-2.2-1-.14-.29-.24-.69-.24-1.29h1.4c0 .3 0 .5.1.7.2.4.5.5 1 .5.3 0 .5-.1.7-.3.2-.2.3-.5.3-.8 0-.5-.2-.8-.6-.95-.2-.05-.5-.15-1-.15v-1c.5 0 .8-.1 1-.14.3-.1.5-.4.5-.9 0-.3-.1-.5-.2-.7-.2-.2-.4-.3-.7-.3-.3 0-.6.1-.75.3-.2.2-.2.5-.2.86h-1.34c0-.4.1-.7.19-1.1 0-.12.2-.32.4-.62.2-.2.4-.3.7-.4.3-.1.6-.1 1-.1z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadEven@2x.png b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadEven@2x.png Binary files differdeleted file mode 100644 index 32e5033d7..000000000 --- a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadEven@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadNone-dark.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadNone-dark.svg new file mode 100644 index 000000000..75e1b985d --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadNone-dark.svg @@ -0,0 +1,2 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" +fill="rgba(255,255,255,1)"><path d="M6 3c-1 0-1.5.5-1.5 1.5v7c0 1 .5 1.5 1.5 1.5h4c1 0 1.5-.5 1.5-1.5v-7c0-1-.5-1.5-1.5-1.5z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadNone.png b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadNone.png Binary files differdeleted file mode 100644 index 161147354..000000000 --- a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadNone.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadNone.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadNone.svg new file mode 100644 index 000000000..63318c56b --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadNone.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"><path d="M6 3c-1 0-1.5.5-1.5 1.5v7c0 1 .5 1.5 1.5 1.5h4c1 0 1.5-.5 1.5-1.5v-7c0-1-.5-1.5-1.5-1.5z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadNone@2x.png b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadNone@2x.png Binary files differdeleted file mode 100644 index 8e51cf3b7..000000000 --- a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadNone@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadOdd-dark.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadOdd-dark.svg new file mode 100644 index 000000000..8dff9598e --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadOdd-dark.svg @@ -0,0 +1,2 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" +fill="rgba(255,255,255,1)"><path d="M10.56 3.5C9.56 3.5 9 4 9 5v6.5c0 1 .5 1.5 1.5 1.5h4c1 0 1.5-.5 1.5-1.5V5c0-1-.5-1.5-1.5-1.5zm1.93 1.2c.8 0 1.4.2 1.8.64.5.4.7 1 .7 1.7 0 .5-.2 1-.5 1.44-.2.3-.6.6-1 .93l-.6.4c-.4.3-.6.4-.7.55-.1.1-.2.2-.3.4h3.2v1.27h-5c0-.5.1-1 .3-1.43.2-.49.7-1 1.5-1.54.7-.5 1.1-.8 1.3-1.02.3-.3.4-.7.4-1.05 0-.3-.1-.6-.3-.77-.2-.2-.4-.3-.7-.3-.4 0-.7.2-.9.5-.1.2-.1.5-.2.9h-1.4c0-.6.2-1.1.3-1.5.4-.7 1.1-1.1 2-1.1zM1.54 3.5C.54 3.5 0 4 0 5v6.5c0 1 .5 1.5 1.54 1.5h4c1 0 1.5-.5 1.5-1.5V5c0-1-.5-1.5-1.5-1.5zm1.8 1.125H4.5V12H3V6.9H1.3v-1c.5 0 .8 0 .97-.03.33-.07.53-.17.73-.37.1-.2.2-.3.25-.5.05-.2.05-.3.05-.3z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadOdd.png b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadOdd.png Binary files differdeleted file mode 100644 index 5126313a1..000000000 --- a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadOdd.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadOdd.svg b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadOdd.svg new file mode 100644 index 000000000..29909e9fa --- /dev/null +++ b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadOdd.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M10.56 3.5C9.56 3.5 9 4 9 5v6.5c0 1 .5 1.5 1.5 1.5h4c1 0 1.5-.5 1.5-1.5V5c0-1-.5-1.5-1.5-1.5zm1.93 1.2c.8 0 1.4.2 1.8.64.5.4.7 1 .7 1.7 0 .5-.2 1-.5 1.44-.2.3-.6.6-1 .93l-.6.4c-.4.3-.6.4-.7.55-.1.1-.2.2-.3.4h3.2v1.27h-5c0-.5.1-1 .3-1.43.2-.49.7-1 1.5-1.54.7-.5 1.1-.8 1.3-1.02.3-.3.4-.7.4-1.05 0-.3-.1-.6-.3-.77-.2-.2-.4-.3-.7-.3-.4 0-.7.2-.9.5-.1.2-.1.5-.2.9h-1.4c0-.6.2-1.1.3-1.5.4-.7 1.1-1.1 2-1.1zM1.54 3.5C.54 3.5 0 4 0 5v6.5c0 1 .5 1.5 1.54 1.5h4c1 0 1.5-.5 1.5-1.5V5c0-1-.5-1.5-1.5-1.5zm1.8 1.125H4.5V12H3V6.9H1.3v-1c.5 0 .8 0 .97-.03.33-.07.53-.17.73-.37.1-.2.2-.3.25-.5.05-.2.05-.3.05-.3z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadOdd@2x.png b/third-party/pdfjs/web/images/secondaryToolbarButton-spreadOdd@2x.png Binary files differdeleted file mode 100644 index 5996b74db..000000000 --- a/third-party/pdfjs/web/images/secondaryToolbarButton-spreadOdd@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/shadow.png b/third-party/pdfjs/web/images/shadow.png Binary files differindex 31d3bdb14..a00061ac7 100644 --- a/third-party/pdfjs/web/images/shadow.png +++ b/third-party/pdfjs/web/images/shadow.png diff --git a/third-party/pdfjs/web/images/texture.png b/third-party/pdfjs/web/images/texture.png Binary files differdeleted file mode 100644 index 12bae83a9..000000000 --- a/third-party/pdfjs/web/images/texture.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-bookmark-dark.svg b/third-party/pdfjs/web/images/toolbarButton-bookmark-dark.svg new file mode 100644 index 000000000..7bf332972 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-bookmark-dark.svg @@ -0,0 +1,2 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" +fill="rgba(255,255,255,1)"><path d="M4 16V2s0-1 1-1h6s1 0 1 1v14l-4-5z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-bookmark.png b/third-party/pdfjs/web/images/toolbarButton-bookmark.png Binary files differdeleted file mode 100644 index a187be6c9..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-bookmark.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-bookmark.svg b/third-party/pdfjs/web/images/toolbarButton-bookmark.svg new file mode 100644 index 000000000..79d39b090 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-bookmark.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"><path d="M4 16V2s0-1 1-1h6s1 0 1 1v14l-4-5z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-bookmark@2x.png b/third-party/pdfjs/web/images/toolbarButton-bookmark@2x.png Binary files differdeleted file mode 100644 index 4efbaa675..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-bookmark@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-download-dark.svg b/third-party/pdfjs/web/images/toolbarButton-download-dark.svg new file mode 100644 index 000000000..d2a92e5d4 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-download-dark.svg @@ -0,0 +1,5 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" +fill="rgba(255,255,255,1)"><path d="M14 3h-2v2h2v8H2V5h7V3h-.849L6.584 1.538A2 2 0 0 0 5.219 1H2a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zM2 3h3.219l1.072 1H2z"></path><path d="M8.146 6.146a.5.5 0 0 0 0 .707l2 2a.5.5 0 0 0 .707 0l2-2a.5.5 0 1 0-.707-.707L11 7.293V.5a.5.5 0 0 0-1 0v6.793L8.854 6.146a.5.5 0 0 0-.708 0z"></path></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-download.png b/third-party/pdfjs/web/images/toolbarButton-download.png Binary files differdeleted file mode 100644 index eaab35f09..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-download.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-download.svg b/third-party/pdfjs/web/images/toolbarButton-download.svg new file mode 100644 index 000000000..2cdb5db3c --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-download.svg @@ -0,0 +1,4 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M14 3h-2v2h2v8H2V5h7V3h-.849L6.584 1.538A2 2 0 0 0 5.219 1H2a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zM2 3h3.219l1.072 1H2z"></path><path d="M8.146 6.146a.5.5 0 0 0 0 .707l2 2a.5.5 0 0 0 .707 0l2-2a.5.5 0 1 0-.707-.707L11 7.293V.5a.5.5 0 0 0-1 0v6.793L8.854 6.146a.5.5 0 0 0-.708 0z"></path></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-download@2x.png b/third-party/pdfjs/web/images/toolbarButton-download@2x.png Binary files differdeleted file mode 100644 index 896face45..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-download@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-menuArrow-dark.svg b/third-party/pdfjs/web/images/toolbarButton-menuArrow-dark.svg new file mode 100644 index 000000000..eb7f50e6d --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-menuArrow-dark.svg @@ -0,0 +1 @@ +<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" fill="rgba(255,255,255,1)"><path d="M8 11a1 1 0 01-.707-.293l-2.99-2.99c-.91-.942.471-2.324 1.414-1.414L8 8.586l2.283-2.283c.943-.91 2.324.472 1.414 1.414l-2.99 2.99A1 1 0 018 11z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-menuArrow.svg b/third-party/pdfjs/web/images/toolbarButton-menuArrow.svg new file mode 100644 index 000000000..46e41e18c --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-menuArrow.svg @@ -0,0 +1 @@ +<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg"><path d="M8 11a1 1 0 01-.707-.293l-2.99-2.99c-.91-.942.471-2.324 1.414-1.414L8 8.586l2.283-2.283c.943-.91 2.324.472 1.414 1.414l-2.99 2.99A1 1 0 018 11z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-menuArrows.png b/third-party/pdfjs/web/images/toolbarButton-menuArrows.png Binary files differdeleted file mode 100644 index e50ca4eee..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-menuArrows.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-menuArrows@2x.png b/third-party/pdfjs/web/images/toolbarButton-menuArrows@2x.png Binary files differdeleted file mode 100644 index f7570bc0d..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-menuArrows@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-openFile-dark.svg b/third-party/pdfjs/web/images/toolbarButton-openFile-dark.svg new file mode 100644 index 000000000..0bd612f0e --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-openFile-dark.svg @@ -0,0 +1,5 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" +fill="rgba(255,255,255,1)"><path d="M14.859 3.2a1.335 1.335 0 0 1-1.217.8H13v1h1v8H2V5h8V4h-.642a1.365 1.365 0 0 1-1.325-1.11L6.584 1.538A2 2 0 0 0 5.219 1H2a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V5a2 2 0 0 0-1.141-1.8zM2 3h3.219l1.072 1H2zm7.854-.146L11 1.707V8.5a.5.5 0 0 0 1 0V1.707l1.146 1.146a.5.5 0 1 0 .707-.707l-2-2a.5.5 0 0 0-.707 0l-2 2a.5.5 0 0 0 .707.707z"></path></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-openFile.png b/third-party/pdfjs/web/images/toolbarButton-openFile.png Binary files differdeleted file mode 100644 index b5cf1bd06..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-openFile.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-openFile.svg b/third-party/pdfjs/web/images/toolbarButton-openFile.svg new file mode 100644 index 000000000..cb35980f0 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-openFile.svg @@ -0,0 +1,4 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M14.859 3.2a1.335 1.335 0 0 1-1.217.8H13v1h1v8H2V5h8V4h-.642a1.365 1.365 0 0 1-1.325-1.11L6.584 1.538A2 2 0 0 0 5.219 1H2a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V5a2 2 0 0 0-1.141-1.8zM2 3h3.219l1.072 1H2zm7.854-.146L11 1.707V8.5a.5.5 0 0 0 1 0V1.707l1.146 1.146a.5.5 0 1 0 .707-.707l-2-2a.5.5 0 0 0-.707 0l-2 2a.5.5 0 0 0 .707.707z"></path></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-openFile@2x.png b/third-party/pdfjs/web/images/toolbarButton-openFile@2x.png Binary files differdeleted file mode 100644 index 91ab76593..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-openFile@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-pageDown-dark.svg b/third-party/pdfjs/web/images/toolbarButton-pageDown-dark.svg new file mode 100644 index 000000000..c2ca60c8f --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-pageDown-dark.svg @@ -0,0 +1,8 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 +16" +fill="rgba(255,255,255,1)"><path transform='rotate(90) translate(0, -16)' +d="M15.707 7.293l-6-6a1 1 0 0 0-1.414 1.414L12.586 7H1a1 1 0 0 0 0 2h11.586l-4.293 +4.293a1 1 0 1 0 1.414 1.414l6-6a1 1 0 0 0 0-1.414z"></path></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-pageDown.png b/third-party/pdfjs/web/images/toolbarButton-pageDown.png Binary files differdeleted file mode 100644 index 8219ecf83..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-pageDown.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-pageDown.svg b/third-party/pdfjs/web/images/toolbarButton-pageDown.svg new file mode 100644 index 000000000..c5d8b0f3f --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-pageDown.svg @@ -0,0 +1,7 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 +16"><path transform='rotate(90) translate(0, -16)' +d="M15.707 7.293l-6-6a1 1 0 0 0-1.414 1.414L12.586 7H1a1 1 0 0 0 0 2h11.586l-4.293 +4.293a1 1 0 1 0 1.414 1.414l6-6a1 1 0 0 0 0-1.414z"></path></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-pageDown@2x.png b/third-party/pdfjs/web/images/toolbarButton-pageDown@2x.png Binary files differdeleted file mode 100644 index 758c01d83..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-pageDown@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-pageUp-dark.svg b/third-party/pdfjs/web/images/toolbarButton-pageUp-dark.svg new file mode 100644 index 000000000..dddc4ab26 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-pageUp-dark.svg @@ -0,0 +1,13 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 +16" +fill="rgba(255,255,255,1)"> +<path + transform='rotate(90) translate(0, -16)' + d="M15 7H3.414l4.293-4.293a1 1 0 0 +0-1.414-1.414l-6 6a1 1 0 0 0 0 1.414l6 6a1 1 0 0 0 1.414-1.414L3.414 9H15a1 1 0 0 +0 0-2z"> +</path> +</svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-pageUp.png b/third-party/pdfjs/web/images/toolbarButton-pageUp.png Binary files differdeleted file mode 100644 index fb9daa337..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-pageUp.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-pageUp.svg b/third-party/pdfjs/web/images/toolbarButton-pageUp.svg new file mode 100644 index 000000000..aa0160ab9 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-pageUp.svg @@ -0,0 +1,12 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 +16"> +<path + transform='rotate(90) translate(0, -16)' + d="M15 7H3.414l4.293-4.293a1 1 0 0 +0-1.414-1.414l-6 6a1 1 0 0 0 0 1.414l6 6a1 1 0 0 0 1.414-1.414L3.414 9H15a1 1 0 0 +0 0-2z"> +</path> +</svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-pageUp@2x.png b/third-party/pdfjs/web/images/toolbarButton-pageUp@2x.png Binary files differdeleted file mode 100644 index a5cfd755b..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-pageUp@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-presentationMode-dark.svg b/third-party/pdfjs/web/images/toolbarButton-presentationMode-dark.svg new file mode 100644 index 000000000..13fa9dc7c --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-presentationMode-dark.svg @@ -0,0 +1,2 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" +fill="rgba(255,255,255,1)"><path d="M.5 1H7s0-1 1-1 1 1 1 1h6.5s.5 0 .5.5-.5.5-.5.5H.5S0 2 0 1.5.5 1 .5 1zM1 3h14v7c0 2-1 2-2 2H3c-1 0-2 0-2-2zm5 1v7l6-3.5zM3.72 15.33l.53-2s0-.5.65-.35c.51.13.38.63.38.63l-.53 2s0 .5-.64.35c-.53-.13-.39-.63-.39-.63zM11.24 15.61l-.53-1.99s0-.5.38-.63c.51-.13.64.35.64.35l.53 2s0 .5-.38.63c-.5.13-.64-.35-.65-.35z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-presentationMode.png b/third-party/pdfjs/web/images/toolbarButton-presentationMode.png Binary files differdeleted file mode 100644 index 3ac21244d..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-presentationMode.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-presentationMode.svg b/third-party/pdfjs/web/images/toolbarButton-presentationMode.svg new file mode 100644 index 000000000..3f1f832e5 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-presentationMode.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M.5 1H7s0-1 1-1 1 1 1 1h6.5s.5 0 .5.5-.5.5-.5.5H.5S0 2 0 1.5.5 1 .5 1zM1 3h14v7c0 2-1 2-2 2H3c-1 0-2 0-2-2zm5 1v7l6-3.5zM3.72 15.33l.53-2s0-.5.65-.35c.51.13.38.63.38.63l-.53 2s0 .5-.64.35c-.53-.13-.39-.63-.39-.63zM11.24 15.61l-.53-1.99s0-.5.38-.63c.51-.13.64.35.64.35l.53 2s0 .5-.38.63c-.5.13-.64-.35-.65-.35z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-presentationMode@2x.png b/third-party/pdfjs/web/images/toolbarButton-presentationMode@2x.png Binary files differdeleted file mode 100644 index cada9e791..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-presentationMode@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-print-dark.svg b/third-party/pdfjs/web/images/toolbarButton-print-dark.svg new file mode 100644 index 000000000..ad37022f0 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-print-dark.svg @@ -0,0 +1,5 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" +fill="rgba(255,255,255,1)"><path d="M14 5h-1V1a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v4H2a2 2 0 0 0-2 2v5h3v3a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-3h3V7a2 2 0 0 0-2-2zM2.5 8a.5.5 0 1 1 .5-.5.5.5 0 0 1-.5.5zm9.5 7H4v-5h8zm0-10H4V1h8zm-6.5 7h4a.5.5 0 0 0 0-1h-4a.5.5 0 1 0 0 1zm0 2h5a.5.5 0 0 0 0-1h-5a.5.5 0 1 0 0 1z"></path></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-print.png b/third-party/pdfjs/web/images/toolbarButton-print.png Binary files differdeleted file mode 100644 index 51275e54b..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-print.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-print.svg b/third-party/pdfjs/web/images/toolbarButton-print.svg new file mode 100644 index 000000000..d521c9ad2 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-print.svg @@ -0,0 +1,4 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M14 5h-1V1a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v4H2a2 2 0 0 0-2 2v5h3v3a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-3h3V7a2 2 0 0 0-2-2zM2.5 8a.5.5 0 1 1 .5-.5.5.5 0 0 1-.5.5zm9.5 7H4v-5h8zm0-10H4V1h8zm-6.5 7h4a.5.5 0 0 0 0-1h-4a.5.5 0 1 0 0 1zm0 2h5a.5.5 0 0 0 0-1h-5a.5.5 0 1 0 0 1z"></path></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-print@2x.png b/third-party/pdfjs/web/images/toolbarButton-print@2x.png Binary files differdeleted file mode 100644 index 53d18daf7..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-print@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-search-dark.svg b/third-party/pdfjs/web/images/toolbarButton-search-dark.svg new file mode 100644 index 000000000..cec8a4206 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-search-dark.svg @@ -0,0 +1,5 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" +fill="rgba(255,255,255,1)"><path d="M15.707 14.293l-4.822-4.822a6.019 6.019 0 1 0-1.414 1.414l4.822 4.822a1 1 0 0 0 1.414-1.414zM6 10a4 4 0 1 1 4-4 4 4 0 0 1-4 4z"></path></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-search.png b/third-party/pdfjs/web/images/toolbarButton-search.png Binary files differdeleted file mode 100644 index f9b75579b..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-search.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-search.svg b/third-party/pdfjs/web/images/toolbarButton-search.svg new file mode 100644 index 000000000..28b7774eb --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-search.svg @@ -0,0 +1,4 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M15.707 14.293l-4.822-4.822a6.019 6.019 0 1 0-1.414 1.414l4.822 4.822a1 1 0 0 0 1.414-1.414zM6 10a4 4 0 1 1 4-4 4 4 0 0 1-4 4z"></path></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-search@2x.png b/third-party/pdfjs/web/images/toolbarButton-search@2x.png Binary files differdeleted file mode 100644 index 456b13324..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-search@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-secondaryToolbarToggle-dark.svg b/third-party/pdfjs/web/images/toolbarButton-secondaryToolbarToggle-dark.svg new file mode 100644 index 000000000..0160c07cd --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-secondaryToolbarToggle-dark.svg @@ -0,0 +1,5 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" +fill="rgba(255,255,255,1)"><path d="M8.707 7.293l-5-5a1 1 0 0 0-1.414 1.414L6.586 8l-4.293 4.293a1 1 0 1 0 1.414 1.414l5-5a1 1 0 0 0 0-1.414zm6 0l-5-5a1 1 0 0 0-1.414 1.414L12.586 8l-4.293 4.293a1 1 0 1 0 1.414 1.414l5-5a1 1 0 0 0 0-1.414z"></path></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-secondaryToolbarToggle.png b/third-party/pdfjs/web/images/toolbarButton-secondaryToolbarToggle.png Binary files differdeleted file mode 100644 index 1f90f83da..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-secondaryToolbarToggle.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-secondaryToolbarToggle.svg b/third-party/pdfjs/web/images/toolbarButton-secondaryToolbarToggle.svg new file mode 100644 index 000000000..dbef23804 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-secondaryToolbarToggle.svg @@ -0,0 +1,4 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M8.707 7.293l-5-5a1 1 0 0 0-1.414 1.414L6.586 8l-4.293 4.293a1 1 0 1 0 1.414 1.414l5-5a1 1 0 0 0 0-1.414zm6 0l-5-5a1 1 0 0 0-1.414 1.414L12.586 8l-4.293 4.293a1 1 0 1 0 1.414 1.414l5-5a1 1 0 0 0 0-1.414z"></path></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-secondaryToolbarToggle@2x.png b/third-party/pdfjs/web/images/toolbarButton-secondaryToolbarToggle@2x.png Binary files differdeleted file mode 100644 index b066fe5cb..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-secondaryToolbarToggle@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-sidebarToggle-dark.svg b/third-party/pdfjs/web/images/toolbarButton-sidebarToggle-dark.svg new file mode 100644 index 000000000..0118e41a8 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-sidebarToggle-dark.svg @@ -0,0 +1,5 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" +fill="rgba(255,255,255,1)"><path d="M3 1h10a3.008 3.008 0 0 1 3 3v8a3.009 3.009 0 0 1-3 3H3a3.005 3.005 0 0 1-3-3V4a3.013 3.013 0 0 1 3-3zm11 11V4a1 1 0 0 0-1-1H8v10h5a1 1 0 0 0 1-1zM2 12a1 1 0 0 0 1 1h4V3H3a1 1 0 0 0-1 1v8z"></path><path d="M3.5 5h2a.5.5 0 0 0 0-1h-2a.5.5 0 0 0 0 1zm0 2h2a.5.5 0 0 0 0-1h-2a.5.5 0 0 0 0 1zm1 2h1a.5.5 0 0 0 0-1h-1a.5.5 0 0 0 0 1z"></path></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-sidebarToggle.png b/third-party/pdfjs/web/images/toolbarButton-sidebarToggle.png Binary files differdeleted file mode 100644 index 025dc9040..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-sidebarToggle.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-sidebarToggle.svg b/third-party/pdfjs/web/images/toolbarButton-sidebarToggle.svg new file mode 100644 index 000000000..691c41cb1 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-sidebarToggle.svg @@ -0,0 +1,4 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M3 1h10a3.008 3.008 0 0 1 3 3v8a3.009 3.009 0 0 1-3 3H3a3.005 3.005 0 0 1-3-3V4a3.013 3.013 0 0 1 3-3zm11 11V4a1 1 0 0 0-1-1H8v10h5a1 1 0 0 0 1-1zM2 12a1 1 0 0 0 1 1h4V3H3a1 1 0 0 0-1 1v8z"></path><path d="M3.5 5h2a.5.5 0 0 0 0-1h-2a.5.5 0 0 0 0 1zm0 2h2a.5.5 0 0 0 0-1h-2a.5.5 0 0 0 0 1zm1 2h1a.5.5 0 0 0 0-1h-1a.5.5 0 0 0 0 1z"></path></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-sidebarToggle@2x.png b/third-party/pdfjs/web/images/toolbarButton-sidebarToggle@2x.png Binary files differdeleted file mode 100644 index 7f834df94..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-sidebarToggle@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-viewAttachments-dark.svg b/third-party/pdfjs/web/images/toolbarButton-viewAttachments-dark.svg new file mode 100644 index 000000000..c9714fdea --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-viewAttachments-dark.svg @@ -0,0 +1,2 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" +fill="rgba(255,255,255,1)"><path d="M6.2 2s.5-.5 1.06 0c.5.5 0 1 0 1l-4.6 4.61s-2.5 2.5 0 5 5 0 5 0L13.8 6.4s1.6-1.6 0-3.2-3.2 0-3.2 0L5.8 8s-.7.7 0 1.4 1.4 0 1.4 0l3.9-3.9s.6-.5 1 0c.5.5 0 1 0 1l-3.8 4s-1.8 1.8-3.5 0C3 8.7 4.8 7 4.8 7l4.7-4.9s2.7-2.6 5.3 0c2.6 2.6 0 5.3 0 5.3l-6.2 6.3s-3.5 3.5-7 0 0-7 0-7z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-viewAttachments.png b/third-party/pdfjs/web/images/toolbarButton-viewAttachments.png Binary files differdeleted file mode 100644 index fcd0b268a..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-viewAttachments.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-viewAttachments.svg b/third-party/pdfjs/web/images/toolbarButton-viewAttachments.svg new file mode 100644 index 000000000..e914ec083 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-viewAttachments.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"><path d="M6.2 2s.5-.5 1.06 0c.5.5 0 1 0 1l-4.6 4.61s-2.5 2.5 0 5 5 0 5 0L13.8 6.4s1.6-1.6 0-3.2-3.2 0-3.2 0L5.8 8s-.7.7 0 1.4 1.4 0 1.4 0l3.9-3.9s.6-.5 1 0c.5.5 0 1 0 1l-3.8 4s-1.8 1.8-3.5 0C3 8.7 4.8 7 4.8 7l4.7-4.9s2.7-2.6 5.3 0c2.6 2.6 0 5.3 0 5.3l-6.2 6.3s-3.5 3.5-7 0 0-7 0-7z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-viewAttachments@2x.png b/third-party/pdfjs/web/images/toolbarButton-viewAttachments@2x.png Binary files differdeleted file mode 100644 index 4a5e2b8a3..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-viewAttachments@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-viewLayers-dark.svg b/third-party/pdfjs/web/images/toolbarButton-viewLayers-dark.svg new file mode 100644 index 000000000..76b042a95 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-viewLayers-dark.svg @@ -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>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-viewLayers.svg b/third-party/pdfjs/web/images/toolbarButton-viewLayers.svg new file mode 100644 index 000000000..e8687b770 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-viewLayers.svg @@ -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>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-viewOutline-dark.svg b/third-party/pdfjs/web/images/toolbarButton-viewOutline-dark.svg new file mode 100644 index 000000000..1704d961a --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-viewOutline-dark.svg @@ -0,0 +1,2 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" +fill="rgba(255,255,255,1)"><path d="M14 9H8c-1.3 0-1.3 2 0 2h6c1.3 0 1.3-2 0-2zm0-8H5C3.7 1 3.7 3 5 3h9c1.3 0 1.3-2 0-2zM2 1C1 1 .7 2 1.3 2.7 2 3.3 3 3 3 2c0-.5-.4-1-1-1zm3 8c-1 0-1.3 1-.7 1.7.6.6 1.7.2 1.7-.7 0-.5-.4-1-1-1zM14 5H5C3.6 5 3.6 7 5 7h9c1.3 0 1.3-2 0-2zM2 5c-.9 0-1.4 1-.7 1.7C2 7.3 3 6.9 3 6c0-.6-.5-1-1-1zM14 13H5c-1.3 0-1.3 2 0 2h9c1.3 0 1.3-2 0-2zM2 13c-1 0-1.3 1-.7 1.7.7.6 1.7.2 1.7-.712 0-.5-.4-1-1-1z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-viewOutline.png b/third-party/pdfjs/web/images/toolbarButton-viewOutline.png Binary files differdeleted file mode 100644 index 976365a50..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-viewOutline.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-viewOutline.svg b/third-party/pdfjs/web/images/toolbarButton-viewOutline.svg new file mode 100644 index 000000000..030c28dfe --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-viewOutline.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"><path d="M14 9H8c-1.3 0-1.3 2 0 2h6c1.3 0 1.3-2 0-2zm0-8H5C3.7 1 3.7 3 5 3h9c1.3 0 1.3-2 0-2zM2 1C1 1 .7 2 1.3 2.7 2 3.3 3 3 3 2c0-.5-.4-1-1-1zm3 8c-1 0-1.3 1-.7 1.7.6.6 1.7.2 1.7-.7 0-.5-.4-1-1-1zM14 5H5C3.6 5 3.6 7 5 7h9c1.3 0 1.3-2 0-2zM2 5c-.9 0-1.4 1-.7 1.7C2 7.3 3 6.9 3 6c0-.6-.5-1-1-1zM14 13H5c-1.3 0-1.3 2 0 2h9c1.3 0 1.3-2 0-2zM2 13c-1 0-1.3 1-.7 1.7.7.6 1.7.2 1.7-.712 0-.5-.4-1-1-1z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-viewOutline@2x.png b/third-party/pdfjs/web/images/toolbarButton-viewOutline@2x.png Binary files differdeleted file mode 100644 index b6a197fdf..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-viewOutline@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-viewThumbnail-dark.svg b/third-party/pdfjs/web/images/toolbarButton-viewThumbnail-dark.svg new file mode 100644 index 000000000..17c55f7b8 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-viewThumbnail-dark.svg @@ -0,0 +1,5 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" +fill="rgba(255,255,255,1)"><g style="--darkreader-inline-fill:rgba(81, 82, 83, 0.8);" data-darkreader-inline-fill=""><rect x="1" y="1" width="6" height="6" rx="1" ry="1"></rect><rect x="9" y="1" width="6" height="6" rx="1" ry="1"></rect><rect x="1" y="9" width="6" height="6" rx="1" ry="1"></rect><rect x="9" y="9" width="6" height="6" rx="1" ry="1"></rect></g></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-viewThumbnail.png b/third-party/pdfjs/web/images/toolbarButton-viewThumbnail.png Binary files differdeleted file mode 100644 index 584ba5588..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-viewThumbnail.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-viewThumbnail.svg b/third-party/pdfjs/web/images/toolbarButton-viewThumbnail.svg new file mode 100644 index 000000000..b997ec49a --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-viewThumbnail.svg @@ -0,0 +1,4 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><g style="--darkreader-inline-fill:rgba(81, 82, 83, 0.8);" data-darkreader-inline-fill=""><rect x="1" y="1" width="6" height="6" rx="1" ry="1"></rect><rect x="9" y="1" width="6" height="6" rx="1" ry="1"></rect><rect x="1" y="9" width="6" height="6" rx="1" ry="1"></rect><rect x="9" y="9" width="6" height="6" rx="1" ry="1"></rect></g></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-viewThumbnail@2x.png b/third-party/pdfjs/web/images/toolbarButton-viewThumbnail@2x.png Binary files differdeleted file mode 100644 index a0208b413..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-viewThumbnail@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-zoomIn-dark.svg b/third-party/pdfjs/web/images/toolbarButton-zoomIn-dark.svg new file mode 100644 index 000000000..9b615541e --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-zoomIn-dark.svg @@ -0,0 +1,5 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" +fill="rgba(255,255,255,1)"><path d="M14 7H9V2a1 1 0 0 0-2 0v5H2a1 1 0 0 0 0 2h5v5a1 1 0 0 0 2 0V9h5a1 1 0 0 0 0-2z"></path></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-zoomIn.png b/third-party/pdfjs/web/images/toolbarButton-zoomIn.png Binary files differdeleted file mode 100644 index 513d081bc..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-zoomIn.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-zoomIn.svg b/third-party/pdfjs/web/images/toolbarButton-zoomIn.svg new file mode 100644 index 000000000..480d2cef0 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-zoomIn.svg @@ -0,0 +1,4 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M14 7H9V2a1 1 0 0 0-2 0v5H2a1 1 0 0 0 0 2h5v5a1 1 0 0 0 2 0V9h5a1 1 0 0 0 0-2z"></path></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-zoomIn@2x.png b/third-party/pdfjs/web/images/toolbarButton-zoomIn@2x.png Binary files differdeleted file mode 100644 index d5d49d5ff..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-zoomIn@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-zoomOut-dark.svg b/third-party/pdfjs/web/images/toolbarButton-zoomOut-dark.svg new file mode 100644 index 000000000..0fb3594d1 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-zoomOut-dark.svg @@ -0,0 +1,5 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" +fill="rgba(255,255,255,1)"><rect x="2" y="7" width="12" height="2" rx="1"></rect></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-zoomOut.png b/third-party/pdfjs/web/images/toolbarButton-zoomOut.png Binary files differdeleted file mode 100644 index 156c26b94..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-zoomOut.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/toolbarButton-zoomOut.svg b/third-party/pdfjs/web/images/toolbarButton-zoomOut.svg new file mode 100644 index 000000000..527f52106 --- /dev/null +++ b/third-party/pdfjs/web/images/toolbarButton-zoomOut.svg @@ -0,0 +1,4 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><rect x="2" y="7" width="12" height="2" rx="1"></rect></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/toolbarButton-zoomOut@2x.png b/third-party/pdfjs/web/images/toolbarButton-zoomOut@2x.png Binary files differdeleted file mode 100644 index 959e1919d..000000000 --- a/third-party/pdfjs/web/images/toolbarButton-zoomOut@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/treeitem-collapsed-dark.svg b/third-party/pdfjs/web/images/treeitem-collapsed-dark.svg new file mode 100644 index 000000000..1fb655162 --- /dev/null +++ b/third-party/pdfjs/web/images/treeitem-collapsed-dark.svg @@ -0,0 +1,2 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" +fill="rgba(255,255,255,1)"><path d="M13 9L6 5v8z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/treeitem-collapsed.png b/third-party/pdfjs/web/images/treeitem-collapsed.png Binary files differdeleted file mode 100644 index 06d4d3769..000000000 --- a/third-party/pdfjs/web/images/treeitem-collapsed.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/treeitem-collapsed.svg b/third-party/pdfjs/web/images/treeitem-collapsed.svg new file mode 100644 index 000000000..831cddfc8 --- /dev/null +++ b/third-party/pdfjs/web/images/treeitem-collapsed.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M13 9L6 5v8z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/treeitem-collapsed@2x.png b/third-party/pdfjs/web/images/treeitem-collapsed@2x.png Binary files differdeleted file mode 100644 index eec1e58c1..000000000 --- a/third-party/pdfjs/web/images/treeitem-collapsed@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/treeitem-expanded-dark.svg b/third-party/pdfjs/web/images/treeitem-expanded-dark.svg new file mode 100644 index 000000000..695b0aa61 --- /dev/null +++ b/third-party/pdfjs/web/images/treeitem-expanded-dark.svg @@ -0,0 +1,2 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" +fill="rgba(255,255,255,1)"><path d="M10 13l4-7H6z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/treeitem-expanded.png b/third-party/pdfjs/web/images/treeitem-expanded.png Binary files differdeleted file mode 100644 index c8d557351..000000000 --- a/third-party/pdfjs/web/images/treeitem-expanded.png +++ /dev/null diff --git a/third-party/pdfjs/web/images/treeitem-expanded.svg b/third-party/pdfjs/web/images/treeitem-expanded.svg new file mode 100644 index 000000000..2d45f0c8d --- /dev/null +++ b/third-party/pdfjs/web/images/treeitem-expanded.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M10 13l4-7H6z"/></svg>
\ No newline at end of file diff --git a/third-party/pdfjs/web/images/treeitem-expanded@2x.png b/third-party/pdfjs/web/images/treeitem-expanded@2x.png Binary files differdeleted file mode 100644 index 3b3b6103b..000000000 --- a/third-party/pdfjs/web/images/treeitem-expanded@2x.png +++ /dev/null diff --git a/third-party/pdfjs/web/locale/ach/viewer.properties b/third-party/pdfjs/web/locale/ach/viewer.properties index 57c6a9121..46e36fb7e 100644 --- a/third-party/pdfjs/web/locale/ach/viewer.properties +++ b/third-party/pdfjs/web/locale/ach/viewer.properties @@ -204,4 +204,3 @@ password_cancel=Juki printing_not_supported=Ciko: Layeny ma pe teno goyo liweng. printing_not_ready=Ciko: PDF pe ocane weng me agoya. web_fonts_disabled=Kijuko dit pa coc me kakube woko: pe romo tic ki dit pa coc me PDF ma kiketo i kine. -document_colors_not_allowed=Pe ki yee ki gin acoya me PDF me tic ki rangi gi kengi: Kijuko woko “Yee pot buk me yero rangi mamegi kengi†ki i layeny. diff --git a/third-party/pdfjs/web/locale/af/viewer.properties b/third-party/pdfjs/web/locale/af/viewer.properties index 8cf088087..c7d6c42b4 100644 --- a/third-party/pdfjs/web/locale/af/viewer.properties +++ b/third-party/pdfjs/web/locale/af/viewer.properties @@ -181,4 +181,3 @@ password_cancel=Kanselleer printing_not_supported=Waarskuwing: Dié blaaier ondersteun nie drukwerk ten volle nie. printing_not_ready=Waarskuwing: Die PDF is nog nie volledig gelaai vir drukwerk nie. web_fonts_disabled=Webfonte is gedeaktiveer: kan nie PDF-fonte wat ingebed is, gebruik nie. -document_colors_not_allowed=PDF-dokumente word nie toegelaat om hul eie kleure te gebruik nie: “Laat bladsye toe om hul eie kleure te kies†is gedeaktiveer in die blaaier. diff --git a/third-party/pdfjs/web/locale/an/viewer.properties b/third-party/pdfjs/web/locale/an/viewer.properties index 35761347a..7e3504c77 100644 --- a/third-party/pdfjs/web/locale/an/viewer.properties +++ b/third-party/pdfjs/web/locale/an/viewer.properties @@ -181,4 +181,3 @@ password_cancel=Cancelar printing_not_supported=Pare cuenta: Iste navegador no maneya totalment as impresions. printing_not_ready=Aviso: Encara no se ha cargau completament o PDF ta imprentar-lo. web_fonts_disabled=As fuents web son desactivadas: no se puet incrustar fichers PDF. -document_colors_not_allowed=Los documentos PDF no pueden fer servir las suyas propias colors: 'Permitir que as pachinas triguen as suyas propias colors' ye desactivau en o navegador. diff --git a/third-party/pdfjs/web/locale/ar/viewer.properties b/third-party/pdfjs/web/locale/ar/viewer.properties index b42ba74c2..cffa8bec5 100644 --- a/third-party/pdfjs/web/locale/ar/viewer.properties +++ b/third-party/pdfjs/web/locale/ar/viewer.properties @@ -243,4 +243,3 @@ password_cancel=ألغ٠printing_not_supported=تØذير: لا يدعم هذا المتصÙØ Ø§Ù„Ø·Ø¨Ø§Ø¹Ø© بشكل كامل. printing_not_ready=تØذير: مل٠PDF لم ÙŠÙØمّل كاملًا للطباعة. web_fonts_disabled=خطوط الوب Ù…Ùعطّلة: تعذّر استخدام خطوط PDF المÙضمّنة. -document_colors_not_allowed=ليس مسموØًا لملÙات PDF باستخدام ألوانها الخاصة: خيار â€Ø§Ø³Ù…Ø Ù„Ù„ØµÙØات باختيار ألوانها الخاصة“ ليس Ù…ÙÙعّلًا ÙÙŠ المتصÙØ. diff --git a/third-party/pdfjs/web/locale/ast/viewer.properties b/third-party/pdfjs/web/locale/ast/viewer.properties index db66a5675..5f6d5e7c0 100644 --- a/third-party/pdfjs/web/locale/ast/viewer.properties +++ b/third-party/pdfjs/web/locale/ast/viewer.properties @@ -204,4 +204,3 @@ password_cancel=Encaboxar printing_not_supported=Alvertencia: La imprentación entá nun ta sofitada dafechu nesti restolador. printing_not_ready=Avisu: Esti PDF nun se cargó completamente pa poder imprentase. web_fonts_disabled=Les fontes web tán desactivaes: ye imposible usar les fontes PDF embebÃes. -document_colors_not_allowed=Los documentos PDF nun tienen permisu pa usar les sos colores: «Permitir que les páxines escueyan les sos colores» ta desactivao nel restolador. diff --git a/third-party/pdfjs/web/locale/az/viewer.properties b/third-party/pdfjs/web/locale/az/viewer.properties index 2c27d1246..8f61d9641 100644 --- a/third-party/pdfjs/web/locale/az/viewer.properties +++ b/third-party/pdfjs/web/locale/az/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Ləğv et printing_not_supported=XÉ™bÉ™rdarlıq: Çap bu sÉ™yyah tÉ™rÉ™findÉ™n tam olaraq dÉ™stÉ™klÉ™nmir. printing_not_ready=XÉ™bÉ™rdarlıq: PDF çap üçün tam yüklÉ™nmÉ™yib. web_fonts_disabled=Web ÅžriftlÉ™r söndürülüb: yerləşdirilmiÅŸ PDF ÅŸriftlÉ™rini istifadÉ™ etmÉ™k mümkün deyil. -document_colors_not_allowed=PDF sÉ™nÉ™dlÉ™rÉ™ öz rÉ™nglÉ™rini iÅŸlÉ™tmÉ™yÉ™ icazÉ™ verilmir: “SÉ™hifÉ™lÉ™rÉ™ öz rÉ™nglÉ™rini istifadÉ™ etmÉ™yÉ™ icazÉ™ verâ€mÉ™ sÉ™yyahda söndürülüb. diff --git a/third-party/pdfjs/web/locale/be/viewer.properties b/third-party/pdfjs/web/locale/be/viewer.properties index 67cd0126e..6ac719288 100644 --- a/third-party/pdfjs/web/locale/be/viewer.properties +++ b/third-party/pdfjs/web/locale/be/viewer.properties @@ -245,4 +245,3 @@ password_cancel=СкаÑаваць printing_not_supported=ПапÑÑ€Ñджанне: друк не падтрымліваецца цалкам гÑтым браўзерам. printing_not_ready=Увага: PDF не ÑцÑгнуты цалкам Ð´Ð»Ñ Ð´Ñ€ÑƒÐºÐ°Ð²Ð°Ð½Ð½Ñ. web_fonts_disabled=Шрыфты Сеціва забаронены: немагчыма ўжываць ÑƒÐºÐ»Ð°Ð´Ð·ÐµÐ½Ñ‹Ñ ÑˆÑ€Ñ‹Ñ„Ñ‚Ñ‹ PDF. -document_colors_not_allowed=PDF-дакументам не дазволена выкарыÑтоўваць Ñвае колеры: у браўзеры адключаны параметр "Дазволіць вÑб-Ñайтам выкарыÑтоўваць Ñвае колеры". diff --git a/third-party/pdfjs/web/locale/bg/viewer.properties b/third-party/pdfjs/web/locale/bg/viewer.properties index 713b1138d..b93e3d1e4 100644 --- a/third-party/pdfjs/web/locale/bg/viewer.properties +++ b/third-party/pdfjs/web/locale/bg/viewer.properties @@ -239,4 +239,3 @@ password_cancel=Отказ printing_not_supported=Внимание: Този четец нÑма пълна поддръжка на отпечатване. printing_not_ready=Внимание: Този PDF файл не е напълно зареден за печат. web_fonts_disabled=Уеб-шрифтовете Ñа забранени: разрешаване на използването на вградените PDF шрифтове. -document_colors_not_allowed=Ðа документите от вид PDF не е разрешено да използват ÑобÑтвени цветове: „Разрешаване на Ñтраниците да избират ÑобÑтвени цветове“ е изключено в четеца. diff --git a/third-party/pdfjs/web/locale/bn/viewer.properties b/third-party/pdfjs/web/locale/bn/viewer.properties index 52fec2c35..c106df10c 100644 --- a/third-party/pdfjs/web/locale/bn/viewer.properties +++ b/third-party/pdfjs/web/locale/bn/viewer.properties @@ -243,4 +243,3 @@ password_cancel=বাতিল printing_not_supported=সতরà§à¦•à¦¤à¦¾: à¦à¦‡ বà§à¦°à¦¾à¦‰à¦œà¦¾à¦°à§‡ মà§à¦¦à§à¦°à¦£ সমà§à¦ªà§‚রà§à¦£à¦à¦¾à¦¬à§‡ সমরà§à¦¥à¦¿à¦¤ নয়। printing_not_ready=সতরà§à¦•à§€à¦•à¦°à¦£: পিডিà¦à¦«à¦Ÿà¦¿ মà§à¦¦à§à¦°à¦£à§‡à¦° জনà§à¦¯ সমà§à¦ªà§‚রà§à¦£ লোড হয়নি। web_fonts_disabled=ওয়েব ফনà§à¦Ÿ নিষà§à¦•à§à¦°à¦¿à§Ÿ: সংযà§à¦•à§à¦¤ পিডিà¦à¦« ফনà§à¦Ÿ বà§à¦¯à¦¬à¦¹à¦¾à¦° করা যাচà§à¦›à§‡ না। -document_colors_not_allowed=পিডিà¦à¦« ডকà§à¦®à§‡à¦¨à§à¦Ÿà¦•à§‡ তাদের নিজসà§à¦¬ রঙ বà§à¦¯à¦¬à¦¹à¦¾à¦°à§‡ অনà§à¦®à¦¤à¦¿ নেই: 'পাতা তাদের নিজেসà§à¦¬ রঙ নিরà§à¦¬à¦¾à¦šà¦¨ করতে অনà§à¦®à¦¤à¦¿ দিন' à¦à¦‡ বà§à¦°à¦¾à¦‰à¦œà¦¾à¦°à§‡ নিষà§à¦•à§à¦°à¦¿à§Ÿ রয়েছে। diff --git a/third-party/pdfjs/web/locale/bo/viewer.properties b/third-party/pdfjs/web/locale/bo/viewer.properties index d35c453dd..3ffa84819 100644 --- a/third-party/pdfjs/web/locale/bo/viewer.properties +++ b/third-party/pdfjs/web/locale/bo/viewer.properties @@ -242,4 +242,3 @@ password_cancel=Cancel printing_not_supported=Warning: Printing is not fully supported by this browser. printing_not_ready=Warning: The PDF is not fully loaded for printing. web_fonts_disabled=Web fonts are disabled: unable to use embedded PDF fonts. -document_colors_not_allowed=PDF documents are not allowed to use their own colors: “Allow pages to choose their own colors†is deactivated in the browser. diff --git a/third-party/pdfjs/web/locale/br/viewer.properties b/third-party/pdfjs/web/locale/br/viewer.properties index 14c2a5e4f..9add9a432 100644 --- a/third-party/pdfjs/web/locale/br/viewer.properties +++ b/third-party/pdfjs/web/locale/br/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Nullañ printing_not_supported=Kemenn : N'eo ket skoret penn-da-benn ar moullañ gant ar merdeer-mañ. printing_not_ready=Kemenn : N'hall ket bezañ moullet ar restr PDF rak n'eo ket karget penn-da-benn. web_fonts_disabled=Diweredekaet eo an nodrezhoù web : n'haller ket arverañ an nodrezhoù PDF enframmet. -document_colors_not_allowed=N'eo ket aotreet an teuliadoù PDF da arverañ o livioù dezho : diweredekaet eo “Aotren ar pajennoù da zibab o livioù dezho†e-barzh ar merdeer. diff --git a/third-party/pdfjs/web/locale/brx/viewer.properties b/third-party/pdfjs/web/locale/brx/viewer.properties index 234bca1fe..cd3656380 100644 --- a/third-party/pdfjs/web/locale/brx/viewer.properties +++ b/third-party/pdfjs/web/locale/brx/viewer.properties @@ -208,4 +208,3 @@ password_cancel=नेवसि printing_not_supported=सांगà¥à¤°à¤¾à¤‚थि: साफायनाया बे बà¥à¤°à¤¾à¤‰à¤œà¤¾à¤°à¤œà¥‹à¤‚ आबà¥à¤™à¥ˆ हेफाजाब होजाया। printing_not_ready=सांगà¥à¤°à¤¾à¤‚थि: PDF खौ साफायनायनि थाखाय फà¥à¤°à¤¾à¤¯à¥ˆ ल'ड खालामाखै। web_fonts_disabled=वेब फनà¥à¤Ÿà¤–ौ लोरबां खालामबाय: अरजाबहोनाय PDF फनà¥à¤Ÿà¤–ौ बाहायनो हायाखै। -document_colors_not_allowed=PDF फोरमान बिलाइखौ बिसोरनि निजि गाब बाहायनो गनायथि होनाय जाया: 'बिसोरनि निजि गाब बासिखनो बिलाइखौ गनायथि हो'-खौ बà¥à¤°à¤¾à¤‰à¤œà¤¾à¤°à¤†à¤µ लोरबां खालामनाय जायो। diff --git a/third-party/pdfjs/web/locale/bs/viewer.properties b/third-party/pdfjs/web/locale/bs/viewer.properties index 6c2122b82..e5346cb0c 100644 --- a/third-party/pdfjs/web/locale/bs/viewer.properties +++ b/third-party/pdfjs/web/locale/bs/viewer.properties @@ -198,4 +198,3 @@ password_cancel=Otkaži printing_not_supported=Upozorenje: Å tampanje nije u potpunosti podržano u ovom browseru. printing_not_ready=Upozorenje: PDF nije u potpunosti uÄitan za Å¡tampanje. web_fonts_disabled=Web fontovi su onemogućeni: nemoguće koristiti ubaÄene PDF fontove. -document_colors_not_allowed=PDF dokumentima nije dozvoljeno da koriste vlastite boje: 'Dozvoli stranicama da izaberu vlastite boje' je deaktivirano u browseru. diff --git a/third-party/pdfjs/web/locale/ca/viewer.properties b/third-party/pdfjs/web/locale/ca/viewer.properties index 924637aaf..ac6fb779f 100644 --- a/third-party/pdfjs/web/locale/ca/viewer.properties +++ b/third-party/pdfjs/web/locale/ca/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Cancel·la printing_not_supported=AvÃs: la impressió no és plenament funcional en aquest navegador. printing_not_ready=Atenció: el PDF no s'ha acabat de carregar per imprimir-lo. web_fonts_disabled=Els tipus de lletra web estan desactivats: no es poden utilitzar els tipus de lletra incrustats al PDF. -document_colors_not_allowed=Els documents PDF no poden usar els seus colors propis: «Permet a les pà gines triar els colors propis» es troba desactivat al navegador. diff --git a/third-party/pdfjs/web/locale/cak/viewer.properties b/third-party/pdfjs/web/locale/cak/viewer.properties index c105d8252..d4eae51a8 100644 --- a/third-party/pdfjs/web/locale/cak/viewer.properties +++ b/third-party/pdfjs/web/locale/cak/viewer.properties @@ -14,7 +14,7 @@ # Main toolbar buttons (tooltips and alt text for images) previous.title=Jun kan ruxaq -previous_label=Chuwäch +previous_label=Jun kan next.title=Jun chik ruxaq next_label=Jun chik @@ -35,7 +35,7 @@ zoom_in_label=Tinimirisäx zoom.title=Sum presentation_mode.title=Tijal ri rub'anikil niwachin presentation_mode_label=Pa rub'eyal niwachin -open_file.title=Tijaq yakb'äl +open_file.title=Tijaq Yakb'äl open_file_label=Tijaq print.title=Titz'ajb'äx print_label=Titz'ajb'äx @@ -111,7 +111,7 @@ document_properties_page_size_orientation_landscape=rukotz'olem document_properties_page_size_name_a3=A3 document_properties_page_size_name_a4=A4 document_properties_page_size_name_letter=Loman wuj -document_properties_page_size_name_legal=Nïm wuj +document_properties_page_size_name_legal=Taqanel tzijol # LOCALIZATION NOTE (document_properties_page_size_dimension_string): # "{{width}}", "{{height}}", {{unit}}, and {{orientation}} will be replaced by # the size, respectively their unit of measurement and orientation, of the (current) page. @@ -216,7 +216,7 @@ rendering_error=Xk'ulwachitäj jun sachoj toq ninuk'wachij ri ruxaq. page_scale_width=Ruwa ruxaq page_scale_fit=Tinuk' ruxaq page_scale_auto=Yonil chi nimilem -page_scale_actual=Runimilem +page_scale_actual=Runimilem Wakami # LOCALIZATION NOTE (page_scale_percent): "{{scale}}" will be replaced by a # numerical scale value. page_scale_percent={{scale}}% @@ -245,4 +245,3 @@ password_cancel=Tiq'at printing_not_supported=Rutzijol k'ayewal: Ri rutz'ajb'axik man koch'el ta ronojel pa re okik'amaya'l re'. printing_not_ready=Rutzijol k'ayewal: Ri PDF man xusamajij ta ronojel richin nitz'ajb'äx. web_fonts_disabled=E chupül ri taq ajk'amaya'l tz'ib': man tikirel ta nokisäx ri taq tz'ib' PDF pa ch'ikenïk -document_colors_not_allowed=Ri taq wuj pa PDF man ya'on ta q'ij chi ke richin nikokisaj ri taq kib'onil: “Tiya' q'ij chi ke ri taq ruxaq chi kekicha' ri taq kib'onil†chupun pa ri awokik'amaya'l. diff --git a/third-party/pdfjs/web/locale/ckb/viewer.properties b/third-party/pdfjs/web/locale/ckb/viewer.properties new file mode 100644 index 000000000..d1bed431b --- /dev/null +++ b/third-party/pdfjs/web/locale/ckb/viewer.properties @@ -0,0 +1,111 @@ +# Copyright 2012 Mozilla Foundation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Main toolbar buttons (tooltips and alt text for images) +next.title=Ù¾Û•Ú•Û•ÛŒ دوواتر +next_label=دوواتر + +# LOCALIZATION NOTE (page.title): The tooltip for the pageNumber input. +page.title=پەرە +# LOCALIZATION NOTE (of_pages): "{{pagesCount}}" will be replaced by a number +# representing the total number of pages in the document. +# LOCALIZATION NOTE (page_of_pages): "{{pageNumber}}" and "{{pagesCount}}" +# will be replaced by a number representing the currently visible page, +# respectively a number representing the total number of pages in the document. + +open_file.title=Ù¾Û•Ú•Ú¯Û• بکەرەوە +open_file_label=کردنەوە +print.title=چاپکردن +download.title=داگرتن + +# Secondary toolbar and context menu +tools.title=ئامرازەکان +first_page.title=برۆ بۆ یەکەم Ù¾Û•Ú•Û• + + + + +# Document properties dialog box +document_properties_file_name=ناوی Ù¾Û•Ú•Ú¯Û•: +document_properties_file_size=قەبارەی Ù¾Û•Ú•Ú¯Û•: +# LOCALIZATION NOTE (document_properties_kb): "{{size_kb}}" and "{{size_b}}" +# will be replaced by the PDF file size in kilobytes, respectively in bytes. +# LOCALIZATION NOTE (document_properties_mb): "{{size_mb}}" and "{{size_b}}" +# will be replaced by the PDF file size in megabytes, respectively in bytes. +document_properties_title=سەردێڕ: +document_properties_author=نووسەر +document_properties_keywords=کلیلەوشە: +# LOCALIZATION NOTE (document_properties_date_string): "{{date}}" and "{{time}}" +# will be replaced by the creation/modification date, and time, of the PDF file. +# LOCALIZATION NOTE (document_properties_page_size_dimension_string): +# "{{width}}", "{{height}}", {{unit}}, and {{orientation}} will be replaced by +# the size, respectively their unit of measurement and orientation, of the (current) page. +# LOCALIZATION NOTE (document_properties_page_size_dimension_name_string): +# "{{width}}", "{{height}}", {{unit}}, {{name}}, and {{orientation}} will be replaced by +# the size, respectively their unit of measurement, name, and orientation, of the (current) page. +# LOCALIZATION NOTE (document_properties_linearized): The linearization status of +# the document; usually called "Fast Web View" in English locales of Adobe software. +document_properties_close=داخستن + +# LOCALIZATION NOTE (print_progress_percent): "{{progress}}" will be replaced by +# a numerical per cent value. +print_progress_close=پاشگەزبوونەوە + +# Tooltips and alt text for side panel toolbar buttons +# (the _label strings are alt text for the buttons, the .title strings are +# tooltips) +findbar_label=دۆزینەوە + +# LOCALIZATION NOTE (page_canvas): "{{page}}" will be replaced by the page number. +# Thumbnails panel item (tooltip and alt text for images) +# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page +# number. +# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page +# number. + +# Find panel button title and messages +find_input.title=دۆزینەوە +# LOCALIZATION NOTE (find_match_count): The supported plural forms are +# [one|two|few|many|other], with [other] as the default value. +# "{{current}}" and "{{total}}" will be replaced by a number representing the +# index of the currently active find result, respectively a number representing +# the total number of matches in the document. +# LOCALIZATION NOTE (find_match_count_limit): The supported plural forms are +# [zero|one|two|few|many|other], with [other] as the default value. +# "{{limit}}" will be replaced by a numerical value. + +# Error panel labels +# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be +# replaced by the PDF.JS version and build ID. +# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an +# english string describing the error. +# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack +# trace. +# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename +# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number + +# Predefined zoom values +# LOCALIZATION NOTE (page_scale_percent): "{{scale}}" will be replaced by a +# numerical scale value. + +# Loading indicator messages + +# LOCALIZATION NOTE (annotation_date_string): "{{date}}" and "{{time}}" will be +# replaced by the modification date, and time, of the annotation. + +# 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" + diff --git a/third-party/pdfjs/web/locale/cs/viewer.properties b/third-party/pdfjs/web/locale/cs/viewer.properties index 6310f637c..646f410bb 100644 --- a/third-party/pdfjs/web/locale/cs/viewer.properties +++ b/third-party/pdfjs/web/locale/cs/viewer.properties @@ -245,4 +245,3 @@ password_cancel=ZruÅ¡it printing_not_supported=UpozornÄ›nÃ: Tisk nenà v tomto prohlÞeÄi plnÄ› podporován. printing_not_ready=UpozornÄ›nÃ: Dokument PDF nenà kompletnÄ› naÄten. web_fonts_disabled=Webová pÃsma jsou zakázána, proto nenà možné použÃt vložená pÃsma PDF. -document_colors_not_allowed=PDF dokumenty nemajà povoleno použÃvat vlastnà barvy: volba 'Povolit stránkám použÃvat vlastnà barvy' je v prohlÞeÄi deaktivována. diff --git a/third-party/pdfjs/web/locale/cy/viewer.properties b/third-party/pdfjs/web/locale/cy/viewer.properties index dc4fb2ea4..16cda5fd7 100644 --- a/third-party/pdfjs/web/locale/cy/viewer.properties +++ b/third-party/pdfjs/web/locale/cy/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Diddymu printing_not_supported=Rhybudd: Nid yw argraffu yn cael ei gynnal yn llawn gan y porwr. printing_not_ready=Rhybudd: Nid yw'r PDF wedi ei lwytho'n llawn ar gyfer argraffu. web_fonts_disabled=Ffontiau gwe wedi eu hanalluogi: methu defnyddio ffontiau PDF mewnblanedig. -document_colors_not_allowed=Nid oes caniatâd i ddogfennau PDF i ddefnyddio eu lliwiau eu hunain: Mae “Caniatáu i dudalennau ddefnyddio eu lliwiau eu hunain†wedi ei atal yn y porwr. diff --git a/third-party/pdfjs/web/locale/da/viewer.properties b/third-party/pdfjs/web/locale/da/viewer.properties index 4f05fd980..38ed99d0b 100644 --- a/third-party/pdfjs/web/locale/da/viewer.properties +++ b/third-party/pdfjs/web/locale/da/viewer.properties @@ -33,12 +33,12 @@ zoom_out_label=Zoom ud zoom_in.title=Zoom ind zoom_in_label=Zoom ind zoom.title=Zoom -print.title=Udskriv -print_label=Udskriv presentation_mode.title=Skift til fuldskærmsvisning presentation_mode_label=Fuldskærmsvisning open_file.title=Ã…bn fil open_file_label=Ã…bn +print.title=Udskriv +print_label=Udskriv download.title=Hent download_label=Hent bookmark.title=Aktuel visning (kopier eller Ã¥bn i et nyt vindue) @@ -245,4 +245,3 @@ password_cancel=Fortryd printing_not_supported=Advarsel: Udskrivning er ikke fuldt understøttet af browseren. printing_not_ready=Advarsel: PDF-filen er ikke fuldt indlæst til udskrivning. web_fonts_disabled=Webskrifttyper er deaktiverede. De indlejrede skrifttyper i PDF-filen kan ikke anvendes. -document_colors_not_allowed=PDF-dokumenter mÃ¥ ikke bruge deres egne farver: 'Tillad sider at vælge deres egne farver' er deaktiveret i browseren. diff --git a/third-party/pdfjs/web/locale/de/viewer.properties b/third-party/pdfjs/web/locale/de/viewer.properties index 84240bb20..26b682ebe 100644 --- a/third-party/pdfjs/web/locale/de/viewer.properties +++ b/third-party/pdfjs/web/locale/de/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Abbrechen printing_not_supported=Warnung: Die Drucken-Funktion wird durch diesen Browser nicht vollständig unterstützt. printing_not_ready=Warnung: Die PDF-Datei ist nicht vollständig geladen, dies ist für das Drucken aber empfohlen. web_fonts_disabled=Web-Schriftarten sind deaktiviert: Eingebettete PDF-Schriftarten konnten nicht geladen werden. -document_colors_not_allowed=PDF-Dokumenten ist es nicht erlaubt, ihre eigenen Farben zu verwenden: 'Seiten das Verwenden von eigenen Farben erlauben' ist im Browser deaktiviert. diff --git a/third-party/pdfjs/web/locale/dsb/viewer.properties b/third-party/pdfjs/web/locale/dsb/viewer.properties index eb567ecb6..468ccd745 100644 --- a/third-party/pdfjs/web/locale/dsb/viewer.properties +++ b/third-party/pdfjs/web/locale/dsb/viewer.properties @@ -245,4 +245,3 @@ password_cancel=PÅ›etergnuÅ› printing_not_supported=Warnowanje: Åšišćanje njepódpÄ›ra se poÅ‚nje pÅ›ez toÅ› ten wobglÄ›dowak. printing_not_ready=Warnowanje: PDF njejo se za Å›išćanje dopoÅ‚nje zacytaÅ‚. web_fonts_disabled=Webpisma su znjemóžnjone: njejo móžno, zasajźone PDF-pisma wužywaÅ›. -document_colors_not_allowed=PDF-dokumenty njesmÄ›ju swóje barwy wužywaÅ›: 'Bokam dowóliÅ›, swóje barwy wužywaÅ›' jo we wobglÄ›dowaku znjemóžnjone. diff --git a/third-party/pdfjs/web/locale/el/viewer.properties b/third-party/pdfjs/web/locale/el/viewer.properties index d7a6abc10..896bbeefc 100644 --- a/third-party/pdfjs/web/locale/el/viewer.properties +++ b/third-party/pdfjs/web/locale/el/viewer.properties @@ -148,6 +148,8 @@ thumbs_label=ΜικÏογÏαφίες findbar.title=ΕÏÏεση στο ÎγγÏαφο findbar_label=ΕÏÏεση +# LOCALIZATION NOTE (page_canvas): "{{page}}" will be replaced by the page number. +page_canvas=Σελίδα {{page}} # Thumbnails panel item (tooltip and alt text for images) # LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page # number. @@ -243,4 +245,3 @@ password_cancel=ΑκÏÏωση printing_not_supported=Î Ïοειδοποίηση: Η εκτÏπωση δεν υποστηÏίζεται πλήÏως από αυτόν τον πεÏιηγητή. printing_not_ready=Î Ïοειδοποίηση: Το PDF δεν φοÏτώθηκε πλήÏως για εκτÏπωση. web_fonts_disabled=Οι γÏαμματοσειÏÎÏ‚ Web απενεÏγοποιημÎνες: αδυναμία χÏήσης των ενσωματωμÎνων γÏαμματοσειÏών PDF. -document_colors_not_allowed=Στα PDF ÎγγÏαφα δεν επιτÏÎπεται να χÏησιμοποιοÏν τα δικά τους χÏώματα: Το “Îα επιτÏÎπεται στις σελίδες να επιλÎγουν τα δικά τους χÏώματα†είναι απενεÏγοποιημÎνο στον πεÏιηγητή. diff --git a/third-party/pdfjs/web/locale/en-CA/viewer.properties b/third-party/pdfjs/web/locale/en-CA/viewer.properties index df7a68774..554a0e176 100644 --- a/third-party/pdfjs/web/locale/en-CA/viewer.properties +++ b/third-party/pdfjs/web/locale/en-CA/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Cancel printing_not_supported=Warning: Printing is not fully supported by this browser. printing_not_ready=Warning: The PDF is not fully loaded for printing. web_fonts_disabled=Web fonts are disabled: unable to use embedded PDF fonts. -document_colors_not_allowed=PDF documents are not allowed to use their own colours: “Allow pages to choose their own colours†is deactivated in the browser. diff --git a/third-party/pdfjs/web/locale/en-GB/viewer.properties b/third-party/pdfjs/web/locale/en-GB/viewer.properties index df7a68774..554a0e176 100644 --- a/third-party/pdfjs/web/locale/en-GB/viewer.properties +++ b/third-party/pdfjs/web/locale/en-GB/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Cancel printing_not_supported=Warning: Printing is not fully supported by this browser. printing_not_ready=Warning: The PDF is not fully loaded for printing. web_fonts_disabled=Web fonts are disabled: unable to use embedded PDF fonts. -document_colors_not_allowed=PDF documents are not allowed to use their own colours: “Allow pages to choose their own colours†is deactivated in the browser. diff --git a/third-party/pdfjs/web/locale/en-US/viewer.properties b/third-party/pdfjs/web/locale/en-US/viewer.properties index 6f7598e3d..d31103c00 100644 --- a/third-party/pdfjs/web/locale/en-US/viewer.properties +++ b/third-party/pdfjs/web/locale/en-US/viewer.properties @@ -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) diff --git a/third-party/pdfjs/web/locale/eo/viewer.properties b/third-party/pdfjs/web/locale/eo/viewer.properties index bca7c4568..804bd9842 100644 --- a/third-party/pdfjs/web/locale/eo/viewer.properties +++ b/third-party/pdfjs/web/locale/eo/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Nuligi printing_not_supported=Averto: tiu ĉi retumilo ne plene subtenas presadon. printing_not_ready=Averto: la PDF dosiero ne estas plene Åargita por presado. web_fonts_disabled=Neaktivaj teksaĵaj tiparoj: ne elbas uzi enmetitajn tiparojn de PDF. -document_colors_not_allowed=PDF dokumentoj ne rajtas uzi siajn proprajn kolorojn: 'Permesi al paÄoj uzi siajn proprajn kolorojn' ne estas aktiva en la retumilo. diff --git a/third-party/pdfjs/web/locale/es-AR/viewer.properties b/third-party/pdfjs/web/locale/es-AR/viewer.properties index 1d22fbad6..ca2c87ba6 100644 --- a/third-party/pdfjs/web/locale/es-AR/viewer.properties +++ b/third-party/pdfjs/web/locale/es-AR/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Cancelar printing_not_supported=Advertencia: La impresión no está totalmente soportada por este navegador. printing_not_ready=Advertencia: El PDF no está completamente cargado para impresión. web_fonts_disabled=TipografÃa web deshabilitada: no se pueden usar tipos incrustados en PDF. -document_colors_not_allowed=Los documentos PDF no tienen permitido usar sus propios colores: 'Permitir a las páginas elegir sus propios colores' está desactivado en el navegador. diff --git a/third-party/pdfjs/web/locale/es-CL/viewer.properties b/third-party/pdfjs/web/locale/es-CL/viewer.properties index f7f621f59..b6ac40939 100644 --- a/third-party/pdfjs/web/locale/es-CL/viewer.properties +++ b/third-party/pdfjs/web/locale/es-CL/viewer.properties @@ -210,7 +210,7 @@ error_stack=Pila: {{stack}} error_file=Archivo: {{file}} # LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number error_line=LÃnea: {{line}} -rendering_error=Ha ocurrido un error al renderizar la página. +rendering_error=Ocurrió un error al renderizar la página. # Predefined zoom values page_scale_width=Ancho de página @@ -223,7 +223,7 @@ page_scale_percent={{scale}}% # Loading indicator messages loading_error_indicator=Error -loading_error=Ha ocurrido un error al cargar el PDF. +loading_error=Ocurrió un error al cargar el PDF. invalid_file_error=Archivo PDF inválido o corrupto. missing_file_error=Falta el archivo PDF. unexpected_response_error=Respuesta del servidor inesperada. @@ -245,4 +245,3 @@ password_cancel=Cancelar printing_not_supported=Advertencia: Imprimir no está soportado completamente por este navegador. printing_not_ready=Advertencia: El PDF no está completamente cargado para ser impreso. web_fonts_disabled=Las tipografÃas web están desactivadas: imposible usar las fuentes PDF embebidas. -document_colors_not_allowed=Los documentos PDF no tienen permitido usar sus propios colores: 'Permitir a las páginas elegir sus propios colores' está desactivado en el navegador. diff --git a/third-party/pdfjs/web/locale/es-ES/viewer.properties b/third-party/pdfjs/web/locale/es-ES/viewer.properties index cef373a1f..75e5f0ad4 100644 --- a/third-party/pdfjs/web/locale/es-ES/viewer.properties +++ b/third-party/pdfjs/web/locale/es-ES/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Cancelar printing_not_supported=Advertencia: Imprimir no está totalmente soportado por este navegador. printing_not_ready=Advertencia: Este PDF no se ha cargado completamente para poder imprimirse. web_fonts_disabled=Las tipografÃas web están desactivadas: es imposible usar las tipografÃas PDF embebidas. -document_colors_not_allowed=Los documentos PDF no tienen permitido usar sus propios colores: 'Permitir a las páginas elegir sus propios colores' está desactivado en el navegador. diff --git a/third-party/pdfjs/web/locale/es-MX/viewer.properties b/third-party/pdfjs/web/locale/es-MX/viewer.properties index 88a82826e..5098ad195 100644 --- a/third-party/pdfjs/web/locale/es-MX/viewer.properties +++ b/third-party/pdfjs/web/locale/es-MX/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Cancelar printing_not_supported=Advertencia: La impresión no esta completamente soportada por este navegador. printing_not_ready=Advertencia: El PDF no cargo completamente para impresión. web_fonts_disabled=Las fuentes web están desactivadas: es imposible usar las fuentes PDF embebidas. -document_colors_not_allowed=Los documentos PDF no tienen permiso de usar sus propios colores: 'Permitir que las páginas elijan sus propios colores' esta desactivada en el navegador. diff --git a/third-party/pdfjs/web/locale/et/viewer.properties b/third-party/pdfjs/web/locale/et/viewer.properties index 11f47c1c2..97f2c9bd7 100644 --- a/third-party/pdfjs/web/locale/et/viewer.properties +++ b/third-party/pdfjs/web/locale/et/viewer.properties @@ -243,4 +243,3 @@ password_cancel=Loobu printing_not_supported=Hoiatus: printimine pole selle brauseri poolt täielikult toetatud. printing_not_ready=Hoiatus: PDF pole printimiseks täielikult laaditud. web_fonts_disabled=Veebifondid on keelatud: PDFiga kaasatud fonte pole võimalik kasutada. -document_colors_not_allowed=PDF-dokumentidel pole oma värvide kasutamine lubatud: “Veebilehtedel on lubatud kasutada oma värve†on brauseris deaktiveeritud. diff --git a/third-party/pdfjs/web/locale/eu/viewer.properties b/third-party/pdfjs/web/locale/eu/viewer.properties index e14f5cd38..5700d6019 100644 --- a/third-party/pdfjs/web/locale/eu/viewer.properties +++ b/third-party/pdfjs/web/locale/eu/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Utzi printing_not_supported=Abisua: inprimatzeko euskarria ez da erabatekoa nabigatzaile honetan. printing_not_ready=Abisua: PDFa ez dago erabat kargatuta inprimatzeko. web_fonts_disabled=Webeko letra-tipoak desgaituta daude: ezin dira kapsulatutako PDF letra-tipoak erabili. -document_colors_not_allowed=PDF dokumentuek ez dute beraien koloreak erabiltzeko baimenik: 'Baimendu orriak beraien letra-tipoak aukeratzea' desaktibatuta dago nabigatzailean. diff --git a/third-party/pdfjs/web/locale/fa/viewer.properties b/third-party/pdfjs/web/locale/fa/viewer.properties index e95738c6e..9886b39d2 100644 --- a/third-party/pdfjs/web/locale/fa/viewer.properties +++ b/third-party/pdfjs/web/locale/fa/viewer.properties @@ -220,4 +220,3 @@ password_cancel=لغو printing_not_supported=هشدار: قابلیت چاپ به‌طور کامل در این مرورگر پشتیبانی نمی‌شود. printing_not_ready=اخطار: پرونده PDF بطور کامل بارگیری نشده Ùˆ امکان چاپ وجود ندارد. web_fonts_disabled=Ùونت های تØت وب غیر Ùعال شده اند: امکان استÙاده از نمایش دهنده داخلی PDF وجود ندارد. -document_colors_not_allowed=Ùایلهای PDF اجازه ندارند تا از رنگ‌های خود استÙاده کنند: گزینه «به صÙØات اجازه بده تا از رنگ‌های خود استÙاده کنند» در مرورگر غیر Ùعال است. diff --git a/third-party/pdfjs/web/locale/ff/viewer.properties b/third-party/pdfjs/web/locale/ff/viewer.properties index 2e94346aa..0a081021b 100644 --- a/third-party/pdfjs/web/locale/ff/viewer.properties +++ b/third-party/pdfjs/web/locale/ff/viewer.properties @@ -239,4 +239,3 @@ password_cancel=Haaytu printing_not_supported=Reentino: Winnditagol tammbitaaka no feewi e ndee wanngorde. printing_not_ready=Reentino: PDF oo loowaaki haa timmi ngam winnditagol. web_fonts_disabled=Ponte geese ko daaÆ´aaÉ—e: horiima huutoraade ponte PDF coomtoraaÉ—e. -document_colors_not_allowed=PiilanÉ—e PDF njamiraaka yoo kuutoro goobuuji mum'en keeriiÉ—i: 'Yamir kello yoo kuutoro goobuuki keeriiÉ—i' koko daaÆ´aa e wanngorde ndee. diff --git a/third-party/pdfjs/web/locale/fi/viewer.properties b/third-party/pdfjs/web/locale/fi/viewer.properties index 76bfa13a2..38c40a395 100644 --- a/third-party/pdfjs/web/locale/fi/viewer.properties +++ b/third-party/pdfjs/web/locale/fi/viewer.properties @@ -169,7 +169,7 @@ find_highlight=Korosta kaikki find_match_case_label=Huomioi kirjainkoko find_entire_word_label=Kokonaiset sanat find_reached_top=Päästiin dokumentin alkuun, jatketaan lopusta -find_reached_bottom=Päästiin sivun loppuun, jatketaan alusta +find_reached_bottom=Päästiin dokumentin loppuun, jatketaan alusta # LOCALIZATION NOTE (find_match_count): The supported plural forms are # [one|two|few|many|other], with [other] as the default value. # "{{current}}" and "{{total}}" will be replaced by a number representing the @@ -245,4 +245,3 @@ password_cancel=Peruuta printing_not_supported=Varoitus: Selain ei tue kaikkia tulostustapoja. printing_not_ready=Varoitus: PDF-tiedosto ei ole vielä latautunut kokonaan, eikä sitä voi vielä tulostaa. web_fonts_disabled=Verkkosivujen omat kirjasinlajit on estetty: ei voida käyttää upotettuja PDF-kirjasinlajeja. -document_colors_not_allowed=PDF-dokumenttien ei ole sallittua käyttää omia värejään: Asetusta â€Sivut saavat käyttää omia värejään oletusten sijaan†ei ole valittu selaimen asetuksissa. diff --git a/third-party/pdfjs/web/locale/fr/viewer.properties b/third-party/pdfjs/web/locale/fr/viewer.properties index 7df1d3d51..589a4185c 100644 --- a/third-party/pdfjs/web/locale/fr/viewer.properties +++ b/third-party/pdfjs/web/locale/fr/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Annuler printing_not_supported=Attention : l’impression n’est pas totalement prise en charge par ce navigateur. printing_not_ready=Attention : le PDF n’est pas entièrement chargé pour pouvoir l’imprimer. web_fonts_disabled=Les polices web sont désactivées : impossible d’utiliser les polices intégrées au PDF. -document_colors_not_allowed=Les documents PDF ne peuvent pas utiliser leurs propres couleurs : « Autoriser les pages web à utiliser leurs propres couleurs » est désactivé dans le navigateur. diff --git a/third-party/pdfjs/web/locale/fy-NL/viewer.properties b/third-party/pdfjs/web/locale/fy-NL/viewer.properties index 4d6b18c69..5a506540b 100644 --- a/third-party/pdfjs/web/locale/fy-NL/viewer.properties +++ b/third-party/pdfjs/web/locale/fy-NL/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Annulearje printing_not_supported=Warning: Printen is net folslein stipe troch dizze browser. printing_not_ready=Warning: PDF is net folslein laden om ôf te drukken. web_fonts_disabled=Weblettertypen binne útskeakele: gebrûk fan ynsluten PDF-lettertypen is net mooglik. -document_colors_not_allowed=PDF-dokuminten meie harren eigen kleuren net brûke: ‘Siden tastean om harren eigen kleuren te kiezen’ is útskeakele yn de browser. diff --git a/third-party/pdfjs/web/locale/ga-IE/viewer.properties b/third-party/pdfjs/web/locale/ga-IE/viewer.properties index 62f1a551b..f606e81b0 100644 --- a/third-party/pdfjs/web/locale/ga-IE/viewer.properties +++ b/third-party/pdfjs/web/locale/ga-IE/viewer.properties @@ -181,4 +181,3 @@ password_cancel=Cealaigh printing_not_supported=Rabhadh: Nà thacaÃonn an brabhsálaà le priontáil go hiomlán. printing_not_ready=Rabhadh: Nà féidir an PDF a phriontáil go dtà go mbeidh an cháipéis iomlán lódáilte. web_fonts_disabled=Tá clófhoirne Gréasáin dÃchumasaithe: nà féidir clófhoirne leabaithe PDF a úsáid. -document_colors_not_allowed=NÃl cead ag cáipéisà PDF a ndathanna féin a roghnú: tá “Tabhair cead do leathanaigh a ndathanna féin a roghnú†dÃchumasaithe sa mbrabhsálaÃ. diff --git a/third-party/pdfjs/web/locale/gd/viewer.properties b/third-party/pdfjs/web/locale/gd/viewer.properties index 2712568e8..af4433e3f 100644 --- a/third-party/pdfjs/web/locale/gd/viewer.properties +++ b/third-party/pdfjs/web/locale/gd/viewer.properties @@ -239,4 +239,3 @@ password_cancel=Sguir dheth printing_not_supported=Rabhadh: Chan eil am brabhsair seo a' cur là n-taic ri clò-bhualadh. printing_not_ready=Rabhadh: Cha deach am PDF a luchdadh gu tur airson clò-bhualadh. web_fonts_disabled=Tha cruthan-clò lìn à comas: Chan urrainn dhuinn cruthan-clò PDF leabaichte a chleachdadh. -document_colors_not_allowed=Chan fhaod sgrìobhainnean PDF na dathan aca fhèin a chleachdadh: Tha “Leig le duilleagan na dathan aca fhèin a chleachdadh†à comas sa bhrabhsair. diff --git a/third-party/pdfjs/web/locale/gl/viewer.properties b/third-party/pdfjs/web/locale/gl/viewer.properties index 187dbf155..c3a30fecd 100644 --- a/third-party/pdfjs/web/locale/gl/viewer.properties +++ b/third-party/pdfjs/web/locale/gl/viewer.properties @@ -148,6 +148,8 @@ thumbs_label=Miniaturas findbar.title=Atopar no documento findbar_label=Atopar +# LOCALIZATION NOTE (page_canvas): "{{page}}" will be replaced by the page number. +page_canvas=Páxina {{page}} # Thumbnails panel item (tooltip and alt text for images) # LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page # number. @@ -226,6 +228,10 @@ invalid_file_error=Ficheiro PDF danado ou non válido. missing_file_error=Falta o ficheiro PDF. unexpected_response_error=Resposta inesperada do servidor. +# LOCALIZATION NOTE (annotation_date_string): "{{date}}" and "{{time}}" will be +# replaced by the modification date, and time, of the annotation. +annotation_date_string={{date}}, {{time}} + # 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). @@ -239,4 +245,3 @@ password_cancel=Cancelar printing_not_supported=Aviso: A impresión non é compatÃbel de todo con este navegador. printing_not_ready=Aviso: O PDF non se cargou completamente para imprimirse. web_fonts_disabled=Desactiváronse as fontes web: foi imposÃbel usar as fontes incrustadas no PDF. -document_colors_not_allowed=Os documentos PDF non poden usar as súas propias cores: «Permitir que as páxinas escollan as súas propias cores» está desactivado no navegador. diff --git a/third-party/pdfjs/web/locale/gn/viewer.properties b/third-party/pdfjs/web/locale/gn/viewer.properties index e5652d71f..4b893971d 100644 --- a/third-party/pdfjs/web/locale/gn/viewer.properties +++ b/third-party/pdfjs/web/locale/gn/viewer.properties @@ -60,8 +60,8 @@ page_rotate_ccw.title=Aravo rapykue gotyo mbojere page_rotate_ccw.label=Aravo rapykue gotyo mbojere page_rotate_ccw_label=Aravo rapykue gotyo mbojere -cursor_text_select_tool.title=Emyandy moñe'ẽrã jeporavo rembipuru -cursor_text_select_tool_label=Moñe'ẽrã jeporavo rembipuru +cursor_text_select_tool.title=Emyandy moñe’ẽrã jeporavo rembipuru +cursor_text_select_tool_label=Moñe’ẽrã jeporavo rembipuru cursor_hand_tool.title=Tembipuru po pegua myandy cursor_hand_tool_label=Tembipuru po pegua @@ -80,8 +80,8 @@ spread_even.title=Embojuaju kuatiarogue jepysokue eñepyrÅ©vo kuatiarogue par-va spread_even_label=Ipukuve uvei # Document properties dialog box -document_properties.title=Kuatia mba'etee… -document_properties_label=Kuatia mba'etee… +document_properties.title=Kuatia mba’etee… +document_properties_label=Kuatia mba’etee… document_properties_file_name=Marandurenda réra: document_properties_file_size=Marandurenda tuichakue: # LOCALIZATION NOTE (document_properties_kb): "{{size_kb}}" and "{{size_b}}" @@ -92,15 +92,15 @@ document_properties_kb={{size_kb}} KB ({{size_b}} bytes) document_properties_mb={{size_mb}} MB ({{size_b}} bytes) document_properties_title=Teratee: document_properties_author=Apohára: -document_properties_subject=Mba'egua: +document_properties_subject=Mba’egua: document_properties_keywords=Jehero: document_properties_creation_date=Teñoihague arange: document_properties_modification_date=Iñambue hague arange: # LOCALIZATION NOTE (document_properties_date_string): "{{date}}" and "{{time}}" # will be replaced by the creation/modification date, and time, of the PDF file. document_properties_date_string={{date}}, {{time}} -document_properties_creator=Apo'ypyha: -document_properties_producer=PDF mbosako'iha: +document_properties_creator=Apo’ypyha: +document_properties_producer=PDF mbosako’iha: document_properties_version=PDF mbojuehegua: document_properties_page_count=Kuatiarogue papapy: document_properties_page_size=Kuatiarogue tuichakue: @@ -110,7 +110,7 @@ document_properties_page_size_orientation_portrait=OÄ©háicha document_properties_page_size_orientation_landscape=apaisado document_properties_page_size_name_a3=A3 document_properties_page_size_name_a4=A4 -document_properties_page_size_name_letter=Kuatiañe'ẽ +document_properties_page_size_name_letter=Kuatiañe’ẽ document_properties_page_size_name_legal=Tee # LOCALIZATION NOTE (document_properties_page_size_dimension_string): # "{{width}}", "{{height}}", {{unit}}, and {{orientation}} will be replaced by @@ -127,7 +127,7 @@ document_properties_linearized_yes=Añete document_properties_linearized_no=Ahániri document_properties_close=Mboty -print_progress_message=Embosako'i kuatia emonguatia hag̃ua… +print_progress_message=Embosako’i kuatia emonguatia hag̃ua… # LOCALIZATION NOTE (print_progress_percent): "{{progress}}" will be replaced by # a numerical per cent value. print_progress_percent={{progress}}% @@ -139,12 +139,12 @@ print_progress_close=Heja toggle_sidebar.title=Tenda yke moambue toggle_sidebar_notification.title=Embojopyru tenda ykegua (kuatia oguereko kora/marandurenda moirÅ©ha) toggle_sidebar_label=Tenda yke moambue -document_outline.title=Ehechauka kuatia rape (eikutu mokõi jey embotuicha/emomichÄ© hag̃ua opavavete mba'epuru) +document_outline.title=Ehechauka kuatia rape (eikutu mokõi jey embotuicha/emomichÄ© hag̃ua opavavete mba’epuru) document_outline_label=Kuatia apopyre attachments.title=MoirÅ©ha jehechauka attachments_label=MoirÅ©ha -thumbs.title=Mba'emirÄ© jehechauka -thumbs_label=Mba'emirÄ© +thumbs.title=Mba’emirÄ© jehechauka +thumbs_label=Mba’emirÄ© findbar.title=Kuatiápe jeheka findbar_label=Juhu @@ -156,20 +156,20 @@ page_canvas=Kuatiarogue {{page}} thumb_page_title=Kuatiarogue {{page}} # LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page # number. -thumb_page_canvas=Kuatiarogue mba'emirÄ© {{page}} +thumb_page_canvas=Kuatiarogue mba’emirÄ© {{page}} # Find panel button title and messages find_input.title=Juhu find_input.placeholder=Kuatiápe jejuhu… -find_previous.title=Ejuhu ñe'ẽrysýi osẽ'ypy hague +find_previous.title=Ejuhu ñe’ẽrysýi osẽ’ypy hague find_previous_label=Mboyvegua -find_next.title=Eho ñe'ẽ juhupyre upeiguávape +find_next.title=Eho ñe’ẽ juhupyre upeiguávape find_next_label=Upeigua find_highlight=Embojekuaavepa find_match_case_label=Ejesareko taiguasu/taimichÄ©re find_entire_word_label=Ñe’ẽ oÄ©mbáva -find_reached_top=Ojehupyty kuatia ñepyrÅ©, oku'ejeýta kuatia paha guive -find_reached_bottom=Ojehupyty kuatia paha, oku'ejeýta kuatia ñepyrÅ© guive +find_reached_top=Ojehupyty kuatia ñepyrÅ©, oku’ejeýta kuatia paha guive +find_reached_bottom=Ojehupyty kuatia paha, oku’ejeýta kuatia ñepyrÅ© guive # LOCALIZATION NOTE (find_match_count): The supported plural forms are # [one|two|few|many|other], with [other] as the default value. # "{{current}}" and "{{total}}" will be replaced by a number representing the @@ -191,21 +191,21 @@ find_match_count_limit[two]=Hetave {{limit}} ojojoguáva find_match_count_limit[few]=Hetave {{limit}} ojojoguáva find_match_count_limit[many]=Hetave {{limit}} ojojoguáva find_match_count_limit[other]=Hetave {{limit}} ojojoguáva -find_not_found=Ñe'ẽrysýi ojejuhu'ỹva +find_not_found=Ñe’ẽrysýi ojejuhu’ỹva # Error panel labels error_more_info=Maranduve -error_less_info=Sa'ive marandu +error_less_info=Sa’ive marandu error_close=Mboty # 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=Ñe'ẽmondo: {{message}} +error_message=Ñe’ẽmondo: {{message}} # LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack # trace. -error_stack=Mbojo'apy: {{stack}} +error_stack=Mbojo’apy: {{stack}} # LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename error_file=Marandurenda: {{file}} # LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number @@ -226,7 +226,7 @@ loading_error_indicator=OÄ©vaÃva loading_error=Oiko jejavy PDF oñemyeñyhẽnguévo. invalid_file_error=PDF marandurenda ndoikóiva térã ivaipyréva. missing_file_error=Ndaipóri PDF marandurenda -unexpected_response_error=Mohendahavusu mbohovái ñeha'arõ'ỹva. +unexpected_response_error=Mohendahavusu mbohovái ñeha’arõ’ỹva. # LOCALIZATION NOTE (annotation_date_string): "{{date}}" and "{{time}}" will be # replaced by the modification date, and time, of the annotation. @@ -237,12 +237,11 @@ annotation_date_string={{date}}, {{time}} # the PDF spec (32000-1:2008 Table 169 – Annotation types). # Some common types are e.g.: "Check", "Text", "Comment", "Note" text_annotation_type.alt=[Jehaipy {{type}}] -password_label=Emoinge ñe'ẽñemi eipe'a hag̃ua ko marandurenda PDF. -password_invalid=Ñe'ẽñemi ndoikóiva. Eha'ã jey. +password_label=Emoinge ñe’ẽñemi eipe’a hag̃ua ko marandurenda PDF. +password_invalid=Ñe’ẽñemi ndoikóiva. Eha’ã jey. password_ok=MONEĨ password_cancel=Heja printing_not_supported=Kyhyjerã: Ñembokuatia ndojokupytypái ko kundahára ndive. printing_not_ready=Kyhyjerã: Ko PDF nahenyhẽmbái oñembokuatia hag̃uáicha. -web_fonts_disabled=Ñanduti taity oñemongéma: ndaikatumo'ãi eipuru PDF jehai'Ãva taity. -document_colors_not_allowed=Kuatiakuéra PDF ndaikatúi oipuru isa'ykuéra tee: “EmoneÄ© kuatiaroguépe toiporavo isa'ykuéra tee†oñemongehÃna kundahárape. +web_fonts_disabled=Ñanduti taity oñemongéma: ndaikatumo’ãi eipuru PDF jehai’Ãva taity. diff --git a/third-party/pdfjs/web/locale/gu-IN/viewer.properties b/third-party/pdfjs/web/locale/gu-IN/viewer.properties index cce4bec11..579c068d9 100644 --- a/third-party/pdfjs/web/locale/gu-IN/viewer.properties +++ b/third-party/pdfjs/web/locale/gu-IN/viewer.properties @@ -239,4 +239,3 @@ password_cancel=રદ કરો printing_not_supported=ચેતવણી: છાપવાનà«àª‚ આ બà«àª°àª¾àª‰àªàª° દà«àª¦àª¾àª°àª¾ સંપૂરà«àª£àªªàª£à«‡ આધારàªà«‚ત નથી. printing_not_ready=Warning: PDF ઠછાપવા માટે સંપૂરà«àª£àªªàª£à«‡ લાવેલ છે. web_fonts_disabled=વેબ ફોનà«àªŸ નિષà«àª•à«àª°àª¿àª¯ થયેલ છે: àªàª®à«àª¬à«‡àª¡ થયેલ PDF ફોનà«àªŸàª¨à«‡ વાપરવાનà«àª‚ અસમરà«àª¥. -document_colors_not_allowed=PDF દસà«àª¤àª¾àªµà«‡àªœà«‹ તેનાં પોતાના રંગોને વાપરવા પરવાનગી આપતા નથી: 'તેનાં પોતાનાં રંગોને પસંદ કરવા માટે પાનાંને પરવાનગી આપો' બà«àª°àª¾àª‰àªàª°àª®àª¾àª‚ નિષà«àª•à«àª°àª¿àª¯ થયેલ છે. diff --git a/third-party/pdfjs/web/locale/he/viewer.properties b/third-party/pdfjs/web/locale/he/viewer.properties index e3d197efb..066478921 100644 --- a/third-party/pdfjs/web/locale/he/viewer.properties +++ b/third-party/pdfjs/web/locale/he/viewer.properties @@ -245,4 +245,3 @@ password_cancel=ביטול printing_not_supported=×זהרה: הדפסה ××™× ×” × ×ª×ž×›×ª במלו××” בדפדפן ×–×”. printing_not_ready=×זהרה: ×”Ö¾PDF ×œ× × ×™×ª×Ÿ לחלוטין עד מצב שמ×פשר הדפסה. web_fonts_disabled=×’×•×¤× ×™ רשת ×ž× ×•×˜×¨×œ×™×: ×œ× × ×™×ª×Ÿ להשתמש ×‘×’×•×¤× ×™ PDF מוטבעי×. -document_colors_not_allowed=מסמכי PDF ××™× × ×ž×•×¨×©×™× ×œ×”×©×ª×ž×© ×‘×¦×‘×¢×™× ×ž×©×œ×”×: ×”×פשרות „×פשר ×œ×¢×ž×•×“×™× ×œ×‘×—×•×¨ ×¦×‘×¢×™× ×ž×©×œ×”×†××™× ×” פעילה בדפדפן. diff --git a/third-party/pdfjs/web/locale/hi-IN/viewer.properties b/third-party/pdfjs/web/locale/hi-IN/viewer.properties index 3005180f5..6a49a9a98 100644 --- a/third-party/pdfjs/web/locale/hi-IN/viewer.properties +++ b/third-party/pdfjs/web/locale/hi-IN/viewer.properties @@ -241,4 +241,3 @@ password_cancel=रदà¥à¤¦ करें printing_not_supported=चेतावनी: इस बà¥à¤°à¤¾à¤‰à¤œà¤¼à¤° पर छपाई पूरी तरह से समरà¥à¤¥à¤¿à¤¤ नहीं है. printing_not_ready=चेतावनी: PDF छपाई के लिठपूरी तरह से लोड नहीं है. web_fonts_disabled=वेब फॉनà¥à¤Ÿà¥à¤¸ निषà¥à¤•à¥à¤°à¤¿à¤¯ हैं: अंतःसà¥à¤¥à¤¾à¤ªà¤¿à¤¤ PDF फॉनà¥à¤Ÿà¤¸ के उपयोग में असमरà¥à¤¥. -document_colors_not_allowed=PDF दसà¥à¤¤à¤¾à¤µà¥‡à¤œà¤¼ उनके अपने रंग को उपयोग करने के लिठअनà¥à¤®à¤¤à¤¿ पà¥à¤°à¤¾à¤ªà¥à¤¤ नहीं है: "पृषà¥à¤ ों को उनके अपने रंग को चà¥à¤¨à¤¨à¥‡ के लिठसà¥à¤µà¥€à¤•à¥ƒà¤¤à¤¿ दें" कि वह उस बà¥à¤°à¤¾à¤‰à¤œà¤¼à¤° में निषà¥à¤•à¥à¤°à¤¿à¤¯ है. diff --git a/third-party/pdfjs/web/locale/hr/viewer.properties b/third-party/pdfjs/web/locale/hr/viewer.properties index 67cc8983d..bfe10f808 100644 --- a/third-party/pdfjs/web/locale/hr/viewer.properties +++ b/third-party/pdfjs/web/locale/hr/viewer.properties @@ -244,5 +244,4 @@ password_cancel=Odustani printing_not_supported=Upozorenje: Ovaj preglednik ne podržava u potpunosti ispisivanje. printing_not_ready=Upozorenje: PDF nije u potpunosti uÄitan za ispis. -web_fonts_disabled=Web fontovi su onemogućeni: nije moguće koristiti umetnute PDF fontove. -document_colors_not_allowed=PDF dokumentima nije dozvoljeno koristiti vlastite boje: opcija „Dozvoli stranicama koristiti vlastite boje†je deaktivirana u pregledniku. +web_fonts_disabled=Web fontovi su deaktivirani: nije moguće koristiti ugraÄ‘ene PDF fontove. diff --git a/third-party/pdfjs/web/locale/hsb/viewer.properties b/third-party/pdfjs/web/locale/hsb/viewer.properties index a8f31f1a5..9ba3c15a2 100644 --- a/third-party/pdfjs/web/locale/hsb/viewer.properties +++ b/third-party/pdfjs/web/locale/hsb/viewer.properties @@ -245,4 +245,3 @@ password_cancel=PÅ™etorhnyć printing_not_supported=Warnowanje: Ćišćenje so pÅ™ez tutón wobhladowak poÅ‚nje njepodpÄ›ruje. printing_not_ready=Warnowanje: PDF njeje so za ćišćenje dospoÅ‚nje zaÄitaÅ‚. web_fonts_disabled=Webpisma su znjemóžnjene: njeje móžno, zasadźene PDF-pisma wužiwać. -document_colors_not_allowed=PDF-dokumenty njesmÄ›dźa swoje barby wužiwać: 'Stronam dowolić, swoje barby wužiwać' je we wobhladowaku znjemóžnjene. diff --git a/third-party/pdfjs/web/locale/hu/viewer.properties b/third-party/pdfjs/web/locale/hu/viewer.properties index cba69f0fc..88c1d0796 100644 --- a/third-party/pdfjs/web/locale/hu/viewer.properties +++ b/third-party/pdfjs/web/locale/hu/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Mégse printing_not_supported=Figyelmeztetés: Ez a böngészÅ‘ nem teljesen támogatja a nyomtatást. printing_not_ready=Figyelmeztetés: A PDF nincs teljesen betöltve a nyomtatáshoz. web_fonts_disabled=Webes betűkészletek letiltva: nem használhatók a beágyazott PDF betűkészletek. -document_colors_not_allowed=A PDF dokumentumok nem használhatják saját szÃneiket: „Az oldalak a saját maguk által kiválasztott szÃneket használhatják†beállÃtás ki van kapcsolva a böngészÅ‘ben. diff --git a/third-party/pdfjs/web/locale/hy-AM/viewer.properties b/third-party/pdfjs/web/locale/hy-AM/viewer.properties index f38581b21..09394f7d8 100644 --- a/third-party/pdfjs/web/locale/hy-AM/viewer.properties +++ b/third-party/pdfjs/web/locale/hy-AM/viewer.properties @@ -137,7 +137,7 @@ print_progress_close=Õ‰Õ¥Õ²Õ¡Ö€Õ¯Õ¥Õ¬ # (the _label strings are alt text for the buttons, the .title strings are # tooltips) toggle_sidebar.title=Ô²Õ¡ÖÕ¥Õ¬/Õ“Õ¡Õ¯Õ¥Õ¬ Ô¿Õ¸Õ²Õ¡ÕµÕ«Õ¶ Õ¾Õ¡Õ°Õ¡Õ¶Õ¡Õ¯Õ¨ -toggle_sidebar_notification.title=Õ“Õ¸ÕÕ¡Õ¶Õ»Õ¡Õ¿Õ¥Õ¬ Ô¿Õ¸Õ²Õ¡ÕµÕ«Õ¶ Õ£Õ¸Õ¿Õ«Õ¶ (ÖƒÕ¡Õ½Õ¿Õ¡Õ©Õ¸Ö‚Õ²Õ©Õ¨ ÕºÕ¡Ö€Õ¸Ö‚Õ¶Õ¡Õ¯Õ¸Ö‚Õ´ Õ§ Õ¸Ö‚Ö€Õ¾Õ¡Õ£Õ«Õ®/Õ¯ÖÕ¸Ö€Õ¤) +toggle_sidebar_notification.title=Õ“Õ¸ÕÕ¡Ö€Õ¯Õ¥Õ¬ Ô¿Õ¸Õ²Õ¡ÕµÕ«Õ¶ ÖƒÕ¥Õ²Õ¯Õ¨ (ÖƒÕ¡Õ½Õ¿Õ¡Õ©Õ¸Ö‚Õ²Õ©Õ¨ ÕºÕ¡Ö€Õ¸Ö‚Õ¶Õ¡Õ¯Õ¸Ö‚Õ´ Õ§ Õ¸Ö‚Ö€Õ¾Õ¡Õ£Õ«Õ®/Õ¯ÖÕ¸Ö€Õ¤Õ¶Õ¥Ö€) toggle_sidebar_label=Ô²Õ¡ÖÕ¥Õ¬/Õ“Õ¡Õ¯Õ¥Õ¬ Ô¿Õ¸Õ²Õ¡ÕµÕ«Õ¶ Õ¾Õ¡Õ°Õ¡Õ¶Õ¡Õ¯Õ¨ document_outline.title=Õ‘Õ¸Ö‚ÖÕ¡Õ¤Ö€Õ¥Õ¬ ÖƒÕ¡Õ½Õ¿Õ¡Õ©Õ²Õ©Õ« Õ¸Ö‚Ö€Õ¾Õ¡Õ£Õ«Õ®Õ¨ (Õ¯Ö€Õ¯Õ¶Õ¡Õ¯Õ« Õ½Õ¥Õ²Õ´Õ¥Ö„Õ Õ´Õ«Õ¡Õ¾Õ¸Ö€Õ¶Õ¥Ö€Õ¨ Õ¨Õ¶Õ¤Õ¡Ö€Õ±Õ¡Õ¯Õ¥Õ¬Õ¸Ö‚/Õ¯Õ¸Õ®Õ¯Õ¥Õ¬Õ¸Ö‚ Õ°Õ¡Õ´Õ¡Ö€) document_outline_label=Õ“Õ¡Õ½Õ¿Õ¡Õ©Õ²Õ©Õ« Õ¢Õ¸Õ¾Õ¡Õ¶Õ¤Õ¡Õ¯Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶Õ¨ @@ -245,4 +245,3 @@ password_cancel=Õ‰Õ¥Õ²Õ¡Ö€Õ¯Õ¥Õ¬ printing_not_supported=Ô¶Õ£Õ¸Ö‚Õ·Õ¡ÖÕ¸Ö‚Õ´. ÕÕºÕ¥Õ¬Õ¨ Õ¡Õ´Õ¢Õ¸Õ²Õ»Õ¸Ö‚Õ©ÕµÕ¡Õ´Õ¢ Õ¹Õ« Õ¡Õ»Õ¡Õ¯ÖÕ¾Õ¸Ö‚Õ´ Õ¤Õ«Õ¿Õ¡Ö€Õ¯Õ«Õ¹Õ« Õ¯Õ¸Õ²Õ´Õ«ÖÖ‰ printing_not_ready=Ô¶Õ£Õ¸Ö‚Õ·Õ¡ÖÕ¸Ö‚Õ´. PDF-Õ¨ Õ¡Õ´Õ¢Õ¸Õ²Õ»Õ¸Ö‚Õ©ÕµÕ¡Õ´Õ¢ Õ¹Õ« Õ¢Õ¥Õ¼Õ¶Õ¡Õ¾Õ¸Ö€Õ¾Õ¥Õ¬ Õ¿ÕºÕ¥Õ¬Õ¸Ö‚ Õ°Õ¡Õ´Õ¡Ö€: web_fonts_disabled=ÕŽÕ¥Õ¢-Õ¿Õ¡Õ¼Õ¡Õ¿Õ¥Õ½Õ¡Õ¯Õ¶Õ¥Ö€Õ¨ Õ¡Õ¶Õ»Õ¡Õ¿Õ¾Õ¡Õ® Õ¥Õ¶. Õ°Õ¶Õ¡Ö€Õ¡Õ¾Õ¸Ö€ Õ¹Õ§ Ö…Õ£Õ¿Õ¡Õ£Õ¸Ö€Õ®Õ¥Õ¬ Õ¶Õ¥Ö€Õ¯Õ¡Õ¼Õ¸Ö‚ÖÕ¾Õ¡Õ® PDF Õ¿Õ¡Õ¼Õ¡Õ¿Õ¥Õ½Õ¡Õ¯Õ¶Õ¥Ö€Õ¨: -document_colors_not_allowed=PDF ÖƒÕ¡Õ½Õ¿Õ¡Õ©Õ²Õ©Õ¥Ö€Õ«Õ¶ Õ©Õ¸Ö‚ÕµÕ¬Õ¡Õ¿Ö€Õ¾Õ¡Õ® Õ¹Õ§ Ö…Õ£Õ¿Õ¡Õ£Õ¸Ö€Õ®Õ¥Õ¬ Õ«Ö€Õ¥Õ¶Ö Õ½Õ¥ÖƒÕ¡Õ¯Õ¡Õ¶ Õ£Õ¸Ö‚ÕµÕ¶Õ¥Ö€Õ¨: “Թույլատրել Õ§Õ»Õ¥Ö€Õ«Õ¶ Õ¨Õ¶Õ¿Ö€Õ¥Õ¬ Õ«Ö€Õ¥Õ¶Ö Õ½Õ¥ÖƒÕ¡Õ¯Õ¡Õ¶ գույները“ Õ¨Õ¶Õ¿Ö€Õ¡Õ¶Ö„Õ¨ Õ¡Õ¶Õ»Õ¡Õ¿Õ¾Õ¡Õ® Õ§ Õ¤Õ«Õ¿Õ¡Ö€Õ¯Õ«Õ¹Õ¸Ö‚Õ´: diff --git a/third-party/pdfjs/web/locale/hye/viewer.properties b/third-party/pdfjs/web/locale/hye/viewer.properties index b5c712772..80d43019e 100644 --- a/third-party/pdfjs/web/locale/hye/viewer.properties +++ b/third-party/pdfjs/web/locale/hye/viewer.properties @@ -244,4 +244,3 @@ password_cancel=Õ‰Õ¥Õ²Õ¡Ö€Õ¯Õ¥Õ¬ printing_not_supported=Ô¶Õ£Õ¸Ö‚Õ·Õ¡ÖÕ¸Ö‚Õ´. ÕÕºÕ¥Õ¬Õ¨ Õ¡Õ´Õ¢Õ¸Õ²Õ»Õ¸Ö‚Õ©Õ¥Õ¡Õ´Õ¢ Õ¹Õ« Õ¡Õ»Õ¡Õ¯ÖÕ¸Ö‚Õ¸Ö‚Õ´ Õ¦Õ¶Õ¶Õ¡Ö€Õ¯Õ«Õ¹Õ« Õ¯Õ¸Õ²Õ´Õ«ÖÖ‰ printing_not_ready=Ô¶Õ£Õ¸Ö‚Õ·Õ¡ÖÕ¸Ö‚Õ´. PDFÖŠÕ¨ Õ¡Õ´Õ¢Õ¸Õ²Õ»Õ¸Ö‚Õ©Õ¥Õ¡Õ´Õ¢ Õ¹Õ« Õ¢Õ¥Õ¼Õ¶Õ¡Ö‚Õ¸Ö€Õ¸Ö‚Õ¥Õ¬ Õ¿ÕºÕ¥Õ¬Õ¸Ö‚ Õ°Õ¡Õ´Õ¡Ö€Ö‰ web_fonts_disabled=ÕŽÕ¥Õ¢-Õ¿Õ¡Õ¼Õ¡Õ¿Õ¥Õ½Õ¡Õ¯Õ¶Õ¥Ö€Õ¨ Õ¡Õ¶Õ»Õ¡Õ¿Õ¸Ö‚Õ¡Õ® Õ¥Õ¶. Õ°Õ¶Õ¡Ö€Õ¡Ö‚Õ¸Ö€ Õ¹Õ§ Õ¡Ö‚Õ£Õ¿Õ¡Õ£Õ¸Ö€Õ®Õ¥Õ¬ Õ¶Õ¥Ö€Õ¯Õ¡Õ¼Õ¸Ö‚ÖÕ¸Ö‚Õ¡Õ® PDF Õ¿Õ¡Õ¼Õ¡Õ¿Õ¥Õ½Õ¡Õ¯Õ¶Õ¥Ö€Õ¨Ö‰ -document_colors_not_allowed=PDF ÖƒÕ¡Õ½Õ¿Õ¡Õ©Õ²Õ©Õ¥Ö€Õ«Õ¶ Õ©Õ¸ÕµÕ¬Õ¡Õ¿Ö€Õ¸Ö‚Õ¡Õ® Õ¹Õ§ Õ¡Ö‚Õ£Õ¿Õ¡Õ£Õ¸Ö€Õ®Õ¥Õ¬ Õ«Ö€Õ¥Õ¶Ö Õ½Õ¥ÖƒÕ¡Õ¯Õ¡Õ¶ Õ£Õ¸ÕµÕ¶Õ¥Ö€Õ¨Ö‰ “Թոյլատրել Õ§Õ»Õ¥Ö€Õ«Õ¶ Õ¨Õ¶Õ¿Ö€Õ¥Õ¬ Õ«Ö€Õ¥Õ¶Ö Õ½Õ¥ÖƒÕ¡Õ¯Õ¡Õ¶ գոյները“ Õ¨Õ¶Õ¿Ö€Õ¡Õ¶Ö„Õ¨ Õ¡Õ¶Õ»Õ¡Õ¿Õ¸Ö‚Õ¡Õ® Õ§ Õ¦Õ¶Õ¶Õ¡Ö€Õ¯Õ«Õ¹Õ¸Ö‚Õ´Ö‰ diff --git a/third-party/pdfjs/web/locale/ia/viewer.properties b/third-party/pdfjs/web/locale/ia/viewer.properties index f69b26e40..167547adc 100644 --- a/third-party/pdfjs/web/locale/ia/viewer.properties +++ b/third-party/pdfjs/web/locale/ia/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Cancellar printing_not_supported=Attention : le impression non es totalmente supportate per ce navigator. printing_not_ready=Attention: le file PDF non es integremente cargate pro lo poter imprimer. web_fonts_disabled=Le typos de litteras web es disactivate: impossibile usar le typos de litteras PDF incorporate. -document_colors_not_allowed=Le documentos PDF non pote utilisar lor proprie colores: “Autorisar le paginas web a utilisar lor proprie colores†es disactivate in le navigator. diff --git a/third-party/pdfjs/web/locale/id/viewer.properties b/third-party/pdfjs/web/locale/id/viewer.properties index 0a904e16d..b9b9a730b 100644 --- a/third-party/pdfjs/web/locale/id/viewer.properties +++ b/third-party/pdfjs/web/locale/id/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Batal printing_not_supported=Peringatan: Pencetakan tidak didukung secara lengkap pada peramban ini. printing_not_ready=Peringatan: Berkas PDF masih belum dimuat secara lengkap untuk dapat dicetak. web_fonts_disabled=Font web dinonaktifkan: tidak dapat menggunakan font PDF yang tersemat. -document_colors_not_allowed=Dokumen PDF tidak diizinkan untuk menggunakan warnanya sendiri karena setelan 'Izinkan laman memilih warna sendiri' dinonaktifkan pada pengaturan. diff --git a/third-party/pdfjs/web/locale/is/viewer.properties b/third-party/pdfjs/web/locale/is/viewer.properties index d24c2adf5..72dc8acd6 100644 --- a/third-party/pdfjs/web/locale/is/viewer.properties +++ b/third-party/pdfjs/web/locale/is/viewer.properties @@ -236,4 +236,3 @@ password_cancel=Hætta við printing_not_supported=Aðvörun: Prentun er ekki með fyllilegan stuðning á þessum vafra. printing_not_ready=Aðvörun: Ekki er búið að hlaða inn allri PDF skránni fyrir prentun. web_fonts_disabled=Vef leturgerðir eru óvirkar: get ekki notað innbyggðar PDF leturgerðir. -document_colors_not_allowed=PDF skjöl hafa ekki leyfi til að nota sÃna eigin liti: “Leyfa sÃðum að velja eigin liti†er óvirkt à vafranum. diff --git a/third-party/pdfjs/web/locale/it/viewer.properties b/third-party/pdfjs/web/locale/it/viewer.properties index 1f0a20ac8..87c4050d8 100644 --- a/third-party/pdfjs/web/locale/it/viewer.properties +++ b/third-party/pdfjs/web/locale/it/viewer.properties @@ -2,13 +2,29 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. +# Copyright 2012 Mozilla Foundation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + previous.title = Pagina precedente previous_label = Precedente next.title = Pagina successiva next_label = Successiva + page.title = Pagina of_pages = di {{pagesCount}} page_of_pages = ({{pageNumber}} di {{pagesCount}}) + zoom_out.title = Riduci zoom zoom_out_label = Riduci zoom zoom_in.title = Aumenta zoom @@ -24,6 +40,7 @@ download.title = Scarica questo documento download_label = Download bookmark.title = Visualizzazione corrente (copia o apri in una nuova finestra) bookmark_label = Visualizzazione corrente + tools.title = Strumenti tools_label = Strumenti first_page.title = Vai alla prima pagina @@ -38,22 +55,26 @@ page_rotate_cw_label = Ruota in senso orario page_rotate_ccw.title = Ruota in senso antiorario page_rotate_ccw.label = Ruota in senso antiorario page_rotate_ccw_label = Ruota in senso antiorario + cursor_text_select_tool.title = Attiva strumento di selezione testo cursor_text_select_tool_label = Strumento di selezione testo cursor_hand_tool.title = Attiva strumento mano cursor_hand_tool_label = Strumento mano + scroll_vertical.title = Scorri le pagine in verticale scroll_vertical_label = Scorrimento verticale scroll_horizontal.title = Scorri le pagine in orizzontale scroll_horizontal_label = Scorrimento orizzontale scroll_wrapped.title = Scorri le pagine in verticale, disponendole da sinistra a destra e andando a capo automaticamente scroll_wrapped_label = Scorrimento con a capo automatico + spread_none.title = Non raggruppare pagine spread_none_label = Nessun raggruppamento spread_odd.title = Crea gruppi di pagine che iniziano con numeri di pagina dispari spread_odd_label = Raggruppamento dispari spread_even.title = Crea gruppi di pagine che iniziano con numeri di pagina pari spread_even_label = Raggruppamento pari + document_properties.title = Proprietà del documento… document_properties_label = Proprietà del documento… document_properties_file_name = Nome file: @@ -86,9 +107,11 @@ document_properties_linearized = Visualizzazione web veloce: document_properties_linearized_yes = Sì document_properties_linearized_no = No document_properties_close = Chiudi + print_progress_message = Preparazione documento per la stampa… print_progress_percent = {{progress}}% print_progress_close = Annulla + toggle_sidebar.title = Attiva/disattiva barra laterale toggle_sidebar_notification.title = Attiva/disattiva barra laterale (il documento contiene struttura/allegati) toggle_sidebar_label = Attiva/disattiva barra laterale @@ -100,9 +123,11 @@ thumbs.title = Mostra le miniature thumbs_label = Miniature findbar.title = Trova nel documento findbar_label = Trova + page_canvas = Pagina {{page}} thumb_page_title = Pagina {{page}} thumb_page_canvas = Miniatura della pagina {{page}} + find_input.title = Trova find_input.placeholder = Trova nel documento… find_previous.title = Trova l’occorrenza precedente del testo da cercare @@ -128,6 +153,7 @@ find_match_count_limit[few] = Più di {{limit}} corrispondenze find_match_count_limit[many] = Più di {{limit}} corrispondenze find_match_count_limit[other] = Più di {{limit}} corrispondenze find_not_found = Testo non trovato + error_more_info = Ulteriori informazioni error_less_info = Nascondi dettagli error_close = Chiudi @@ -137,23 +163,27 @@ error_stack = Stack: {{stack}} error_file = File: {{file}} error_line = Riga: {{line}} rendering_error = Si è verificato un errore durante il rendering della pagina. + page_scale_width = Larghezza pagina page_scale_fit = Adatta a una pagina page_scale_auto = Zoom automatico page_scale_actual = Dimensioni effettive page_scale_percent = {{scale}}% + loading_error_indicator = Errore loading_error = Si è verificato un errore durante il caricamento del PDF. invalid_file_error = File PDF non valido o danneggiato. missing_file_error = File PDF non disponibile. unexpected_response_error = Risposta imprevista del server + annotation_date_string = {{date}}, {{time}} + text_annotation_type.alt = [Annotazione: {{type}}] password_label = Inserire la password per aprire questo file PDF. password_invalid = Password non corretta. Riprovare. password_ok = OK password_cancel = Annulla + printing_not_supported = Attenzione: la stampa non è completamente supportata da questo browser. printing_not_ready = Attenzione: il PDF non è ancora stato caricato completamente per la stampa. web_fonts_disabled = I web font risultano disattivati: impossibile utilizzare i caratteri incorporati nel PDF. -document_colors_not_allowed = Non è possibile visualizzare i colori originali definiti nel file PDF: l’opzione del browser “Consenti alle pagine di scegliere i propri colori invece di quelli impostati†è disattivata. diff --git a/third-party/pdfjs/web/locale/ka/viewer.properties b/third-party/pdfjs/web/locale/ka/viewer.properties index d7a8f7a1f..86e91bbd1 100644 --- a/third-party/pdfjs/web/locale/ka/viewer.properties +++ b/third-party/pdfjs/web/locale/ka/viewer.properties @@ -122,7 +122,7 @@ document_properties_page_size_dimension_string={{width}} × {{height}} {{unit}} document_properties_page_size_dimension_name_string={{width}} × {{height}} {{unit}} ({{name}}, {{orientation}}) # LOCALIZATION NOTE (document_properties_linearized): The linearization status of # the document; usually called "Fast Web View" in English locales of Adobe software. -document_properties_linearized=სწრáƒáƒ¤áƒ˜ შეთვáƒáƒšáƒ˜áƒ”რებáƒ: +document_properties_linearized=მსუბუქი ვებჩვენებáƒ: document_properties_linearized_yes=დიáƒáƒ® document_properties_linearized_no=áƒáƒ რdocument_properties_close=დáƒáƒ®áƒ£áƒ ვრ@@ -245,4 +245,3 @@ password_cancel=გáƒáƒ£áƒ¥áƒ›áƒ”ბრprinting_not_supported=გáƒáƒ¤áƒ თხილებáƒ: áƒáƒ›áƒáƒ‘ეáƒáƒ“ვრáƒáƒ› ბრáƒáƒ£áƒ–ერში áƒáƒ áƒáƒ სრულáƒáƒ“ მხáƒáƒ დáƒáƒáƒ”რილი. printing_not_ready=გáƒáƒ¤áƒ თხილებáƒ: PDF სრულáƒáƒ“ ჩáƒáƒ¢áƒ•áƒ˜áƒ თული áƒáƒ áƒáƒ, áƒáƒ›áƒáƒ‘ეáƒáƒ“ვის დáƒáƒ¡áƒáƒ¬áƒ§áƒ”ბáƒáƒ“. web_fonts_disabled=ვებშრიფტები გáƒáƒ›áƒáƒ თულიáƒ: ჩáƒáƒ¨áƒ”ნებული PDF-შრიფტების გáƒáƒ›áƒáƒ§áƒ”ნებრვერხერხდებáƒ. -document_colors_not_allowed=PDF-დáƒáƒ™áƒ£áƒ›áƒ”ნტებს áƒáƒ áƒáƒ¥áƒ•áƒ¡ სáƒáƒ™áƒ£áƒ—áƒáƒ ი ფერების გáƒáƒ›áƒáƒ§áƒ”ნების ნებáƒáƒ თვáƒ: ბრáƒáƒ£áƒ–ერში გáƒáƒ›áƒáƒ თულირ„გვერდებისთვის სáƒáƒ™áƒ£áƒ—áƒáƒ ი ფერების გáƒáƒ›áƒáƒ§áƒ”ნების უფლებáƒâ€œ. diff --git a/third-party/pdfjs/web/locale/kab/viewer.properties b/third-party/pdfjs/web/locale/kab/viewer.properties index e3d0dc4b1..a6f07f169 100644 --- a/third-party/pdfjs/web/locale/kab/viewer.properties +++ b/third-party/pdfjs/web/locale/kab/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Sefsex printing_not_supported=Æ”uá¹›-k: Asiggez ur ittusefrak ara yakan imaṛṛa deg iminig-a. printing_not_ready=Æ”uá¹›-k: Afaylu PDF ur d-yuli ara imeṛṛa akken ad ittusiggez. web_fonts_disabled=Tisefsiyin web ttwassensent; D awezÉ£i useqdec n tsefsiyin yettwarnan É£er PDF. -document_colors_not_allowed=Isemliyen PDF ur zmiren ara ad sqedcen initen-nsen: 'Sireg isebtar akken ad fernen initen-nsen' ur yermid ara deg iminig. diff --git a/third-party/pdfjs/web/locale/kk/viewer.properties b/third-party/pdfjs/web/locale/kk/viewer.properties index 389b854b5..afd679ac7 100644 --- a/third-party/pdfjs/web/locale/kk/viewer.properties +++ b/third-party/pdfjs/web/locale/kk/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Ð‘Ð°Ñ Ñ‚Ð°Ñ€Ñ‚Ñƒ printing_not_supported=ЕÑкерту: БаÑпаға шығаруды бұл браузер толығымен қолдамайды. printing_not_ready=ЕÑкерту: БаÑпаға шығару үшін, бұл PDF толығымен жүктеліп алынбады. web_fonts_disabled=Веб қаріптері Ñөндірілген: құрамына енгізілген PDF қаріптерін қолдану мүмкін емеÑ. -document_colors_not_allowed=PDF құжаттарына өздік Ñ‚Ò¯Ñтерді қолдану Ñ€Ò±Ò›Ñат етілмеген: бұл браузерде 'Веб-Ñайттарға өздерінің Ñ‚Ò¯Ñтерін қолдануға Ñ€Ò±Ò›Ñат беру' мүмкіндігі Ñөндірулі тұр. diff --git a/third-party/pdfjs/web/locale/km/viewer.properties b/third-party/pdfjs/web/locale/km/viewer.properties index e5403cc16..8615e8389 100644 --- a/third-party/pdfjs/web/locale/km/viewer.properties +++ b/third-party/pdfjs/web/locale/km/viewer.properties @@ -181,4 +181,3 @@ password_cancel=បោះបង់ printing_not_supported=ការ​ព្រមាន ៖ កា​រ​បោះពុម្ព​មិន​ážáŸ’រូវ​បាន​គាំទ្រ​ពáŸáž‰áž›áŸáž‰â€‹ážŠáŸ„យ​កម្មវិធី​រុករក​នáŸáŸ‡â€‹áž‘áŸÂ ។ printing_not_ready=ព្រមាន៖ PDF មិន​ážáŸ’រូវ​បាន​ផ្ទុក​ទាំងស្រុង​ដើម្បី​បោះពុម្ព​ទáŸáŸ” web_fonts_disabled=បាន​បិទ​ពុម្ពអក្សរ​បណ្ដាញ ៖ មិន​អាច​ប្រើ​ពុម្ពអក្សរ PDF ដែល​បាន​បង្កប់​បាន​ទáŸÂ ។ -document_colors_not_allowed=ឯកសារ PDF មិន​ážáŸ’រូវ​បាន​អនុញ្ញាážâ€‹áž²áŸ’យ​ប្រើ​ពណ៌​ផ្ទាល់​របស់​វា​ទáŸáŸ– 'អនុញ្ញាážâ€‹â€‹áž²áŸ’យ​ទំពáŸážšâ€‹áž‡áŸ’រើស​ពណ៌​ផ្ទាល់​ážáŸ’លួន' ážáŸ’រូវ​បាន​ធ្វើ​ឲ្យ​អសកម្ម​ក្នុង​​កម្មវិធី​រុករក។ diff --git a/third-party/pdfjs/web/locale/kn/viewer.properties b/third-party/pdfjs/web/locale/kn/viewer.properties index cf3d0041c..b37a71c2e 100644 --- a/third-party/pdfjs/web/locale/kn/viewer.properties +++ b/third-party/pdfjs/web/locale/kn/viewer.properties @@ -190,4 +190,3 @@ password_cancel=ರದà³à²¦à³ ಮಾಡೠprinting_not_supported=ಎಚà³à²šà²°à²¿à²•à³†: ಈ ಜಾಲವೀಕà³à²·à²•à²¦à²²à³à²²à²¿ ಮà³à²¦à³à²°à²£à²•à³à²•à³† ಸಂಪೂರà³à²£ ಬೆಂಬಲವಿಲà³à²². printing_not_ready=ಎಚà³à²šà²°à²¿à²•à³†: PDF ಕಡತವೠಮà³à²¦à³à²°à²¿à²¸à²²à³ ಸಂಪೂರà³à²£à²µà²¾à²—ಿ ಲೋಡೠಆಗಿಲà³à²². web_fonts_disabled=ಜಾಲ ಅಕà³à²·à²°à²¶à³ˆà²²à²¿à²¯à²¨à³à²¨à³ ನಿಷà³à²•à³à²°à²¿à²¯à²—ೊಳಿಸಲಾಗಿದೆ: ಅಡಕಗೊಳಿಸಿದ PDF ಅಕà³à²·à²°à²¶à³ˆà²²à²¿à²—ಳನà³à²¨à³ ಬಳಸಲೠಸಾಧà³à²¯à²µà²¾à²—ಿಲà³à²². -document_colors_not_allowed=PDF ದಸà³à²¤à²¾à²µà³‡à²œà³à²—ಳೠತಮà³à²®à²¦à³† ಆದ ಬಣà³à²£à²—ಳನà³à²¨à³ ಬಳಸಲೠಅನà³à²®à²¤à²¿ ಇರà³à²µà³à²¦à²¿à²²à³à²²: 'ಪà³à²Ÿà²—ಳೠತಮà³à²®à²¦à³† ಆದ ಬಣà³à²£à²µà²¨à³à²¨à³ ಆಯà³à²•à³† ಮಾಡಲೠಅನà³à²®à²¤à²¿à²¸à³' ಅನà³à²¨à³ ಜಾಲವೀಕà³à²·à²•à²¦à²²à³à²²à²¿ ನಿಷà³à²•à³à²°à²¿à²¯à²—ೊಳಿಸಲಾಗಿರà³à²¤à³à²¤à²¦à³†. diff --git a/third-party/pdfjs/web/locale/ko/viewer.properties b/third-party/pdfjs/web/locale/ko/viewer.properties index ef688a956..727f8d5c9 100644 --- a/third-party/pdfjs/web/locale/ko/viewer.properties +++ b/third-party/pdfjs/web/locale/ko/viewer.properties @@ -41,8 +41,8 @@ print.title=ì¸ì‡„ print_label=ì¸ì‡„ download.title=다운로드 download_label=다운로드 -bookmark.title=현재 ë·° (복사하거나 새 ì°½ì— ì—´ê¸°) -bookmark_label=현재 ë·° +bookmark.title=현재 보기 (복사 ë˜ëŠ” 새 ì°½ì— ì—´ê¸°) +bookmark_label=현재 보기 # Secondary toolbar and context menu tools.title=ë„구 @@ -137,7 +137,7 @@ print_progress_close=취소 # (the _label strings are alt text for the buttons, the .title strings are # tooltips) toggle_sidebar.title=íƒìƒ‰ì°½ 표시/숨기기 -toggle_sidebar_notification.title=íƒìƒ‰ì°½ 표시/숨기기 (ë¬¸ì„œì— ì•„ì›ƒë¼ì¸/ì²¨ë¶€íŒŒì¼ í¬í•¨) +toggle_sidebar_notification.title=íƒìƒ‰ì°½ 표시/숨기기 (ë¬¸ì„œì— ì•„ì›ƒë¼ì¸/ì²¨ë¶€íŒŒì¼ í¬í•¨ë¨) toggle_sidebar_label=íƒìƒ‰ì°½ 표시/숨기기 document_outline.title=문서 아웃ë¼ì¸ 보기(ë”블 í´ë¦í•´ì„œ ëª¨ë“ í•ëª© 펼치기/ì ‘ê¸°) document_outline_label=문서 아웃ë¼ì¸ @@ -245,4 +245,3 @@ password_cancel=취소 printing_not_supported=ê²½ê³ : ì´ ë¸Œë¼ìš°ì €ëŠ” ì¸ì‡„를 ì™„ì „ížˆ 지ì›í•˜ì§€ 않습니다. printing_not_ready=ê²½ê³ : ì´ PDF를 ì¸ì‡„를 í• ìˆ˜ ìžˆì„ ì •ë„ë¡œ ì½ì–´ë“¤ì´ì§€ 못했습니다. web_fonts_disabled=웹 í°íŠ¸ê°€ 비활성화ë¨: ë‚´ìž¥ëœ PDF ê¸€ê¼´ì„ ì‚¬ìš©í• ìˆ˜ 없습니다. -document_colors_not_allowed=PDF ë¬¸ì„œì˜ ìžì²´ ìƒ‰ìƒ í—ˆìš© 안ë¨: “페ì´ì§€ ìžì²´ ìƒ‰ìƒ í—ˆìš©â€ì´ 브ë¼ìš°ì €ì—ì„œ 비활성화 ë˜ì–´ 있습니다. diff --git a/third-party/pdfjs/web/locale/lij/viewer.properties b/third-party/pdfjs/web/locale/lij/viewer.properties index 71a53062d..0cfa7d27f 100644 --- a/third-party/pdfjs/web/locale/lij/viewer.properties +++ b/third-party/pdfjs/web/locale/lij/viewer.properties @@ -239,4 +239,3 @@ password_cancel=Anulla printing_not_supported=Atençion: a stanpa a no l'é conpletamente soportâ da sto navegatô. printing_not_ready=Atençion: o PDF o no l'é ancon caregou conpletamente pe-a stanpa. web_fonts_disabled=I font do web en dizativæ: inposcibile adeuviâ i carateri do PDF. -document_colors_not_allowed=No l'é poscibile adeuviâ i pròpi coî pe-i documenti PDF: l'opçion do navegatô “Permetti a-e pagine de çerne i pròpi coî in cangio de quelli inpostæ†a l'é dizativâ. diff --git a/third-party/pdfjs/web/locale/locale.properties b/third-party/pdfjs/web/locale/locale.properties index 411c19830..372dd5d32 100644 --- a/third-party/pdfjs/web/locale/locale.properties +++ b/third-party/pdfjs/web/locale/locale.properties @@ -43,6 +43,9 @@ [cak] @import url(cak/viewer.properties) +[ckb] +@import url(ckb/viewer.properties) + [cs] @import url(cs/viewer.properties) @@ -265,6 +268,9 @@ [sv-SE] @import url(sv-SE/viewer.properties) +[szl] +@import url(szl/viewer.properties) + [ta] @import url(ta/viewer.properties) diff --git a/third-party/pdfjs/web/locale/lt/viewer.properties b/third-party/pdfjs/web/locale/lt/viewer.properties index dbdc82136..daa76787c 100644 --- a/third-party/pdfjs/web/locale/lt/viewer.properties +++ b/third-party/pdfjs/web/locale/lt/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Atsisakyti printing_not_supported=DÄ—mesio! Spausdinimas Å¡ioje narÅ¡yklÄ—je nÄ—ra pilnai realizuotas. printing_not_ready=DÄ—mesio! PDF failas dar nÄ—ra pilnai įkeltas spausdinimui. web_fonts_disabled=Saityno Å¡riftai iÅ¡jungti – PDF faile esanÄių Å¡riftų naudoti negalima. -document_colors_not_allowed=PDF dokumentams neleidžiama nurodyti savo spalvų, nes iÅ¡jungta narÅ¡yklÄ—s nuostata „Leisti tinklalapiams nurodyti spalvas“. diff --git a/third-party/pdfjs/web/locale/ltg/viewer.properties b/third-party/pdfjs/web/locale/ltg/viewer.properties index ecdb72352..4fffa864d 100644 --- a/third-party/pdfjs/web/locale/ltg/viewer.properties +++ b/third-party/pdfjs/web/locale/ltg/viewer.properties @@ -217,4 +217,3 @@ password_cancel=Atceļt printing_not_supported=Uzmaneibu: DrukuoÅ¡ona nu itei puorlÅ«ka dorbojÄs tikai daleji. printing_not_ready=Uzmaneibu: PDF nav pilneibÄ Ä«luodeits drukuoÅ¡onai. web_fonts_disabled=Å Ä·Ärsteikla fonti nav aktivizÄti: Navar Ä«gult PDF fontus. -document_colors_not_allowed=PDF dokumentym nav atļauts izmantuot poÅ¡ym sovys kruosys: „Atļaut lopom izavieleit poÅ¡om sovys kruosys“ ir deaktiveits puorlyukÄ. diff --git a/third-party/pdfjs/web/locale/lv/viewer.properties b/third-party/pdfjs/web/locale/lv/viewer.properties index 18ed55efb..b6d6ad38f 100644 --- a/third-party/pdfjs/web/locale/lv/viewer.properties +++ b/third-party/pdfjs/web/locale/lv/viewer.properties @@ -239,4 +239,3 @@ password_cancel=Atcelt printing_not_supported=UzmanÄ«bu: DrukÄÅ¡ana no Å¡Ä« pÄrlÅ«ka darbojas tikai daļēji. printing_not_ready=UzmanÄ«bu: PDF nav pilnÄ«bÄ ielÄdÄ“ts drukÄÅ¡anai. web_fonts_disabled=TÄ«mekļa fonti nav aktivizÄ“ti: Nevar iegult PDF fontus. -document_colors_not_allowed=PDF dokumentiem nav atļauts izmantot paÅ¡iem savas krÄsas: „Atļaut lapÄm izvÄ“lÄ“ties paÅ¡Äm savas krÄsas“ ir deaktivÄ“ts pÄrlÅ«kÄ. diff --git a/third-party/pdfjs/web/locale/mk/viewer.properties b/third-party/pdfjs/web/locale/mk/viewer.properties index 85350255a..c1b091ed6 100644 --- a/third-party/pdfjs/web/locale/mk/viewer.properties +++ b/third-party/pdfjs/web/locale/mk/viewer.properties @@ -142,4 +142,3 @@ password_cancel=Откажи printing_not_supported=Предупредување: Печатењето не е целоÑно поддржано во овој прелиÑтувач. printing_not_ready=Предупредување: PDF документот не е целоÑно вчитан за печатење. web_fonts_disabled=Интернет фонтовите Ñе оневозможени: не може да Ñе кориÑтат вградените PDF фонтови. -document_colors_not_allowed=PDF-документите немаат дозвола да кориÑтат ÑопÑтвени бои: ПоÑтавката „Дозволи Ñтраниците Ñами да ги избираат Ñвоите бои“ е деактивирана од прелиÑтувачот. diff --git a/third-party/pdfjs/web/locale/mr/viewer.properties b/third-party/pdfjs/web/locale/mr/viewer.properties index 25229ea4f..b33646f51 100644 --- a/third-party/pdfjs/web/locale/mr/viewer.properties +++ b/third-party/pdfjs/web/locale/mr/viewer.properties @@ -235,4 +235,3 @@ password_cancel=रदà¥à¤¦ करा printing_not_supported=सावधानता: या बà¥à¤°à¤¾à¤‰à¤à¤°à¤¤à¤°à¥à¤«à¥‡ छपाइ पूरà¥à¤£à¤ªà¤£à¥‡ समरà¥à¤¥à¥€à¤¤ नाही. printing_not_ready=सावधानता: छपाईकरिता PDF पूरà¥à¤£à¤¤à¤¯à¤¾ लोड à¤à¤¾à¤²à¥‡ नाही. web_fonts_disabled=वेब टंक असमरà¥à¤¥à¥€à¤¤ आहेत: à¤à¤®à¥à¤¬à¥‡à¤¡à¥‡à¤¡ PDF टंक वापर अशकà¥à¤¯. -document_colors_not_allowed=PDF दसà¥à¤¤à¤à¤µà¤œà¤¾à¤‚ना तà¥à¤¯à¤¾à¤‚चे रंग वापरणà¥à¤¯à¤¾à¤¸ अनà¥à¤®à¤¤à¥€ नाही: बà¥à¤°à¤¾à¤‰à¤à¤°à¤®à¤§à¥à¤¯à¥‡ ' पृषà¥à¤ ांना तà¥à¤¯à¤¾à¤‚चे रंग निवडणà¥à¤¯à¤¾à¤¸ अनà¥à¤®à¤¤à¥€ दà¥à¤¯à¤¾' बंद केले आहे. diff --git a/third-party/pdfjs/web/locale/ms/viewer.properties b/third-party/pdfjs/web/locale/ms/viewer.properties index 3bc7907b8..61f155397 100644 --- a/third-party/pdfjs/web/locale/ms/viewer.properties +++ b/third-party/pdfjs/web/locale/ms/viewer.properties @@ -239,4 +239,3 @@ password_cancel=Batal printing_not_supported=Amaran: Cetakan ini tidak sepenuhnya disokong oleh pelayar ini. printing_not_ready=Amaran: PDF tidak sepenuhnya dimuatkan untuk dicetak. web_fonts_disabled=Fon web dinyahdayakan: tidak dapat menggunakan fon terbenam PDF. -document_colors_not_allowed=Dokumen PDF tidak dibenarkan untuk menggunakan warna sendiri: “Izinkan halaman untuk memilih warna sendiri†telah dinyahaktifkan dalam pelayar. diff --git a/third-party/pdfjs/web/locale/my/viewer.properties b/third-party/pdfjs/web/locale/my/viewer.properties index f5676198f..3e6f2c305 100644 --- a/third-party/pdfjs/web/locale/my/viewer.properties +++ b/third-party/pdfjs/web/locale/my/viewer.properties @@ -195,4 +195,3 @@ password_cancel=ပယ်​ဖျက်ပါ printing_not_supported=သá€á€á€•á€±á€¸á€á€»á€€á€ºáŠá€•á€›á€„့်ထုá€á€ºá€á€¼á€„်းကá€á€¯á€¤á€˜á€šá€±á€¬á€€á€ºá€†á€¬á€žá€Šá€º ပြည့်á€á€…ွာထောက်ပံ့မထားပါ á‹ printing_not_ready=သá€á€á€•á€±á€¸á€á€»á€€á€º: ယá€á€¯ PDF ဖá€á€¯á€„်သည် ပုံနှá€á€•á€ºá€›á€”် မပြည့်စုံပါ web_fonts_disabled=Web fonts are disabled: unable to use embedded PDF fonts. -document_colors_not_allowed=PDF ဖá€á€¯á€„်အား áŽá€„်းဤ ကá€á€¯á€šá€ºá€•á€á€¯á€„်အရောင်များကá€á€¯ အသုံးပြုá€á€½á€„့်မပေးထားပါ á‹ 'စာမျက်နှာအားလုံးအားအရောင်ရွေးá€á€»á€šá€ºá€á€½á€„့်' အား ယá€á€¯ ဘယောက်ဆာá€á€½á€„် ပá€á€á€ºá€‘ားá€á€¼á€„်းကြောင့်ဖြစ် သှ် diff --git a/third-party/pdfjs/web/locale/nb-NO/viewer.properties b/third-party/pdfjs/web/locale/nb-NO/viewer.properties index 5612abb0b..47b209048 100644 --- a/third-party/pdfjs/web/locale/nb-NO/viewer.properties +++ b/third-party/pdfjs/web/locale/nb-NO/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Avbryt printing_not_supported=Advarsel: Utskrift er ikke fullstendig støttet av denne nettleseren. printing_not_ready=Advarsel: PDF er ikke fullstendig innlastet for utskrift. web_fonts_disabled=Web-fonter er avslÃ¥tt: Kan ikke bruke innbundne PDF-fonter. -document_colors_not_allowed=PDF-dokumenter tillates ikke Ã¥ bruke deres egne farger: "Tillat sider Ã¥ velge egne farger" er deaktivert i nettleseren. diff --git a/third-party/pdfjs/web/locale/ne-NP/viewer.properties b/third-party/pdfjs/web/locale/ne-NP/viewer.properties index 13bf69ba9..3bf8ed8f3 100644 --- a/third-party/pdfjs/web/locale/ne-NP/viewer.properties +++ b/third-party/pdfjs/web/locale/ne-NP/viewer.properties @@ -181,4 +181,3 @@ password_cancel=रदà¥à¤¦ गरà¥à¤¨à¥à¤¹à¥‹à¤¸à¥ printing_not_supported=चेतावनी: यो बà¥à¤°à¤¾à¤‰à¤œà¤°à¤®à¤¾ मà¥à¤¦à¥à¤°à¤£ पूरà¥à¤£à¤¤à¤¯à¤¾ समरà¥à¤¥à¤¿à¤¤ छैन। printing_not_ready=चेतावनी: PDF मà¥à¤¦à¥à¤°à¤£à¤•à¤¾ लागि पूरà¥à¤£à¤¤à¤¯à¤¾ लोड à¤à¤à¤•à¥‹ छैन। web_fonts_disabled=वेब फनà¥à¤Ÿ असकà¥à¤·à¤® छनà¥: à¤à¤®à¥à¤¬à¥‡à¤¡à¥‡à¤¡ PDF फनà¥à¤Ÿ पà¥à¤°à¤¯à¥‹à¤— गरà¥à¤¨ असमरà¥à¤¥à¥¤ -document_colors_not_allowed=PDF कागजातहरूलाई आफà¥à¤¨à¥ˆ रङ पà¥à¤°à¤¯à¥‹à¤— गरà¥à¤¨ अनà¥à¤®à¤¤à¤¿ छैन: 'पृषà¥à¤ लाई आफà¥à¤¨à¥ˆ रङ चयन गरà¥à¤¨ अनà¥à¤®à¤¤à¤¿ दिने' बà¥à¤°à¤¾à¤‰à¤œà¤°à¤®à¤¾ निषà¥à¤•à¥à¤°à¤¿à¤¯ गरिà¤à¤•à¥‹ छ। diff --git a/third-party/pdfjs/web/locale/nl/viewer.properties b/third-party/pdfjs/web/locale/nl/viewer.properties index af8fb681e..b37f1abf5 100644 --- a/third-party/pdfjs/web/locale/nl/viewer.properties +++ b/third-party/pdfjs/web/locale/nl/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Annuleren printing_not_supported=Waarschuwing: afdrukken wordt niet volledig ondersteund door deze browser. printing_not_ready=Waarschuwing: de PDF is niet volledig geladen voor afdrukken. web_fonts_disabled=Weblettertypen zijn uitgeschakeld: gebruik van ingebedde PDF-lettertypen is niet mogelijk. -document_colors_not_allowed=PDF-documenten mogen hun eigen kleuren niet gebruiken: ‘Pagina’s toestaan om hun eigen kleuren te kiezen’ is uitgeschakeld in de browser. diff --git a/third-party/pdfjs/web/locale/nn-NO/viewer.properties b/third-party/pdfjs/web/locale/nn-NO/viewer.properties index ad6de8f81..c9bac1010 100644 --- a/third-party/pdfjs/web/locale/nn-NO/viewer.properties +++ b/third-party/pdfjs/web/locale/nn-NO/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Avbryt printing_not_supported=Ã…tvaring: Utskrift er ikkje fullstendig støtta av denne nettlesaren. printing_not_ready=Ã…tvaring: PDF ikkje fullstendig innlasta for utskrift. web_fonts_disabled=Web-skrifter er slÃ¥tt av: Kan ikkje bruke innbundne PDF-skrifter. -document_colors_not_allowed=PDF-dokument kan ikkje bruke eigne fargar: «Tillat sider Ã¥ velje eigne fargar» er deaktivert i nettlesaren. diff --git a/third-party/pdfjs/web/locale/oc/viewer.properties b/third-party/pdfjs/web/locale/oc/viewer.properties index 3732e943b..b1c6a3a0c 100644 --- a/third-party/pdfjs/web/locale/oc/viewer.properties +++ b/third-party/pdfjs/web/locale/oc/viewer.properties @@ -98,7 +98,7 @@ document_properties_creation_date=Data de creacion : document_properties_modification_date=Data de modificacion : # LOCALIZATION NOTE (document_properties_date_string): "{{date}}" and "{{time}}" # will be replaced by the creation/modification date, and time, of the PDF file. -document_properties_date_string={{date}}, {{time}} +document_properties_date_string={{date}}, a {{time}} document_properties_creator=Creator : document_properties_producer=Aisina de conversion PDF : document_properties_version=Version PDF : @@ -245,4 +245,3 @@ password_cancel=Anullar printing_not_supported=Atencion : l'impression es pas completament gerida per aqueste navegador. printing_not_ready=Atencion : lo PDF es pas entièrament cargat per lo poder imprimir. web_fonts_disabled=Las poliças web son desactivadas : impossible d'utilizar las poliças integradas al PDF. -document_colors_not_allowed=Los documents PDF pòdon pas utilizar lors pròprias colors : « Autorizar las paginas web d'utilizar lors pròprias colors » es desactivat dins lo navegador. diff --git a/third-party/pdfjs/web/locale/pa-IN/viewer.properties b/third-party/pdfjs/web/locale/pa-IN/viewer.properties index e1ccb6541..0ab56319e 100644 --- a/third-party/pdfjs/web/locale/pa-IN/viewer.properties +++ b/third-party/pdfjs/web/locale/pa-IN/viewer.properties @@ -243,4 +243,3 @@ password_cancel=ਰੱਦ ਕਰੋ printing_not_supported=ਸਾਵਧਾਨ: ਇਹ ਬਰਾਊਜ਼ਰ ਪਰਿੰਟ ਕਰਨ ਲਈ ਪੂਰੀ ਤਰà©à¨¹à¨¾à¨‚ ਸਹਾਇਕ ਨਹੀਂ ਹੈ। printing_not_ready=ਸਾਵਧਾਨ: PDF ਨੂੰ ਪਰਿੰਟ ਕਰਨ ਲਈ ਪੂਰੀ ਤਰà©à¨¹à¨¾à¨‚ ਲੋਡ ਨਹੀਂ ਹੈ। web_fonts_disabled=ਵੈਬ ਫੋਂਟ ਬੰਦ ਹਨ: ਇੰਬੈਡ PDF ਫੋਂਟ ਨੂੰ ਵਰਤਣ ਲਈ ਅਸਮਰੱਥ ਹੈ। -document_colors_not_allowed=PDF ਦਸਤਾਵੇਜ਼ਾਂ ਨੂੰ ਆਪਣੇ ਰੰਗ ਵਰਤਣ ਦੀ ਇਜ਼ਾਜ਼ਤ ਨਹੀਂ ਹੈ।: ਬਰਾਊਜ਼ਰ ਵਿੱਚ “ਸਫ਼ਿਆਂ ਨੂੰ ਆਪਣੇ ਰੰਗ ਚà©à¨£à¨¨ ਦੀ ਇਜ਼ਾਜ਼ਤ ਦਿਓ†ਨਾ-ਸਰਗਰਮ ਹੈ। diff --git a/third-party/pdfjs/web/locale/pl/viewer.properties b/third-party/pdfjs/web/locale/pl/viewer.properties index c18ea5ed8..cf170c8d2 100644 --- a/third-party/pdfjs/web/locale/pl/viewer.properties +++ b/third-party/pdfjs/web/locale/pl/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Anuluj printing_not_supported=Ostrzeżenie: drukowanie nie jest w peÅ‚ni obsÅ‚ugiwane przez tÄ™ przeglÄ…darkÄ™. printing_not_ready=Ostrzeżenie: dokument PDF nie jest caÅ‚kowicie wczytany, wiÄ™c nie można go wydrukować. web_fonts_disabled=Czcionki sieciowe sÄ… wyÅ‚Ä…czone: nie można użyć osadzonych czcionek PDF. -document_colors_not_allowed=Dokumenty PDF nie mogÄ… używać wÅ‚asnych kolorów: opcja „Pozwalaj stronom stosować inne kolory†w przeglÄ…darce jest nieaktywna. diff --git a/third-party/pdfjs/web/locale/pt-BR/viewer.properties b/third-party/pdfjs/web/locale/pt-BR/viewer.properties index 5947d2d43..ca592b8f1 100644 --- a/third-party/pdfjs/web/locale/pt-BR/viewer.properties +++ b/third-party/pdfjs/web/locale/pt-BR/viewer.properties @@ -41,7 +41,7 @@ print.title=Imprimir print_label=Imprimir download.title=Download download_label=Download -bookmark.title=Visualização atual (copiar ou abrir em uma nova janela) +bookmark.title=Visão atual (copiar ou abrir em nova janela) bookmark_label=Visualização atual # Secondary toolbar and context menu @@ -165,7 +165,7 @@ find_previous.title=Procurar a ocorrência anterior da frase find_previous_label=Anterior find_next.title=Procurar a próxima ocorrência da frase find_next_label=Próxima -find_highlight=Realçar tudo +find_highlight=Destacar tudo find_match_case_label=Diferenciar maiúsculas/minúsculas find_entire_word_label=Palavras completas find_reached_top=InÃcio do documento alcançado, continuando do fim @@ -245,4 +245,3 @@ password_cancel=Cancelar printing_not_supported=Aviso: a impressão não é totalmente suportada neste navegador. printing_not_ready=Aviso: o PDF não está totalmente carregado para impressão. web_fonts_disabled=As fontes web estão desativadas: não foi possÃvel usar fontes incorporadas do PDF. -document_colors_not_allowed=Documentos PDF não estão autorizados a usar as próprias cores: a opção “Permitir que as páginas escolham suas próprias cores†está desativada no navegador. diff --git a/third-party/pdfjs/web/locale/pt-PT/viewer.properties b/third-party/pdfjs/web/locale/pt-PT/viewer.properties index 5129a5226..57f481416 100644 --- a/third-party/pdfjs/web/locale/pt-PT/viewer.properties +++ b/third-party/pdfjs/web/locale/pt-PT/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Cancelar printing_not_supported=Aviso: a impressão não é totalmente suportada por este navegador. printing_not_ready=Aviso: o PDF ainda não está totalmente carregado. web_fonts_disabled=Os tipos de letra web estão desativados: não é possÃvel utilizar os tipos de letra PDF embutidos. -document_colors_not_allowed=Os documentos PDF não permitem a utilização das suas próprias cores: “Permitir à s páginas escolher as suas próprias cores†está desativado no navegador. diff --git a/third-party/pdfjs/web/locale/rm/viewer.properties b/third-party/pdfjs/web/locale/rm/viewer.properties index 99aca5c6b..8c8cab892 100644 --- a/third-party/pdfjs/web/locale/rm/viewer.properties +++ b/third-party/pdfjs/web/locale/rm/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Interrumper printing_not_supported=Attenziun: Il stampar na funcziunescha anc betg dal tut en quest navigatur. printing_not_ready=Attenziun: Il PDF n'è betg chargià cumplettamain per stampar. web_fonts_disabled=Scrittiras dal web èn deactivadas: impussibel dad utilisar las scrittiras integradas en il PDF. -document_colors_not_allowed=Documents da PDF na dastgan betg duvrar las atgnas colurs: 'Permetter a paginas da tscherner lur atgna colur' è deactivà en il navigatur. diff --git a/third-party/pdfjs/web/locale/ro/viewer.properties b/third-party/pdfjs/web/locale/ro/viewer.properties index 691d9dc32..0e4fbf70e 100644 --- a/third-party/pdfjs/web/locale/ro/viewer.properties +++ b/third-party/pdfjs/web/locale/ro/viewer.properties @@ -32,7 +32,7 @@ zoom_out.title=MicÈ™orează zoom_out_label=MicÈ™orează zoom_in.title=MăreÈ™te zoom_in_label=MăreÈ™te -zoom.title=Focalizare +zoom.title=Zoom presentation_mode.title=Comută la modul de prezentare presentation_mode_label=Mod de prezentare open_file.title=Deschide un fiÈ™ier @@ -53,12 +53,12 @@ first_page_label=Mergi la prima pagină last_page.title=Mergi la ultima pagină last_page.label=Mergi la ultima pagină last_page_label=Mergi la ultima pagină -page_rotate_cw.title=RoteÈ™te în sensul acelor de ceasornic -page_rotate_cw.label=RoteÈ™te în sensul acelor de ceasornic -page_rotate_cw_label=RoteÈ™te în sensul acelor de ceasornic -page_rotate_ccw.title=RoteÈ™te în sens invers al acelor de ceasornic -page_rotate_ccw.label=RoteÈ™te în sens invers al acelor de ceasornic -page_rotate_ccw_label=RoteÈ™te în sens invers al acelor de ceasornic +page_rotate_cw.title=RoteÈ™te în sensul acelor de ceas +page_rotate_cw.label=RoteÈ™te în sensul acelor de ceas +page_rotate_cw_label=RoteÈ™te în sensul acelor de ceas +page_rotate_ccw.title=RoteÈ™te în sens invers al acelor de ceas +page_rotate_ccw.label=RoteÈ™te în sens invers al acelor de ceas +page_rotate_ccw_label=RoteÈ™te în sens invers al acelor de ceas cursor_text_select_tool.title=Activează instrumentul de selecÈ›ie a textului cursor_text_select_tool_label=Instrumentul de selecÈ›ie a textului @@ -106,8 +106,8 @@ document_properties_page_count=Număr de pagini: document_properties_page_size=Mărimea paginii: document_properties_page_size_unit_inches=in document_properties_page_size_unit_millimeters=mm -document_properties_page_size_orientation_portrait=portret -document_properties_page_size_orientation_landscape=peisaj +document_properties_page_size_orientation_portrait=verticală +document_properties_page_size_orientation_landscape=orizontală document_properties_page_size_name_a3=A3 document_properties_page_size_name_a4=A4 document_properties_page_size_name_letter=Literă @@ -215,7 +215,7 @@ rendering_error=A intervenit o eroare la randarea paginii. # Predefined zoom values page_scale_width=Lățime pagină page_scale_fit=Potrivire la pagină -page_scale_auto=Focalizare automată +page_scale_auto=Zoom automat page_scale_actual=Mărime reală # LOCALIZATION NOTE (page_scale_percent): "{{scale}}" will be replaced by a # numerical scale value. @@ -245,4 +245,3 @@ password_cancel=Renunță printing_not_supported=Avertisment: Tipărirea nu este suportată în totalitate de acest browser. printing_not_ready=Avertisment: PDF-ul nu este încărcat complet pentru tipărire. web_fonts_disabled=Fonturile web sunt dezactivate: nu se pot folosi fonturile PDF încorporate. -document_colors_not_allowed=Documentele PDF nu sunt autorizate să folosească propriile culori: „Permite paginilor să aleagă propriile culori†este dezactivat în browser. diff --git a/third-party/pdfjs/web/locale/ru/viewer.properties b/third-party/pdfjs/web/locale/ru/viewer.properties index bf417bcb4..dd4ee4810 100644 --- a/third-party/pdfjs/web/locale/ru/viewer.properties +++ b/third-party/pdfjs/web/locale/ru/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Отмена printing_not_supported=Предупреждение: Ð’ Ñтом браузере не полноÑтью поддерживаетÑÑ Ð¿ÐµÑ‡Ð°Ñ‚ÑŒ. printing_not_ready=Предупреждение: PDF не полноÑтью загружен Ð´Ð»Ñ Ð¿ÐµÑ‡Ð°Ñ‚Ð¸. web_fonts_disabled=Веб-шрифты отключены: невозможно иÑпользовать вÑтроенные PDF-шрифты. -document_colors_not_allowed=PDF-документам не разрешено иÑпользовать Ñвои цвета: в браузере отключён параметр «Разрешить веб-Ñайтам иÑпользовать Ñвои цвета». diff --git a/third-party/pdfjs/web/locale/sk/viewer.properties b/third-party/pdfjs/web/locale/sk/viewer.properties index a08911bf9..d86d77cfa 100644 --- a/third-party/pdfjs/web/locale/sk/viewer.properties +++ b/third-party/pdfjs/web/locale/sk/viewer.properties @@ -245,4 +245,3 @@ password_cancel=ZruÅ¡iÅ¥ printing_not_supported=Upozornenie: tlaÄ nie je v tomto prehliadaÄi plne podporovaná. printing_not_ready=Upozornenie: súbor PDF nie je plne naÄÃtaný pre tlaÄ. web_fonts_disabled=Webové pÃsma sú vypnuté: nie je možné použiÅ¥ pÃsma vložené do súboru PDF. -document_colors_not_allowed=Dokumenty PDF nemajú povolené použÃvaÅ¥ vlastné farby, pretože voľba "PovoliÅ¥ stránkam použÃvaÅ¥ vlastné farby" je v nastaveniach prehliadaÄa vypnutá. diff --git a/third-party/pdfjs/web/locale/sl/viewer.properties b/third-party/pdfjs/web/locale/sl/viewer.properties index 86db2d9ab..25a5e9c50 100644 --- a/third-party/pdfjs/web/locale/sl/viewer.properties +++ b/third-party/pdfjs/web/locale/sl/viewer.properties @@ -245,4 +245,3 @@ password_cancel=PrekliÄi printing_not_supported=Opozorilo: ta brskalnik ne podpira vseh možnosti tiskanja. printing_not_ready=Opozorilo: PDF ni v celoti naložen za tiskanje. web_fonts_disabled=Spletne pisave so onemogoÄene: vgradnih pisav za PDF ni mogoÄe uporabiti. -document_colors_not_allowed=Dokumenti PDF ne smejo uporabljati svojih lastnih barv: možnost 'Dovoli stranem uporabo lastnih barv' je v brskalniku onemogoÄena. diff --git a/third-party/pdfjs/web/locale/son/viewer.properties b/third-party/pdfjs/web/locale/son/viewer.properties index f5c1b46f5..683ed14d4 100644 --- a/third-party/pdfjs/web/locale/son/viewer.properties +++ b/third-party/pdfjs/web/locale/son/viewer.properties @@ -177,4 +177,3 @@ password_cancel=NaÅ‹ printing_not_supported=Yaamar: Karyan Å¡i tee ka timme nda ceecikaa woo. printing_not_ready=Yaamar: PDF Å¡i zunbu ka timme karyan Å¡e. web_fonts_disabled=Interneti Å¡igirawey kay: Å¡i hin ka goy nda PDF Å¡igira hurantey. -document_colors_not_allowed=PDF takaddawey Å¡i duu fondo ka ngey boÅ‹ noonawey zaa: “NaÅ‹ moɲey ma ngey boÅ‹ noonawey suuba†ši dira ceecikaa ga. diff --git a/third-party/pdfjs/web/locale/sq/viewer.properties b/third-party/pdfjs/web/locale/sq/viewer.properties index b0f12b21e..f0710af5f 100644 --- a/third-party/pdfjs/web/locale/sq/viewer.properties +++ b/third-party/pdfjs/web/locale/sq/viewer.properties @@ -238,4 +238,3 @@ password_cancel=Anuloje printing_not_supported=Kujdes: Shtypja s’mbulohet plotësisht nga ky shfletues. printing_not_ready=Kujdes: PDF-ja s’është ngarkuar plotësisht që ta shtypni. web_fonts_disabled=Shkronjat Web janë të çaktivizuara: s’arrihet të përdoren shkronja të trupëzuara në PDF. -document_colors_not_allowed=Dokumenteve PDF s’u lejohet të përdorin ngjyrat e tyre: 'Lejoji faqet t’i zgjedhin vetë ngjyrat' është e çaktivizuar te shfletuesi. diff --git a/third-party/pdfjs/web/locale/sr/viewer.properties b/third-party/pdfjs/web/locale/sr/viewer.properties index cee0a4f83..8c4e92411 100644 --- a/third-party/pdfjs/web/locale/sr/viewer.properties +++ b/third-party/pdfjs/web/locale/sr/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Откажи printing_not_supported=Упозорење: Штампање није у потпуноÑти подржано у овом прегледачу. printing_not_ready=Упозорење: PDF није у потпуноÑти учитан за штампу. web_fonts_disabled=Веб фонтови Ñу онемогућени: не могу кориÑтити уграђене PDF фонтове. -document_colors_not_allowed=PDF документи не могу да кориÑте ÑопÑтвене боје: “Дозволи Ñтраницама да изаберу Ñвоје боје†је деактивирано у прегледачу. diff --git a/third-party/pdfjs/web/locale/sv-SE/viewer.properties b/third-party/pdfjs/web/locale/sv-SE/viewer.properties index 3d2f0cf43..7c75281c3 100644 --- a/third-party/pdfjs/web/locale/sv-SE/viewer.properties +++ b/third-party/pdfjs/web/locale/sv-SE/viewer.properties @@ -137,17 +137,20 @@ print_progress_close=Avbryt # (the _label strings are alt text for the buttons, the .title strings are # tooltips) toggle_sidebar.title=Visa/dölj sidofält -toggle_sidebar_notification.title=Visa/dölj sidofält (dokument innehÃ¥ller översikt/bilagor) +toggle_sidebar_notification2.title=Visa/dölj sidofält (dokument innehÃ¥ller översikt/bilagor/lager) toggle_sidebar_label=Visa/dölj sidofält document_outline.title=Visa dokumentdisposition (dubbelklicka för att expandera/komprimera alla objekt) document_outline_label=Dokumentöversikt attachments.title=Visa Bilagor attachments_label=Bilagor +layers.title=Visa lager (dubbelklicka för att Ã¥terställa alla lager till ursrungligt läge) +layers_label=Lager thumbs.title=Visa miniatyrer thumbs_label=Miniatyrer findbar.title=Sök i dokument findbar_label=Sök +additional_layers=Ytterligare lager # LOCALIZATION NOTE (page_canvas): "{{page}}" will be replaced by the page number. page_canvas=Sida {{page}} # Thumbnails panel item (tooltip and alt text for images) @@ -245,4 +248,3 @@ password_cancel=Avbryt printing_not_supported=Varning: Utskrifter stöds inte helt av den här webbläsaren. printing_not_ready=Varning: PDF:en är inte klar för utskrift. web_fonts_disabled=Webbtypsnitt är inaktiverade: kan inte använda inbäddade PDF-typsnitt. -document_colors_not_allowed=PDF-dokument tillÃ¥ts inte använda egna färger: “LÃ¥t sidor använda egna färger†är inaktiverat i webbläsaren. diff --git a/third-party/pdfjs/web/locale/szl/viewer.properties b/third-party/pdfjs/web/locale/szl/viewer.properties new file mode 100644 index 000000000..282c59509 --- /dev/null +++ b/third-party/pdfjs/web/locale/szl/viewer.properties @@ -0,0 +1,247 @@ +# Copyright 2012 Mozilla Foundation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Main toolbar buttons (tooltips and alt text for images) +previous.title=Piyrwyjszo strÅna +previous_label=Piyrwyjszo +next.title=Nastympno strÅna +next_label=Dalij + +# LOCALIZATION NOTE (page.title): The tooltip for the pageNumber input. +page.title=StrÅna +# LOCALIZATION NOTE (of_pages): "{{pagesCount}}" will be replaced by a number +# representing the total number of pages in the document. +of_pages=ze {{pagesCount}} +# LOCALIZATION NOTE (page_of_pages): "{{pageNumber}}" and "{{pagesCount}}" +# will be replaced by a number representing the currently visible page, +# respectively a number representing the total number of pages in the document. +page_of_pages=({{pageNumber}} ze {{pagesCount}}) + +zoom_out.title=ZmyÅ„sz +zoom_out_label=ZmyÅ„sz +zoom_in.title=Zwiynksz +zoom_in_label=Zwiynksz +zoom.title=Srogość +presentation_mode.title=PrzeÅ‚Åncz na tryb prezyntacyje +presentation_mode_label=Tryb prezyntacyje +open_file.title=Ôdewrzij zbiÅr +open_file_label=Ôdewrzij +print.title=Durkuj +print_label=Durkuj +download.title=Pobier +download_label=Pobier +bookmark.title=Aktualny widok (kopiuj abo ôdewrzij w nowym ôknie) +bookmark_label=Aktualny widok + +# Secondary toolbar and context menu +tools.title=Noczynia +tools_label=Noczynia +first_page.title=Idź ku piyrszyj strÅnie +first_page.label=Idź ku piyrszyj strÅnie +first_page_label=Idź ku piyrszyj strÅnie +last_page.title=Idź ku ôstatnij strÅnie +last_page.label=Idź ku ôstatnij strÅnie +last_page_label=Idź ku ôstatnij strÅnie +page_rotate_cw.title=Zwyrtnij w prawo +page_rotate_cw.label=Zwyrtnij w prawo +page_rotate_cw_label=Zwyrtnij w prawo +page_rotate_ccw.title=Zwyrtnij w lewo +page_rotate_ccw.label=Zwyrtnij w lewo +page_rotate_ccw_label=Zwyrtnij w lewo + +cursor_text_select_tool.title=ZaÅ‚Åncz noczynie ôbiyranio tekstu +cursor_text_select_tool_label=Noczynie ôbiyranio tekstu +cursor_hand_tool.title=ZaÅ‚Åncz noczynie rÅnczka +cursor_hand_tool_label=Noczynie rÅnczka + +scroll_vertical.title=Używej piÅnowego przewijanio +scroll_vertical_label=PiÅnowe przewijanie +scroll_horizontal.title=Używej poziÅmego przewijanio +scroll_horizontal_label=PoziÅme przewijanie +scroll_wrapped.title=Używej szichtowego przewijanio +scroll_wrapped_label=Szichtowe przewijanie + +spread_none.title=Niy dowej strÅn w widoku po dwie +spread_none_label=Po jednyj strÅnie +spread_odd.title=Dej strÅny po dwie: niyparzysto i parzysto +spread_odd_label=Niyparzysto i parzysto +spread_even.title=Dej strÅny po dwie: parzysto i niyparzysto +spread_even_label=Parzysto i niyparzysto + +# Document properties dialog box +document_properties.title=WÅ‚osnoÅ›ci dokumyntu… +document_properties_label=WÅ‚osnoÅ›ci dokumyntu… +document_properties_file_name=Miano zbioru: +document_properties_file_size=Srogość zbioru: +# LOCALIZATION NOTE (document_properties_kb): "{{size_kb}}" and "{{size_b}}" +# will be replaced by the PDF file size in kilobytes, respectively in bytes. +document_properties_kb={{size_kb}} KB ({{size_b}} B) +# LOCALIZATION NOTE (document_properties_mb): "{{size_mb}}" and "{{size_b}}" +# will be replaced by the PDF file size in megabytes, respectively in bytes. +document_properties_mb={{size_mb}} MB ({{size_b}} B) +document_properties_title=TytuÅ‚: +document_properties_author=AutÅr: +document_properties_subject=Tymat: +document_properties_keywords=Kluczowe sÅ‚owa: +document_properties_creation_date=Data zrychtowanio: +document_properties_modification_date=Data zmiany: +# LOCALIZATION NOTE (document_properties_date_string): "{{date}}" and "{{time}}" +# will be replaced by the creation/modification date, and time, of the PDF file. +document_properties_date_string={{date}}, {{time}} +document_properties_creator=Zrychtowane ôd: +document_properties_producer=PDF ôd: +document_properties_version=Wersyjo PDF: +document_properties_page_count=Wielość strÅn: +document_properties_page_size=Srogość strÅny: +document_properties_page_size_unit_inches=in +document_properties_page_size_unit_millimeters=mm +document_properties_page_size_orientation_portrait=piÅnowo +document_properties_page_size_orientation_landscape=poziÅmo +document_properties_page_size_name_a3=A3 +document_properties_page_size_name_a4=A4 +document_properties_page_size_name_letter=Letter +document_properties_page_size_name_legal=Legal +# LOCALIZATION NOTE (document_properties_page_size_dimension_string): +# "{{width}}", "{{height}}", {{unit}}, and {{orientation}} will be replaced by +# the size, respectively their unit of measurement and orientation, of the (current) page. +document_properties_page_size_dimension_string={{width}} × {{height}} {{unit}} ({{orientation}}) +# LOCALIZATION NOTE (document_properties_page_size_dimension_name_string): +# "{{width}}", "{{height}}", {{unit}}, {{name}}, and {{orientation}} will be replaced by +# the size, respectively their unit of measurement, name, and orientation, of the (current) page. +document_properties_page_size_dimension_name_string={{width}} × {{height}} {{unit}} ({{name}}, {{orientation}}) +# LOCALIZATION NOTE (document_properties_linearized): The linearization status of +# the document; usually called "Fast Web View" in English locales of Adobe software. +document_properties_linearized=Gibki necowy podglÅnd: +document_properties_linearized_yes=Ja +document_properties_linearized_no=Niy +document_properties_close=Zawrzij + +print_progress_message=Rychtowanie dokumyntu do durku… +# LOCALIZATION NOTE (print_progress_percent): "{{progress}}" will be replaced by +# a numerical per cent value. +print_progress_percent={{progress}}% +print_progress_close=Pociep + +# Tooltips and alt text for side panel toolbar buttons +# (the _label strings are alt text for the buttons, the .title strings are +# tooltips) +toggle_sidebar.title=PrzeÅ‚Åncz posek na rancie +toggle_sidebar_notification.title=PrzeÅ‚Åncz posek na rancie (dokumynt mo struktura/przidowki) +toggle_sidebar_label=PrzeÅ‚Åncz posek na rancie +document_outline.title=Pokoż struktura dokumyntu (tuplowane klikniyncie rozszyrzo/swijo wszyskie elymynty) +document_outline_label=Struktura dokumyntu +attachments.title=Pokoż przidowki +attachments_label=Przidowki +thumbs.title=Pokoż miniatury +thumbs_label=Miniatury +findbar.title=Znojdź w dokumyncie +findbar_label=Znojdź + +# LOCALIZATION NOTE (page_canvas): "{{page}}" will be replaced by the page number. +page_canvas=StrÅna {{page}} +# Thumbnails panel item (tooltip and alt text for images) +# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page +# number. +thumb_page_title=StrÅna {{page}} +# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page +# number. +thumb_page_canvas=Miniatura strÅny {{page}} + +# Find panel button title and messages +find_input.title=Znojdź +find_input.placeholder=Znojdź w dokumyncie… +find_previous.title=Znojdź piyrwyjsze pokozanie sie tyj frazy +find_previous_label=Piyrwyjszo +find_next.title=Znojdź nastympne pokozanie sie tyj frazy +find_next_label=Dalij +find_highlight=Ôbznocz wszysko +find_match_case_label=Poznowej srogość liter +find_entire_word_label=CoÅ‚ke sÅ‚owa +find_reached_top=DoszÅ‚o do samego wiyrchu strÅny, dalij ôd spodku +find_reached_bottom=DoszÅ‚o do samego spodku strÅny, dalij ôd wiyrchu +# LOCALIZATION NOTE (find_match_count): The supported plural forms are +# [one|two|few|many|other], with [other] as the default value. +# "{{current}}" and "{{total}}" will be replaced by a number representing the +# index of the currently active find result, respectively a number representing +# the total number of matches in the document. +find_match_count={[ plural(total) ]} +find_match_count[one]={{current}} ze {{total}}, co pasujÅm +find_match_count[two]={{current}} ze {{total}}, co pasujÅm +find_match_count[few]={{current}} ze {{total}}, co pasujÅm +find_match_count[many]={{current}} ze {{total}}, co pasujÅm +find_match_count[other]={{current}} ze {{total}}, co pasujÅm +# LOCALIZATION NOTE (find_match_count_limit): The supported plural forms are +# [zero|one|two|few|many|other], with [other] as the default value. +# "{{limit}}" will be replaced by a numerical value. +find_match_count_limit={[ plural(total) ]} +find_match_count_limit[zero]=Wiyncyj jak {{limit}}, co pasujÅm +find_match_count_limit[one]=Wiyncyj jak {{limit}}, co pasuje +find_match_count_limit[two]=Wiyncyj jak {{limit}}, co pasujÅm +find_match_count_limit[few]=Wiyncyj jak {{limit}}, co pasujÅm +find_match_count_limit[many]=Wiyncyj jak {{limit}}, co pasujÅm +find_match_count_limit[other]=Wiyncyj jak {{limit}}, co pasujÅm +find_not_found=Fraza niy ma znodniynto + +# Error panel labels +error_more_info=Wiyncyj informacyji +error_less_info=Mynij informacyji +error_close=Zawrzij +# 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=WiadÅmość: {{message}} +# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack +# trace. +error_stack=Sztapel: {{stack}} +# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename +error_file=ZbiÅr: {{file}} +# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number +error_line=Linijo: {{line}} +rendering_error=Przi renderowaniu strÅny pokozoÅ‚ sie feler. + +# Predefined zoom values +page_scale_width=Szyrzka strÅny +page_scale_fit=Napasowanie strÅny +page_scale_auto=AutÅmatyczno srogość +page_scale_actual=Aktualno srogość +# LOCALIZATION NOTE (page_scale_percent): "{{scale}}" will be replaced by a +# numerical scale value. +page_scale_percent={{scale}}% + +# Loading indicator messages +loading_error_indicator=Feler +loading_error=Przi ladowaniu PDFa pokozoÅ‚ sie feler. +invalid_file_error=ZÅ‚y abo felerny zbiÅr PDF. +missing_file_error=Chybio zbioru PDF. +unexpected_response_error=Niyôczekowano ôdpowiydź serwera. + +# LOCALIZATION NOTE (annotation_date_string): "{{date}}" and "{{time}}" will be +# replaced by the modification date, and time, of the annotation. +annotation_date_string={{date}}, {{time}} + +# 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=[Anotacyjo typu {{type}}] +password_label=Wkludź hasÅ‚o, coby ôdewrzić tyn zbiÅr PDF. +password_invalid=HasÅ‚o je zÅ‚e. SprÅbuj jeszcze roz. +password_ok=OK +password_cancel=Pociep + +printing_not_supported=PozÅr: Ta przeglÅndarka niy coÅ‚kiym ôbsuguje durk. +printing_not_ready=PozÅr: Tyn PDF niy ma za tela zaladowany do durku. +web_fonts_disabled=Necowe fÅnty sÅm zastawiÅne: niy idzie użyć wkludzÅnych fÅntÅw PDF. diff --git a/third-party/pdfjs/web/locale/ta/viewer.properties b/third-party/pdfjs/web/locale/ta/viewer.properties index 19a8de432..669ba0c56 100644 --- a/third-party/pdfjs/web/locale/ta/viewer.properties +++ b/third-party/pdfjs/web/locale/ta/viewer.properties @@ -198,4 +198,3 @@ password_cancel=ரதà¯à®¤à¯ printing_not_supported=எசà¯à®šà®°à®¿à®•à¯à®•à¯ˆ: இநà¯à®¤ உலாவி அசà¯à®šà®¿à®Ÿà¯à®¤à®²à¯ˆ à®®à¯à®´à¯à®®à¯ˆà®¯à®¾à®• ஆதரிகà¯à®•à®µà®¿à®²à¯à®²à¯ˆ. printing_not_ready=எசà¯à®šà®°à®¿à®•à¯à®•à¯ˆ: PDF அசà¯à®šà®¿à®Ÿ à®®à¯à®´à¯à®µà®¤à¯à®®à®¾à®• à®à®±à¯à®±à®ªà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ. web_fonts_disabled=வலை எழà¯à®¤à¯à®¤à¯à®°à¯à®•à¯à®•à®³à¯ à®®à¯à®Ÿà®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà¯à®³à¯à®³à®©: உடà¯à®ªà¯Šà®¤à®¿à®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿ PDF எழà¯à®¤à¯à®¤à¯à®°à¯à®•à¯à®•à®³à¯ˆà®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤ à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ. -document_colors_not_allowed=PDF ஆவணஙà¯à®•à®³à¯à®•à¯à®•à¯à®šà¯ சொநà¯à®¤ நிறஙà¯à®•à®³à¯ˆà®ªà¯ பயனà¯à®ªà®Ÿà¯à®¤à¯à®¤ அனà¯à®®à®¤à®¿à®¯à®¿à®²à¯à®²à¯ˆ: உலாவியில௠"பகà¯à®•à®™à¯à®•à®³à¯ தஙà¯à®•à®³à¯ சொநà¯à®¤ நிறஙà¯à®•à®³à¯ˆà®¤à¯ தேரà¯à®µà¯ செயà¯à®¤à¯à®•à¯Šà®³à¯à®³ அனà¯à®®à®¤à®¿" எனà¯à®©à¯à®®à¯ விரà¯à®ªà¯à®ªà®®à¯ à®®à¯à®Ÿà®•à¯à®•à®ªà¯à®ªà®Ÿà¯à®Ÿà¯à®³à¯à®³à®¤à¯. diff --git a/third-party/pdfjs/web/locale/te/viewer.properties b/third-party/pdfjs/web/locale/te/viewer.properties index 56f954d43..498b64c8d 100644 --- a/third-party/pdfjs/web/locale/te/viewer.properties +++ b/third-party/pdfjs/web/locale/te/viewer.properties @@ -219,4 +219,3 @@ password_cancel=à°°à°¦à±à°¦à±à°šà±‡à°¯à°¿ printing_not_supported=హెచà±à°šà°°à°¿à°•: à°ˆ విహారిణి చేత à°®à±à°¦à±à°°à°£ పూరà±à°¤à°¿à°—à°¾ తోడà±à°ªà°¾à°Ÿà± లేదà±. printing_not_ready=హెచà±à°šà°°à°¿à°•: à°®à±à°¦à±à°°à°£ కొరకౠఈ PDF పూరà±à°¤à°¿à°—à°¾ లోడవలేదà±. web_fonts_disabled=వెబౠఫాంటà±à°²à± అచేతనించబడెనà±: ఎంబెడెడౠPDF ఫాంటà±à°²à± ఉపయోగించలేక పోయింది. -document_colors_not_allowed=PDF పతà±à°°à°¾à°²à± వాటి à°¸à±à°µà°‚à°¤ à°°à°‚à°—à±à°²à°¨à± ఉపయోగించà±à°•à±Šà°¨à±à°Ÿà°•à± à°…à°¨à±à°®à°¤à°¿à°‚చబడవà±: విహరణి నందౠ“పేజీలనౠవాటి à°¸à±à°µà°‚à°¤ à°°à°‚à°—à±à°²à°¨à± à°Žà°‚à°šà±à°•à±Šà°¨à±à°Ÿà°•à± à°…à°¨à±à°®à°¤à°¿à°‚à°šà±â€ అచేతనం చేయబడివà±à°‚ది. diff --git a/third-party/pdfjs/web/locale/th/viewer.properties b/third-party/pdfjs/web/locale/th/viewer.properties index b66865fd1..a4ef7db14 100644 --- a/third-party/pdfjs/web/locale/th/viewer.properties +++ b/third-party/pdfjs/web/locale/th/viewer.properties @@ -245,4 +245,3 @@ password_cancel=ยà¸à¹€à¸¥à¸´à¸ printing_not_supported=คำเตืà¸à¸™: เบราว์เซà¸à¸£à¹Œà¸™à¸µà¹‰à¹„ม่ได้สนับสนุนà¸à¸²à¸£à¸žà¸´à¸¡à¸žà¹Œà¸à¸¢à¹ˆà¸²à¸‡à¹€à¸•à¹‡à¸¡à¸—ี่ printing_not_ready=คำเตืà¸à¸™: PDF ไม่ได้รับà¸à¸²à¸£à¹‚หลดà¸à¸¢à¹ˆà¸²à¸‡à¹€à¸•à¹‡à¸¡à¸—ี่สำหรับà¸à¸²à¸£à¸žà¸´à¸¡à¸žà¹Œ web_fonts_disabled=à¹à¸šà¸šà¸à¸±à¸à¸©à¸£à¹€à¸§à¹‡à¸šà¸–ูà¸à¸›à¸´à¸”ใช้งาน: ไม่สามารถใช้à¹à¸šà¸šà¸à¸±à¸à¸©à¸£ PDF à¸à¸±à¸‡à¸•à¸±à¸§ -document_colors_not_allowed=เà¸à¸à¸ªà¸²à¸£ PDF ไม่ได้รับà¸à¸™à¸¸à¸à¸²à¸•à¹ƒà¸«à¹‰à¹ƒà¸Šà¹‰à¸ªà¸µà¸‚à¸à¸‡à¸•à¸±à¸§à¹€à¸à¸‡: "à¸à¸™à¸¸à¸à¸²à¸•à¹ƒà¸«à¹‰à¸«à¸™à¹‰à¸²à¹€à¸à¸à¸ªà¸²à¸£à¸ªà¸²à¸¡à¸²à¸£à¸–เลืà¸à¸à¸ªà¸µà¸‚à¸à¸‡à¸•à¸±à¸§à¹€à¸à¸‡" ถูà¸à¸›à¸´à¸”ใช้งานในเบราว์เซà¸à¸£à¹Œ diff --git a/third-party/pdfjs/web/locale/tl/viewer.properties b/third-party/pdfjs/web/locale/tl/viewer.properties index 32b348340..0209da154 100644 --- a/third-party/pdfjs/web/locale/tl/viewer.properties +++ b/third-party/pdfjs/web/locale/tl/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Kanselahin printing_not_supported=Warning: Printing is not fully supported by this browser. printing_not_ready=Warning: The PDF is not fully loaded for printing. web_fonts_disabled=Web fonts are disabled: unable to use embedded PDF fonts. -document_colors_not_allowed=PDF documents are not allowed to use their own colors: “Allow pages to choose their own colors†is deactivated in the browser. diff --git a/third-party/pdfjs/web/locale/tr/viewer.properties b/third-party/pdfjs/web/locale/tr/viewer.properties index f398fc9f5..b189186c2 100644 --- a/third-party/pdfjs/web/locale/tr/viewer.properties +++ b/third-party/pdfjs/web/locale/tr/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Ä°ptal printing_not_supported=Uyarı: Yazdırma bu tarayıcı tarafından tam olarak desteklenmemektedir. printing_not_ready=Uyarı: PDF tamamen yüklenmedi ve yazdırmaya hazır deÄŸil. web_fonts_disabled=Web fontları devre dışı: Gömülü PDF fontları kullanılamıyor. -document_colors_not_allowed=PDF belgelerinin kendi renklerini kullanması için izin verilmiyor: “Sayfalara kendi renklerini seçmesi için izin ver†tarayıcıda etkinleÅŸtirilmemiÅŸ. diff --git a/third-party/pdfjs/web/locale/uk/viewer.properties b/third-party/pdfjs/web/locale/uk/viewer.properties index 599c8f916..7b3a69c55 100644 --- a/third-party/pdfjs/web/locale/uk/viewer.properties +++ b/third-party/pdfjs/web/locale/uk/viewer.properties @@ -62,8 +62,8 @@ page_rotate_ccw_label=Повернути проти годинникової ÑÑ cursor_text_select_tool.title=Увімкнути інÑтрумент вибору текÑту cursor_text_select_tool_label=ІнÑтрумент вибору текÑту -cursor_hand_tool.title=Увімкнути інÑтрумент «Рука» -cursor_hand_tool_label=ІнÑтрумент «Рука» +cursor_hand_tool.title=Увімкнути інÑтрумент "Рука" +cursor_hand_tool_label=ІнÑтрумент "Рука" scroll_vertical.title=ВикориÑтовувати вертикальне Ð¿Ñ€Ð¾ÐºÑ€ÑƒÑ‡ÑƒÐ²Ð°Ð½Ð½Ñ scroll_vertical_label=Вертикальне Ð¿Ñ€Ð¾ÐºÑ€ÑƒÑ‡ÑƒÐ²Ð°Ð½Ð½Ñ @@ -214,8 +214,8 @@ rendering_error=Під Ñ‡Ð°Ñ Ð²Ð¸Ð²ÐµÐ´ÐµÐ½Ð½Ñ Ñторінки ÑталаÑÑ # Predefined zoom values page_scale_width=За шириною -page_scale_fit=УміÑтити -page_scale_auto=Ðвто-маÑштаб +page_scale_fit=ВміÑтити +page_scale_auto=ÐвтомаÑштаб page_scale_actual=ДійÑний розмір # LOCALIZATION NOTE (page_scale_percent): "{{scale}}" will be replaced by a # numerical scale value. @@ -245,4 +245,3 @@ password_cancel=СкаÑувати printing_not_supported=ПопередженнÑ: Цей браузер не повніÑÑ‚ÑŽ підтримує друк. printing_not_ready=ПопередженнÑ: PDF не повніÑÑ‚ÑŽ завантажений Ð´Ð»Ñ Ð´Ñ€ÑƒÐºÑƒ. web_fonts_disabled=Веб-шрифти вимкнено: неможливо викориÑтати вбудовані у PDF шрифти. -document_colors_not_allowed=PDF-документам не дозволено викориÑтовувати влаÑні кольори: в браузері вимкнено параметр «Дозволити Ñторінкам викориÑтовувати влаÑні кольори». diff --git a/third-party/pdfjs/web/locale/ur/viewer.properties b/third-party/pdfjs/web/locale/ur/viewer.properties index 78e2029d4..162ca1475 100644 --- a/third-party/pdfjs/web/locale/ur/viewer.properties +++ b/third-party/pdfjs/web/locale/ur/viewer.properties @@ -171,7 +171,7 @@ find_reached_bottom=صÙØÛ Ú©Û’ اختتام پر Ù¾ÛÙ†Ú† گیا، اوپر Ø # index of the currently active find result, respectively a number representing # the total number of matches in the document. find_match_count={[ plural(total) ]} -find_match_count[one]={{total}} میچ کا {{current}}. +find_match_count[one]={{total}} میچ کا {{current}} find_match_count[few]={{total}} میچوں میں سے {{current}} find_match_count[many]={{total}} میچوں میں سے {{current}} find_match_count[other]={{total}} میچوں میں سے {{current}} @@ -239,4 +239,3 @@ password_cancel=منسوخ کریں printing_not_supported=تنبیÛ:چھاپنا اس براؤزر پر پوری Ø·Ø±Ø Ù…Ø¹Ø§ÙˆÙ†Øª Ø´Ø¯Û Ù†Ûیں ÛÛ’Û” printing_not_ready=تنبیÛ: PDF چھپائی Ú©Û’ لیے پوری Ø·Ø±Ø Ù„ÙˆÚˆ Ù†Ûیں Ûوئی۔ web_fonts_disabled=ویب Ùانٹ نا اÛÙ„ Ûیں: شامل PDF Ùانٹ استعمال کرنے میں ناکام۔ -document_colors_not_allowed=PDF دستاویزات Ú©Ùˆ اپنے رنگ استعمال کرنے Ú©ÛŒ اجازت Ù†Ûیں: 'صÙØات Ú©Ùˆ اپنے رنگ چنیں' Ú©ÛŒ اÙجازت براؤزر میں بے عمل ÛÛ’Û” diff --git a/third-party/pdfjs/web/locale/uz/viewer.properties b/third-party/pdfjs/web/locale/uz/viewer.properties index e451c74ff..6ad24319e 100644 --- a/third-party/pdfjs/web/locale/uz/viewer.properties +++ b/third-party/pdfjs/web/locale/uz/viewer.properties @@ -166,4 +166,3 @@ password_ok=OK printing_not_supported=Diqqat: chop qilish bruzer tomonidan toÊ»liq qoÊ»llab-quvvatlanmaydi. printing_not_ready=Diqqat: PDF fayl chop qilish uchun toÊ»liq yuklanmadi. web_fonts_disabled=Veb shriftlar oÊ»chirilgan: ichki PDF shriftlardan foydalanib boÊ»lmmaydi. -document_colors_not_allowed=PDF hujjat oÊ»zining ranglaridan foydalanishga ruxsat bermaydi: 'Sahifalarga oÊ»zining rangidan foydalanishga ruxsat berish' ushbu brauzerda oÊ»chirib qoÊ»yilgan. diff --git a/third-party/pdfjs/web/locale/vi/viewer.properties b/third-party/pdfjs/web/locale/vi/viewer.properties index b8ee16e5c..64ae6e3a2 100644 --- a/third-party/pdfjs/web/locale/vi/viewer.properties +++ b/third-party/pdfjs/web/locale/vi/viewer.properties @@ -245,4 +245,3 @@ password_cancel=Hủy bá» printing_not_supported=Cảnh báo: In ấn không được há»— trợ đầy đủ ở trình duyệt nà y. printing_not_ready=Cảnh báo: PDF chÆ°a được tải hết để in. web_fonts_disabled=Phông chữ Web bị vô hiệu hóa: không thể sá» dụng các phông chữ PDF được nhúng. -document_colors_not_allowed=Tà i liệu PDF không được cho phép dùng mà u riêng: 'Cho phép trang chá»n mà u riêng' đã bị tắt trên trình duyệt. diff --git a/third-party/pdfjs/web/locale/xh/viewer.properties b/third-party/pdfjs/web/locale/xh/viewer.properties index 1fa394bbd..52cd75e5b 100644 --- a/third-party/pdfjs/web/locale/xh/viewer.properties +++ b/third-party/pdfjs/web/locale/xh/viewer.properties @@ -181,4 +181,3 @@ password_cancel=Rhoxisa printing_not_supported=Isilumkiso: Ukuprinta akuxhaswa ngokupheleleyo yile bhrawuza. printing_not_ready=Isilumkiso: IPDF ayihlohlwanga ngokupheleleyo ukwenzela ukuprinta. web_fonts_disabled=Iifonti zewebhu ziqhwalelisiwe: ayikwazi ukusebenzisa iifonti ze-PDF ezincanyathelisiweyo. -document_colors_not_allowed=Amaxwebhu ePDF akavumelekanga ukuba asebenzise imibala yawo: 'Ukuvumela amaphepha ukuba asebenzise eyawo imibala' kuvaliwe ukuba kungasebenzi kwibhrawuza. diff --git a/third-party/pdfjs/web/locale/zh-CN/viewer.properties b/third-party/pdfjs/web/locale/zh-CN/viewer.properties index 2dc609bfb..214c746f1 100644 --- a/third-party/pdfjs/web/locale/zh-CN/viewer.properties +++ b/third-party/pdfjs/web/locale/zh-CN/viewer.properties @@ -245,4 +245,3 @@ password_cancel=å–消 printing_not_supported=è¦å‘Šï¼šæ¤æµè§ˆå™¨å°šæœªå®Œæ•´æ”¯æŒæ‰“å°åŠŸèƒ½ã€‚ printing_not_ready=è¦å‘Šï¼šæ¤ PDF 未完æˆè½½å…¥ï¼Œæ— 法打å°ã€‚ web_fonts_disabled=Web å—体已被ç¦ç”¨ï¼šæ— 法使用嵌入的 PDF å—体。 -document_colors_not_allowed=PDF æ–‡æ¡£æ— æ³•ä½¿ç”¨è‡ªå·±çš„é¢œè‰²ï¼šæµè§ˆå™¨ä¸â€œå…许页é¢é€‰æ‹©è‡ªå·±çš„颜色â€çš„选项未被勾选。 diff --git a/third-party/pdfjs/web/locale/zh-TW/viewer.properties b/third-party/pdfjs/web/locale/zh-TW/viewer.properties index 29ff043bf..55626cabd 100644 --- a/third-party/pdfjs/web/locale/zh-TW/viewer.properties +++ b/third-party/pdfjs/web/locale/zh-TW/viewer.properties @@ -245,4 +245,3 @@ password_cancel=å–消 printing_not_supported=è¦å‘Š: æ¤ç€è¦½å™¨æœªå®Œæ•´æ”¯æ´åˆ—å°åŠŸèƒ½ã€‚ printing_not_ready=è¦å‘Š: æ¤ PDF 未完æˆä¸‹è¼‰ä»¥ä¾›åˆ—å°ã€‚ web_fonts_disabled=å·²åœç”¨ç¶²è·¯å—åž‹ (Web fonts): 無法使用 PDF 內嵌å—型。 -document_colors_not_allowed=ç€è¦½å™¨çš„「優先使用網é 指定的色彩ã€æœªè¢«å‹¾é¸ï¼ŒPDF 文件無法使用自己的色彩。 diff --git a/third-party/pdfjs/web/viewer.css b/third-party/pdfjs/web/viewer.css index 8711953bf..605cad57e 100644 --- a/third-party/pdfjs/web/viewer.css +++ b/third-party/pdfjs/web/viewer.css @@ -1,5 +1,4 @@ /* Copyright 2014 Mozilla Foundation - * Modifications made for Epiphany by Jan-Michael Brummer <jan.brummer@tabos.org> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +21,7 @@ bottom: 0; overflow: hidden; opacity: 0.2; - line-height: 1.0; + line-height: 1; } .textLayer > span { @@ -169,7 +168,7 @@ .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after, .annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before { background-color: rgba(0, 0, 0, 1); - content: ''; + content: ""; display: block; position: absolute; } @@ -309,13 +308,16 @@ border: none; } -.pdfViewer.scrollHorizontal, .pdfViewer.scrollWrapped, .spread { +.pdfViewer.scrollHorizontal, +.pdfViewer.scrollWrapped, +.spread { margin-left: 3.5px; margin-right: 3.5px; text-align: center; } -.pdfViewer.scrollHorizontal, .spread { +.pdfViewer.scrollHorizontal, +.spread { white-space: nowrap; } @@ -365,7 +367,7 @@ top: 0; right: 0; bottom: 0; - background: url('images/loading-icon.gif') center no-repeat; + background: url("images/loading-icon.gif") center no-repeat; } .pdfPresentationMode .pdfViewer { @@ -407,6 +409,149 @@ --sidebar-width: 200px; --sidebar-transition-duration: 200ms; --sidebar-transition-timing-function: ease; + + --toolbar-icon-opacity: 0.7; + --doorhanger-icon-opacity: 0.9; + + --main-color: rgba(12, 12, 13, 1); + --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; + + --sidebar-bg-color: rgba(245, 246, 247, 1); + --toolbar-bg-color: rgba(249, 249, 250, 1); + --toolbar-border-color: rgba(204, 204, 204, 1); + --button-hover-color: rgba(221, 222, 223, 1); + --toggled-btn-bg-color: rgba(0, 0, 0, 0.3); + --dropdown-btn-bg-color: rgba(215, 215, 219, 1); + --separator-color: rgba(0, 0, 0, 0.3); + --field-color: rgba(6, 6, 6, 1); + --field-bg-color: rgba(255, 255, 255, 1); + --field-border-color: rgba(187, 187, 188, 1); + --findbar-nextprevious-btn-bg-color: rgba(227, 228, 230, 1); + --outline-color: rgba(0, 0, 0, 0.8); + --outline-hover-color: rgba(0, 0, 0, 0.9); + --outline-active-color: rgba(0, 0, 0, 0.08); + --outline-active-bg-color: rgba(0, 0, 0, 1); + --sidebaritem-bg-color: rgba(0, 0, 0, 0.15); + --doorhanger-bg-color: rgba(255, 255, 255, 1); + --doorhanger-border-color: rgba(12, 12, 13, 0.2); + --doorhanger-hover-color: rgba(237, 237, 237, 1); + --doorhanger-separator-color: rgba(222, 222, 222, 1); + --overlay-button-bg-color: rgba(12, 12, 13, 0.1); + --overlay-button-hover-color: rgba(12, 12, 13, 0.3); + + --loading-icon: url(images/loading.svg); + --treeitem-expanded-icon: url(images/treeitem-expanded.svg); + --treeitem-collapsed-icon: url(images/treeitem-collapsed.svg); + --toolbarButton-menuArrow-icon: url(images/toolbarButton-menuArrow.svg); + --toolbarButton-sidebarToggle-icon: url(images/toolbarButton-sidebarToggle.svg); + --toolbarButton-secondaryToolbarToggle-icon: url(images/toolbarButton-secondaryToolbarToggle.svg); + --toolbarButton-pageUp-icon: url(images/toolbarButton-pageUp.svg); + --toolbarButton-pageDown-icon: url(images/toolbarButton-pageDown.svg); + --toolbarButton-zoomOut-icon: url(images/toolbarButton-zoomOut.svg); + --toolbarButton-zoomIn-icon: url(images/toolbarButton-zoomIn.svg); + --toolbarButton-presentationMode-icon: url(images/toolbarButton-presentationMode.svg); + --toolbarButton-print-icon: url(images/toolbarButton-print.svg); + --toolbarButton-openFile-icon: url(images/toolbarButton-openFile.svg); + --toolbarButton-download-icon: url(images/toolbarButton-download.svg); + --toolbarButton-bookmark-icon: url(images/toolbarButton-bookmark.svg); + --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); + --secondaryToolbarButton-firstPage-icon: url(images/secondaryToolbarButton-firstPage.svg); + --secondaryToolbarButton-lastPage-icon: url(images/secondaryToolbarButton-lastPage.svg); + --secondaryToolbarButton-rotateCcw-icon: url(images/secondaryToolbarButton-rotateCcw.svg); + --secondaryToolbarButton-rotateCw-icon: url(images/secondaryToolbarButton-rotateCw.svg); + --secondaryToolbarButton-selectTool-icon: url(images/secondaryToolbarButton-selectTool.svg); + --secondaryToolbarButton-handTool-icon: url(images/secondaryToolbarButton-handTool.svg); + --secondaryToolbarButton-scrollVertical-icon: url(images/secondaryToolbarButton-scrollVertical.svg); + --secondaryToolbarButton-scrollHorizontal-icon: url(images/secondaryToolbarButton-scrollHorizontal.svg); + --secondaryToolbarButton-scrollWrapped-icon: url(images/secondaryToolbarButton-scrollWrapped.svg); + --secondaryToolbarButton-spreadNone-icon: url(images/secondaryToolbarButton-spreadNone.svg); + --secondaryToolbarButton-spreadOdd-icon: url(images/secondaryToolbarButton-spreadOdd.svg); + --secondaryToolbarButton-spreadEven-icon: url(images/secondaryToolbarButton-spreadEven.svg); + --secondaryToolbarButton-documentProperties-icon: url(images/secondaryToolbarButton-documentProperties.svg); +} + +@media (prefers-color-scheme: dark) { + :root { + --main-color: rgba(249, 249, 250, 1); + --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); + + --sidebar-bg-color: rgba(50, 50, 52, 1); + --toolbar-bg-color: rgba(56, 56, 61, 1); + --toolbar-border-color: rgba(12, 12, 13, 1); + --button-hover-color: rgba(102, 102, 103, 1); + --toggled-btn-bg-color: rgba(0, 0, 0, 0.3); + --dropdown-btn-bg-color: rgba(74, 74, 79, 1); + --separator-color: rgba(0, 0, 0, 0.3); + --field-color: rgba(250, 250, 250, 1); + --field-bg-color: rgba(64, 64, 68, 1); + --field-border-color: rgba(115, 115, 115, 1); + --findbar-nextprevious-btn-bg-color: rgba(89, 89, 89, 1); + --outline-color: rgba(255, 255, 255, 0.8); + --outline-hover-color: rgba(255, 255, 255, 0.9); + --outline-active-color: rgba(255, 255, 255, 0.08); + --outline-active-bg-color: rgba(255, 255, 255, 1); + --sidebaritem-bg-color: rgba(255, 255, 255, 0.15); + --doorhanger-bg-color: rgba(74, 74, 79, 1); + --doorhanger-border-color: rgba(39, 39, 43, 1); + --doorhanger-hover-color: rgba(93, 94, 98, 1); + --doorhanger-separator-color: rgba(92, 92, 97, 1); + --overlay-button-bg-color: rgba(92, 92, 97, 1); + --overlay-button-hover-color: rgba(115, 115, 115, 1); + + --loading-icon: url(images/loading-dark.svg); + --treeitem-expanded-icon: url(images/treeitem-expanded-dark.svg); + --treeitem-collapsed-icon: url(images/treeitem-collapsed-dark.svg); + --toolbarButton-menuArrow-icon: url(images/toolbarButton-menuArrow-dark.svg); + --toolbarButton-sidebarToggle-icon: url(images/toolbarButton-sidebarToggle-dark.svg); + --toolbarButton-secondaryToolbarToggle-icon: url(images/toolbarButton-secondaryToolbarToggle-dark.svg); + --toolbarButton-pageUp-icon: url(images/toolbarButton-pageUp-dark.svg); + --toolbarButton-pageDown-icon: url(images/toolbarButton-pageDown-dark.svg); + --toolbarButton-zoomOut-icon: url(images/toolbarButton-zoomOut-dark.svg); + --toolbarButton-zoomIn-icon: url(images/toolbarButton-zoomIn-dark.svg); + --toolbarButton-presentationMode-icon: url(images/toolbarButton-presentationMode-dark.svg); + --toolbarButton-print-icon: url(images/toolbarButton-print-dark.svg); + --toolbarButton-openFile-icon: url(images/toolbarButton-openFile-dark.svg); + --toolbarButton-download-icon: url(images/toolbarButton-download-dark.svg); + --toolbarButton-bookmark-icon: url(images/toolbarButton-bookmark-dark.svg); + --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); + --secondaryToolbarButton-firstPage-icon: url(images/secondaryToolbarButton-firstPage-dark.svg); + --secondaryToolbarButton-lastPage-icon: url(images/secondaryToolbarButton-lastPage-dark.svg); + --secondaryToolbarButton-rotateCcw-icon: url(images/secondaryToolbarButton-rotateCcw-dark.svg); + --secondaryToolbarButton-rotateCw-icon: url(images/secondaryToolbarButton-rotateCw-dark.svg); + --secondaryToolbarButton-selectTool-icon: url(images/secondaryToolbarButton-selectTool-dark.svg); + --secondaryToolbarButton-handTool-icon: url(images/secondaryToolbarButton-handTool-dark.svg); + --secondaryToolbarButton-scrollVertical-icon: url(images/secondaryToolbarButton-scrollVertical-dark.svg); + --secondaryToolbarButton-scrollHorizontal-icon: url(images/secondaryToolbarButton-scrollHorizontal-dark.svg); + --secondaryToolbarButton-scrollWrapped-icon: url(images/secondaryToolbarButton-scrollWrapped-dark.svg); + --secondaryToolbarButton-spreadNone-icon: url(images/secondaryToolbarButton-spreadNone-dark.svg); + --secondaryToolbarButton-spreadOdd-icon: url(images/secondaryToolbarButton-spreadOdd-dark.svg); + --secondaryToolbarButton-spreadEven-icon: url(images/secondaryToolbarButton-spreadEven-dark.svg); + --secondaryToolbarButton-documentProperties-icon: url(images/secondaryToolbarButton-documentProperties-dark.svg); + } } * { @@ -424,16 +569,172 @@ html { body { height: 100%; width: 100%; - background-color: rgba(64, 64, 64, 1); - background-image: url(images/texture.png); + background-color: rgba(237, 237, 240, 1); + background-color: var(--body-bg-color); +} + +@media (prefers-color-scheme: dark) { + + body { + background-color: rgba(42, 42, 46, 1); + background-color: var(--body-bg-color); + } +} + +body { + font: message-box; + outline: none; + scrollbar-color: auto auto; + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); +} + +@media (prefers-color-scheme: dark) { + + body { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } +} + +@media (prefers-color-scheme: dark) { + + body { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } +} + +@media (prefers-color-scheme: dark) { + + body { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } +} + +@media (prefers-color-scheme: dark) { + + body { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } +} + +input { + font: message-box; + outline: none; + scrollbar-color: auto auto; + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); +} + +@media (prefers-color-scheme: dark) { + + input { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } +} + +@media (prefers-color-scheme: dark) { + + input { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } +} + +@media (prefers-color-scheme: dark) { + + input { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } +} + +@media (prefers-color-scheme: dark) { + + input { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } +} + +button { + font: message-box; + outline: none; + scrollbar-color: auto auto; + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); +} + +@media (prefers-color-scheme: dark) { + + button { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } +} + +@media (prefers-color-scheme: dark) { + + button { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } +} + +@media (prefers-color-scheme: dark) { + + button { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } +} + +@media (prefers-color-scheme: dark) { + + button { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } } -body, -input, -button, select { font: message-box; outline: none; + scrollbar-color: auto auto; + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); +} + +@media (prefers-color-scheme: dark) { + + select { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } +} + +@media (prefers-color-scheme: dark) { + + select { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } +} + +@media (prefers-color-scheme: dark) { + + select { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } +} + +@media (prefers-color-scheme: dark) { + + select { + scrollbar-color: rgba(121, 121, 123, 1) rgba(35, 35, 39, 1); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); + } } .hidden { @@ -567,12 +868,12 @@ select { transition-timing-function: ease; transition-timing-function: var(--sidebar-transition-timing-function); } -html[dir='ltr'] #sidebarContainer { +html[dir="ltr"] #sidebarContainer { transition-property: left; left: -200px; left: calc(0px - var(--sidebar-width)); } -html[dir='rtl'] #sidebarContainer { +html[dir="rtl"] #sidebarContainer { transition-property: right; right: -200px; right: calc(0px - var(--sidebar-width)); @@ -596,10 +897,10 @@ html[dir='rtl'] #sidebarContainer { #outerContainer.sidebarOpen #sidebarContainer { visibility: visible; } -html[dir='ltr'] #outerContainer.sidebarOpen #sidebarContainer { +html[dir="ltr"] #outerContainer.sidebarOpen #sidebarContainer { left: 0px; } -html[dir='rtl'] #outerContainer.sidebarOpen #sidebarContainer { +html[dir="rtl"] #outerContainer.sidebarOpen #sidebarContainer { right: 0px; } @@ -621,11 +922,11 @@ html[dir='rtl'] #outerContainer.sidebarOpen #sidebarContainer { width: 100%; background-color: rgba(0, 0, 0, 0.1); } -html[dir='ltr'] #sidebarContent { +html[dir="ltr"] #sidebarContent { left: 0; box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.25); } -html[dir='rtl'] #sidebarContent { +html[dir="rtl"] #sidebarContent { right: 0; box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.25); } @@ -646,24 +947,22 @@ html[dir='rtl'] #sidebarContent { transition-timing-function: ease; transition-timing-function: var(--sidebar-transition-timing-function); } -html[dir='ltr'] #viewerContainer { - box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.05); -} -html[dir='rtl'] #viewerContainer { - box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05); -} #outerContainer.sidebarResizing #viewerContainer { /* Improve responsiveness and avoid visual glitches when the sidebar is resized. */ transition-duration: 0s; } -html[dir='ltr'] #outerContainer.sidebarOpen #viewerContainer:not(.pdfPresentationMode) { +html[dir="ltr"] + #outerContainer.sidebarOpen + #viewerContainer:not(.pdfPresentationMode) { transition-property: left; left: 200px; left: var(--sidebar-width); } -html[dir='rtl'] #outerContainer.sidebarOpen #viewerContainer:not(.pdfPresentationMode) { +html[dir="rtl"] + #outerContainer.sidebarOpen + #viewerContainer:not(.pdfPresentationMode) { transition-property: right; right: 200px; right: var(--sidebar-width); @@ -684,21 +983,31 @@ html[dir='rtl'] #outerContainer.sidebarOpen #viewerContainer:not(.pdfPresentatio #toolbarSidebar { width: 100%; height: 32px; - background-color: rgba(66, 66, 66, 1); /* fallback */ - background-image: url(images/texture.png), - linear-gradient(rgba(77, 77, 77, 0.99), rgba(64, 64, 64, 0.95)); + background-color: rgba(245, 246, 247, 1); + background-color: var(--sidebar-bg-color); +} + +@media (prefers-color-scheme: dark) { + + #toolbarSidebar { + background-color: rgba(50, 50, 52, 1); + background-color: var(--sidebar-bg-color); + } +} +html[dir="ltr"] #toolbarSidebar { + box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.25), 0 1px 0 rgba(0, 0, 0, 0.15), + 0 0 1px rgba(0, 0, 0, 0.1); } -html[dir='ltr'] #toolbarSidebar { - box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.25), - inset 0 -1px 0 rgba(255, 255, 255, 0.05), - 0 1px 0 rgba(0, 0, 0, 0.15), - 0 0 1px rgba(0, 0, 0, 0.1); +html[dir="rtl"] #toolbarSidebar { + box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.25), 0 1px 0 rgba(0, 0, 0, 0.15), + 0 0 1px rgba(0, 0, 0, 0.1); } -html[dir='rtl'] #toolbarSidebar { - box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.25), - inset 0 1px 0 rgba(255, 255, 255, 0.05), - 0 1px 0 rgba(0, 0, 0, 0.15), - 0 0 1px rgba(0, 0, 0, 0.1); + +html[dir="ltr"] #toolbarSidebar .toolbarButton { + margin-right: 2px !important; +} +html[dir="rtl"] #toolbarSidebar .toolbarButton { + margin-left: 2px !important; } #sidebarResizer { @@ -709,31 +1018,122 @@ html[dir='rtl'] #toolbarSidebar { z-index: 200; cursor: ew-resize; } -html[dir='ltr'] #sidebarResizer { +html[dir="ltr"] #sidebarResizer { right: -6px; } -html[dir='rtl'] #sidebarResizer { +html[dir="rtl"] #sidebarResizer { left: -6px; } -#toolbarContainer, .findbar, .secondaryToolbar { +#toolbarContainer { + position: relative; + height: 32px; + background-color: rgba(249, 249, 250, 1); + background-color: var(--toolbar-bg-color); +} + +@media (prefers-color-scheme: dark) { + + #toolbarContainer { + background-color: rgba(56, 56, 61, 1); + background-color: var(--toolbar-bg-color); + } +} + +.findbar { + position: relative; + height: 32px; + background-color: rgba(249, 249, 250, 1); + background-color: var(--toolbar-bg-color); +} + +@media (prefers-color-scheme: dark) { + + .findbar { + background-color: rgba(56, 56, 61, 1); + background-color: var(--toolbar-bg-color); + } +} + +.secondaryToolbar { position: relative; height: 32px; - background-color: rgba(71, 71, 71, 1); /* fallback */ - background-image: url(images/texture.png), - linear-gradient(rgba(82, 82, 82, 0.99), rgba(69, 69, 69, 0.95)); + background-color: rgba(249, 249, 250, 1); + background-color: var(--toolbar-bg-color); +} + +@media (prefers-color-scheme: dark) { + + .secondaryToolbar { + background-color: rgba(56, 56, 61, 1); + background-color: var(--toolbar-bg-color); + } +} +html[dir="ltr"] #toolbarContainer { + box-shadow: 0 1px 0 rgba(204, 204, 204, 1); + box-shadow: 0 1px 0 var(--toolbar-border-color); +} +@media (prefers-color-scheme: dark) { + + html[dir="ltr"] #toolbarContainer { + box-shadow: 0 1px 0 rgba(12, 12, 13, 1); + box-shadow: 0 1px 0 var(--toolbar-border-color); + } +} +.findbar { + box-shadow: 0 1px 0 rgba(204, 204, 204, 1); + box-shadow: 0 1px 0 var(--toolbar-border-color); +} +@media (prefers-color-scheme: dark) { + + .findbar { + box-shadow: 0 1px 0 rgba(12, 12, 13, 1); + box-shadow: 0 1px 0 var(--toolbar-border-color); + } +} +.secondaryToolbar { + box-shadow: 0 1px 0 rgba(204, 204, 204, 1); + box-shadow: 0 1px 0 var(--toolbar-border-color); +} +@media (prefers-color-scheme: dark) { + + .secondaryToolbar { + box-shadow: 0 1px 0 rgba(12, 12, 13, 1); + box-shadow: 0 1px 0 var(--toolbar-border-color); + } } -html[dir='ltr'] #toolbarContainer, .findbar, .secondaryToolbar { - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.15), - inset 0 -1px 0 rgba(255, 255, 255, 0.05), - 0 1px 0 rgba(0, 0, 0, 0.15), - 0 1px 1px rgba(0, 0, 0, 0.1); +html[dir="rtl"] #toolbarContainer { + box-shadow: 0 1px 0 rgba(204, 204, 204, 1); + box-shadow: 0 1px 0 var(--toolbar-border-color); } -html[dir='rtl'] #toolbarContainer, .findbar, .secondaryToolbar { - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.15), - inset 0 -1px 0 rgba(255, 255, 255, 0.05), - 0 1px 0 rgba(0, 0, 0, 0.15), - 0 1px 1px rgba(0, 0, 0, 0.1); +@media (prefers-color-scheme: dark) { + + html[dir="rtl"] #toolbarContainer { + box-shadow: 0 1px 0 rgba(12, 12, 13, 1); + box-shadow: 0 1px 0 var(--toolbar-border-color); + } +} +.findbar { + box-shadow: 0 1px 0 rgba(204, 204, 204, 1); + box-shadow: 0 1px 0 var(--toolbar-border-color); +} +@media (prefers-color-scheme: dark) { + + .findbar { + box-shadow: 0 1px 0 rgba(12, 12, 13, 1); + box-shadow: 0 1px 0 var(--toolbar-border-color); + } +} +.secondaryToolbar { + box-shadow: 0 1px 0 rgba(204, 204, 204, 1); + box-shadow: 0 1px 0 var(--toolbar-border-color); +} +@media (prefers-color-scheme: dark) { + + .secondaryToolbar { + box-shadow: 0 1px 0 rgba(12, 12, 13, 1); + box-shadow: 0 1px 0 var(--toolbar-border-color); + } } #toolbarViewer { @@ -744,8 +1144,26 @@ html[dir='rtl'] #toolbarContainer, .findbar, .secondaryToolbar { position: relative; width: 100%; height: 4px; - background-color: rgba(51, 51, 51, 1); - border-bottom: 1px solid rgba(51, 51, 51, 1); + background-color: rgba(237, 237, 240, 1); + background-color: var(--body-bg-color); + border-bottom: 1px solid rgba(204, 204, 204, 1); + border-bottom: 1px solid var(--toolbar-border-color); +} + +@media (prefers-color-scheme: dark) { + + #loadingBar { + border-bottom: 1px solid rgba(12, 12, 13, 1); + border-bottom: 1px solid var(--toolbar-border-color); + } +} + +@media (prefers-color-scheme: dark) { + + #loadingBar { + background-color: rgba(42, 42, 46, 1); + background-color: var(--body-bg-color); + } } #loadingBar .progress { @@ -754,47 +1172,304 @@ html[dir='rtl'] #toolbarContainer, .findbar, .secondaryToolbar { left: 0; width: 0%; height: 100%; - background-color: rgba(221, 221, 221, 1); + background-color: rgba(10, 132, 255, 1); + background-color: var(--progressBar-color); overflow: hidden; transition: width 200ms; } +@media (prefers-color-scheme: dark) { + + #loadingBar .progress { + background-color: rgba(0, 96, 223, 1); + background-color: var(--progressBar-color); + } +} + @-webkit-keyframes progressIndeterminate { - 0% { left: -142px; } - 100% { left: 0; } + 0% { + left: -142px; + } + 100% { + left: 0; + } } @keyframes progressIndeterminate { - 0% { left: -142px; } - 100% { left: 0; } + 0% { + left: -142px; + } + 100% { + left: 0; + } } #loadingBar .progress.indeterminate { - background-color: rgba(153, 153, 153, 1); + background-color: rgba(221, 221, 222, 1); + background-color: var(--progressBar-indeterminate-bg-color); transition: none; } +@media (prefers-color-scheme: dark) { + + #loadingBar .progress.indeterminate { + background-color: rgba(40, 40, 43, 1); + background-color: var(--progressBar-indeterminate-bg-color); + } +} + #loadingBar .progress.indeterminate .glimmer { position: absolute; top: 0; left: 0; 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); - -webkit-animation: progressIndeterminate 950ms linear infinite; - animation: progressIndeterminate 950ms linear infinite; -} - -.findbar, .secondaryToolbar { + background: repeating-linear-gradient( + 135deg, + rgba(116, 177, 239, 1) 0, + rgba(221, 221, 222, 1) 5px, + rgba(221, 221, 222, 1) 45px, + rgba(10, 132, 255, 1) 55px, + rgba(10, 132, 255, 1) 95px, + rgba(116, 177, 239, 1) 100px + ); + background: repeating-linear-gradient( + 135deg, + 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 + ); + -webkit-animation: progressIndeterminate 1s linear infinite; + animation: progressIndeterminate 1s linear infinite; +} + +@media (prefers-color-scheme: dark) { + + #loadingBar .progress.indeterminate .glimmer { + background: repeating-linear-gradient( + 135deg, + rgba(20, 68, 133, 1) 0, + rgba(40, 40, 43, 1) 5px, + rgba(40, 40, 43, 1) 45px, + rgba(0, 96, 223, 1) 55px, + rgba(0, 96, 223, 1) 95px, + rgba(20, 68, 133, 1) 100px + ); + background: repeating-linear-gradient( + 135deg, + 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 + ); + } +} + +@media (prefers-color-scheme: dark) { + + #loadingBar .progress.indeterminate .glimmer { + background: repeating-linear-gradient( + 135deg, + rgba(20, 68, 133, 1) 0, + rgba(40, 40, 43, 1) 5px, + rgba(40, 40, 43, 1) 45px, + rgba(0, 96, 223, 1) 55px, + rgba(0, 96, 223, 1) 95px, + rgba(20, 68, 133, 1) 100px + ); + background: repeating-linear-gradient( + 135deg, + 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 + ); + } +} + +@media (prefers-color-scheme: dark) { + + #loadingBar .progress.indeterminate .glimmer { + background: repeating-linear-gradient( + 135deg, + rgba(20, 68, 133, 1) 0, + rgba(40, 40, 43, 1) 5px, + rgba(40, 40, 43, 1) 45px, + rgba(0, 96, 223, 1) 55px, + rgba(0, 96, 223, 1) 95px, + rgba(20, 68, 133, 1) 100px + ); + background: repeating-linear-gradient( + 135deg, + 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 + ); + } +} + +@media (prefers-color-scheme: dark) { + + #loadingBar .progress.indeterminate .glimmer { + background: repeating-linear-gradient( + 135deg, + rgba(20, 68, 133, 1) 0, + rgba(40, 40, 43, 1) 5px, + rgba(40, 40, 43, 1) 45px, + rgba(0, 96, 223, 1) 55px, + rgba(0, 96, 223, 1) 95px, + rgba(20, 68, 133, 1) 100px + ); + background: repeating-linear-gradient( + 135deg, + 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 + ); + } +} + +@media (prefers-color-scheme: dark) { + + #loadingBar .progress.indeterminate .glimmer { + background: repeating-linear-gradient( + 135deg, + rgba(20, 68, 133, 1) 0, + rgba(40, 40, 43, 1) 5px, + rgba(40, 40, 43, 1) 45px, + rgba(0, 96, 223, 1) 55px, + rgba(0, 96, 223, 1) 95px, + rgba(20, 68, 133, 1) 100px + ); + background: repeating-linear-gradient( + 135deg, + 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 + ); + } +} + +@media (prefers-color-scheme: dark) { + + #loadingBar .progress.indeterminate .glimmer { + background: repeating-linear-gradient( + 135deg, + rgba(20, 68, 133, 1) 0, + rgba(40, 40, 43, 1) 5px, + rgba(40, 40, 43, 1) 45px, + rgba(0, 96, 223, 1) 55px, + rgba(0, 96, 223, 1) 95px, + rgba(20, 68, 133, 1) 100px + ); + background: repeating-linear-gradient( + 135deg, + 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 + ); + } +} + +@media (prefers-color-scheme: dark) { + + #loadingBar .progress.indeterminate .glimmer { + background: repeating-linear-gradient( + 135deg, + rgba(20, 68, 133, 1) 0, + rgba(40, 40, 43, 1) 5px, + rgba(40, 40, 43, 1) 45px, + rgba(0, 96, 223, 1) 55px, + rgba(0, 96, 223, 1) 95px, + rgba(20, 68, 133, 1) 100px + ); + background: repeating-linear-gradient( + 135deg, + 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 + ); + } +} + +@media (prefers-color-scheme: dark) { + + #loadingBar .progress.indeterminate .glimmer { + background: repeating-linear-gradient( + 135deg, + rgba(20, 68, 133, 1) 0, + rgba(40, 40, 43, 1) 5px, + rgba(40, 40, 43, 1) 45px, + rgba(0, 96, 223, 1) 55px, + rgba(0, 96, 223, 1) 95px, + rgba(20, 68, 133, 1) 100px + ); + background: repeating-linear-gradient( + 135deg, + 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 + ); + } +} + +@media (prefers-color-scheme: dark) { + + #loadingBar .progress.indeterminate .glimmer { + background: repeating-linear-gradient( + 135deg, + rgba(20, 68, 133, 1) 0, + rgba(40, 40, 43, 1) 5px, + rgba(40, 40, 43, 1) 45px, + rgba(0, 96, 223, 1) 55px, + rgba(0, 96, 223, 1) 95px, + rgba(20, 68, 133, 1) 100px + ); + background: repeating-linear-gradient( + 135deg, + 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 + ); + } +} + +.findbar, +.secondaryToolbar { top: 32px; position: absolute; z-index: 10000; height: auto; min-width: 16px; - padding: 0px 6px 0px 6px; + padding: 0px 4px 0px 4px; margin: 4px 2px 4px 2px; color: rgba(217, 217, 217, 1); font-size: 12px; @@ -805,6 +1480,16 @@ html[dir='rtl'] #toolbarContainer, .findbar, .secondaryToolbar { .findbar { min-width: 300px; + background-color: rgba(249, 249, 250, 1); + background-color: var(--toolbar-bg-color); +} + +@media (prefers-color-scheme: dark) { + + .findbar { + background-color: rgba(56, 56, 61, 1); + background-color: var(--toolbar-bg-color); + } } .findbar > div { height: 32px; @@ -815,11 +1500,114 @@ html[dir='rtl'] #toolbarContainer, .findbar, .secondaryToolbar { .findbar.wrapContainers > div#findbarMessageContainer { height: auto; } -html[dir='ltr'] .findbar { - left: 68px; +html[dir="ltr"] .findbar { + left: 64px; +} +html[dir="rtl"] .findbar { + right: 64px; +} + +html[dir="ltr"] .findbar .splitToolbarButton { + margin-left: 0px; + margin-top: 3px; +} + +html[dir="rtl"] .findbar .splitToolbarButton { + margin-right: 0px; + margin-top: 3px; +} + +.findbar .splitToolbarButton .findNext { + width: 29px; +} + +html[dir="ltr"] .findbar .splitToolbarButton .findNext { + border-right: 1px solid rgba(187, 187, 188, 1); + border-right: 1px solid var(--field-border-color); +} + +@media (prefers-color-scheme: dark) { + + html[dir="ltr"] .findbar .splitToolbarButton .findNext { + border-right: 1px solid rgba(115, 115, 115, 1); + border-right: 1px solid var(--field-border-color); + } +} + +html[dir="rtl"] .findbar .splitToolbarButton .findNext { + border-left: 1px solid rgba(187, 187, 188, 1); + border-left: 1px solid var(--field-border-color); +} + +@media (prefers-color-scheme: dark) { + + html[dir="rtl"] .findbar .splitToolbarButton .findNext { + border-left: 1px solid rgba(115, 115, 115, 1); + border-left: 1px solid var(--field-border-color); + } +} + +.findbar .splitToolbarButton .toolbarButton { + background-color: rgba(227, 228, 230, 1); + background-color: var(--findbar-nextprevious-btn-bg-color); + border-radius: 0px; + height: 26px; + border-top: 1px solid rgba(187, 187, 188, 1); + border-top: 1px solid var(--field-border-color); + border-bottom: 1px solid rgba(187, 187, 188, 1); + border-bottom: 1px solid var(--field-border-color); +} + +@media (prefers-color-scheme: dark) { + + .findbar .splitToolbarButton .toolbarButton { + border-bottom: 1px solid rgba(115, 115, 115, 1); + border-bottom: 1px solid var(--field-border-color); + } } -html[dir='rtl'] .findbar { - right: 68px; + +@media (prefers-color-scheme: dark) { + + .findbar .splitToolbarButton .toolbarButton { + border-top: 1px solid rgba(115, 115, 115, 1); + border-top: 1px solid var(--field-border-color); + } +} + +@media (prefers-color-scheme: dark) { + + .findbar .splitToolbarButton .toolbarButton { + background-color: rgba(89, 89, 89, 1); + background-color: var(--findbar-nextprevious-btn-bg-color); + } +} + +.findbar .splitToolbarButton .toolbarButton::before { + top: 5px; +} + +html[dir="ltr"] .findbar .splitToolbarButton > .findPrevious { + border-radius: 0; +} +html[dir="ltr"] .findbar .splitToolbarButton > .findNext { + border-bottom-left-radius: 0; + border-bottom-right-radius: 2px; + border-top-left-radius: 0; + border-top-right-radius: 2px; +} + +html[dir="rtl"] .findbar .splitToolbarButton > .findPrevious { + border-radius: 0; +} +html[dir="rtl"] .findbar .splitToolbarButton > .findNext { + border-bottom-left-radius: 2px; + border-bottom-right-radius: 0; + border-top-left-radius: 2px; + border-top-right-radius: 0; +} + +.findbar input[type="checkbox"] { + pointer-events: none; } .findbar label { @@ -829,6 +1617,55 @@ html[dir='rtl'] .findbar { user-select: none; } +.findbar label:hover { + background-color: rgba(221, 222, 223, 1); + background-color: var(--button-hover-color); +} + +@media (prefers-color-scheme: dark) { + + .findbar label:hover { + background-color: rgba(102, 102, 103, 1); + background-color: var(--button-hover-color); + } +} + +.findbar input:focus + label { + background-color: rgba(221, 222, 223, 1); + background-color: var(--button-hover-color); +} + +@media (prefers-color-scheme: dark) { + + .findbar input:focus + label { + background-color: rgba(102, 102, 103, 1); + background-color: var(--button-hover-color); + } +} + +html[dir="ltr"] #findInput { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} + +html[dir="rtl"] #findInput { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} + +.findbar .toolbarField[type="checkbox"]:checked + .toolbarLabel { + background-color: rgba(0, 0, 0, 0.3) !important; + background-color: var(--toggled-btn-bg-color) !important; +} + +@media (prefers-color-scheme: dark) { + + .findbar .toolbarField[type="checkbox"]:checked + .toolbarLabel { + background-color: rgba(0, 0, 0, 0.3) !important; + background-color: var(--toggled-btn-bg-color) !important; + } +} + #findInput { width: 200px; } @@ -836,40 +1673,58 @@ html[dir='rtl'] .findbar { color: rgba(191, 191, 191, 1); } #findInput::-moz-placeholder { - font-style: italic; + font-style: normal; } #findInput:-ms-input-placeholder { - font-style: italic; + font-style: normal; } #findInput::-ms-input-placeholder { - font-style: italic; + font-style: normal; } #findInput::placeholder { - font-style: italic; + font-style: normal; } #findInput[data-status="pending"] { - background-image: url(images/loading-small.png); + background-image: url(images/loading.svg); + background-image: var(--loading-icon); background-repeat: no-repeat; - background-position: right; + background-position: 98%; +} +@media (prefers-color-scheme: dark) { + + #findInput[data-status="pending"] { + background-image: url(images/loading-dark.svg); + background-image: var(--loading-icon); + } } -html[dir='rtl'] #findInput[data-status="pending"] { - background-position: left; +html[dir="rtl"] #findInput[data-status="pending"] { + background-position: 3px; } .secondaryToolbar { - padding: 6px; + padding: 6px 0 10px 0; height: auto; z-index: 30000; + background-color: rgba(255, 255, 255, 1); + background-color: var(--doorhanger-bg-color); +} + +@media (prefers-color-scheme: dark) { + + .secondaryToolbar { + background-color: rgba(74, 74, 79, 1); + background-color: var(--doorhanger-bg-color); + } } -html[dir='ltr'] .secondaryToolbar { +html[dir="ltr"] .secondaryToolbar { right: 4px; } -html[dir='rtl'] .secondaryToolbar { +html[dir="rtl"] .secondaryToolbar { left: 4px; } #secondaryToolbarButtonContainer { - max-width: 200px; + max-width: 220px; max-height: 400px; overflow-y: auto; -webkit-overflow-scrolling: touch; @@ -881,14 +1736,45 @@ html[dir='rtl'] .secondaryToolbar { display: none !important; } -.doorHanger, +.doorHanger { + border-radius: 2px; + box-shadow: 0 1px 5px rgba(12, 12, 13, 0.2), + 0 0 0 1px rgba(12, 12, 13, 0.2); + box-shadow: 0 1px 5px var(--doorhanger-border-color), + 0 0 0 1px var(--doorhanger-border-color); +} + +@media (prefers-color-scheme: dark) { + + .doorHanger { + box-shadow: 0 1px 5px rgba(39, 39, 43, 1), + 0 0 0 1px rgba(39, 39, 43, 1); + box-shadow: 0 1px 5px var(--doorhanger-border-color), + 0 0 0 1px var(--doorhanger-border-color); + } +} + .doorHangerRight { - border: 1px solid rgba(0, 0, 0, 0.5); border-radius: 2px; - box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); + box-shadow: 0 1px 5px rgba(12, 12, 13, 0.2), + 0 0 0 1px rgba(12, 12, 13, 0.2); + box-shadow: 0 1px 5px var(--doorhanger-border-color), + 0 0 0 1px var(--doorhanger-border-color); } -.doorHanger:after, .doorHanger:before, -.doorHangerRight:after, .doorHangerRight:before { + +@media (prefers-color-scheme: dark) { + + .doorHangerRight { + box-shadow: 0 1px 5px rgba(39, 39, 43, 1), + 0 0 0 1px rgba(39, 39, 43, 1); + box-shadow: 0 1px 5px var(--doorhanger-border-color), + 0 0 0 1px var(--doorhanger-border-color); + } +} +.doorHanger:after, +.doorHanger:before, +.doorHangerRight:after, +.doorHangerRight:before { bottom: 100%; border: solid rgba(0, 0, 0, 0); content: " "; @@ -899,36 +1785,76 @@ html[dir='rtl'] .secondaryToolbar { } .doorHanger:after, .doorHangerRight:after { - border-bottom-color: rgba(82, 82, 82, 0.99); border-width: 8px; } -.doorHanger:before, +.doorHanger:after { + border-bottom-color: rgba(249, 249, 250, 1); + border-bottom-color: var(--toolbar-bg-color); +} +@media (prefers-color-scheme: dark) { + + .doorHanger:after { + border-bottom-color: rgba(56, 56, 61, 1); + border-bottom-color: var(--toolbar-bg-color); + } +} +.doorHangerRight:after { + border-bottom-color: rgba(255, 255, 255, 1); + border-bottom-color: var(--doorhanger-bg-color); +} +@media (prefers-color-scheme: dark) { + + .doorHangerRight:after { + border-bottom-color: rgba(74, 74, 79, 1); + border-bottom-color: var(--doorhanger-bg-color); + } +} +.doorHanger:before { + border-bottom-color: rgba(12, 12, 13, 0.2); + border-bottom-color: var(--doorhanger-border-color); + border-width: 9px; +} +@media (prefers-color-scheme: dark) { + + .doorHanger:before { + border-bottom-color: rgba(39, 39, 43, 1); + border-bottom-color: var(--doorhanger-border-color); + } +} .doorHangerRight:before { - border-bottom-color: rgba(0, 0, 0, 0.5); + border-bottom-color: rgba(12, 12, 13, 0.2); + border-bottom-color: var(--doorhanger-border-color); border-width: 9px; } +@media (prefers-color-scheme: dark) { + + .doorHangerRight:before { + border-bottom-color: rgba(39, 39, 43, 1); + border-bottom-color: var(--doorhanger-border-color); + } +} -html[dir='ltr'] .doorHanger:after, -html[dir='rtl'] .doorHangerRight:after { - left: 13px; +html[dir="ltr"] .doorHanger:after, +html[dir="rtl"] .doorHangerRight:after { + left: 10px; margin-left: -8px; } -html[dir='ltr'] .doorHanger:before, -html[dir='rtl'] .doorHangerRight:before { - left: 13px; +html[dir="ltr"] .doorHanger:before, +html[dir="rtl"] .doorHangerRight:before { + left: 10px; margin-left: -9px; } -html[dir='rtl'] .doorHanger:after, -html[dir='ltr'] .doorHangerRight:after { - right: 13px; +html[dir="rtl"] .doorHanger:after, +html[dir="ltr"] .doorHangerRight:after { + right: 10px; margin-right: -8px; } -html[dir='rtl'] .doorHanger:before, -html[dir='ltr'] .doorHangerRight:before { - right: 13px; +html[dir="rtl"] .doorHanger:before, +html[dir="ltr"] .doorHangerRight:before { + right: 10px; margin-right: -9px; } @@ -937,11 +1863,11 @@ html[dir='ltr'] .doorHangerRight:before { color: rgba(82, 82, 82, 1); text-align: center; padding: 3px 4px; + margin: 5px; } #findMsg { - font-style: italic; - color: rgba(166, 183, 208, 1); + color: rgba(251, 0, 0, 1); } #findMsg:empty { display: none; @@ -957,43 +1883,43 @@ html[dir='ltr'] .doorHangerRight:before { transform: translateX(-50%); } -html[dir='ltr'] #toolbarViewerLeft, -html[dir='rtl'] #toolbarViewerRight { +html[dir="ltr"] #toolbarViewerLeft, +html[dir="rtl"] #toolbarViewerRight { float: left; } -html[dir='ltr'] #toolbarViewerRight, -html[dir='rtl'] #toolbarViewerLeft { +html[dir="ltr"] #toolbarViewerRight, +html[dir="rtl"] #toolbarViewerLeft { float: right; } -html[dir='ltr'] #toolbarViewerLeft > *, -html[dir='ltr'] #toolbarViewerMiddle > *, -html[dir='ltr'] #toolbarViewerRight > *, -html[dir='ltr'] .findbar * { +html[dir="ltr"] #toolbarViewerLeft > *, +html[dir="ltr"] #toolbarViewerMiddle > *, +html[dir="ltr"] #toolbarViewerRight > *, +html[dir="ltr"] .findbar * { position: relative; float: left; } -html[dir='rtl'] #toolbarViewerLeft > *, -html[dir='rtl'] #toolbarViewerMiddle > *, -html[dir='rtl'] #toolbarViewerRight > *, -html[dir='rtl'] .findbar * { +html[dir="rtl"] #toolbarViewerLeft > *, +html[dir="rtl"] #toolbarViewerMiddle > *, +html[dir="rtl"] #toolbarViewerRight > *, +html[dir="rtl"] .findbar * { position: relative; float: right; } -html[dir='ltr'] .splitToolbarButton { - margin: 3px 2px 4px 0; +html[dir="ltr"] .splitToolbarButton { + margin: 2px 2px 0; display: inline-block; } -html[dir='rtl'] .splitToolbarButton { - margin: 3px 0 4px 2px; +html[dir="rtl"] .splitToolbarButton { + margin: 2px 2px 0; display: inline-block; } -html[dir='ltr'] .splitToolbarButton > .toolbarButton { - border-radius: 0; +html[dir="ltr"] .splitToolbarButton > .toolbarButton { + border-radius: 2px; float: left; } -html[dir='rtl'] .splitToolbarButton > .toolbarButton { - border-radius: 0; +html[dir="rtl"] .splitToolbarButton > .toolbarButton { + border-radius: 2px; float: right; } @@ -1002,8 +1928,45 @@ html[dir='rtl'] .splitToolbarButton > .toolbarButton { .overlayButton { border: 0 none; background: none; - width: 32px; - height: 25px; + width: 28px; + height: 28px; +} +.overlayButton { + background-color: rgba(12, 12, 13, 0.1); + background-color: var(--overlay-button-bg-color); +} +@media (prefers-color-scheme: dark) { + + .overlayButton { + background-color: rgba(92, 92, 97, 1); + background-color: var(--overlay-button-bg-color); + } +} + +.overlayButton:hover { + background-color: rgba(12, 12, 13, 0.3); + background-color: var(--overlay-button-hover-color); +} + +@media (prefers-color-scheme: dark) { + + .overlayButton:hover { + background-color: rgba(115, 115, 115, 1); + background-color: var(--overlay-button-hover-color); + } +} + +.overlayButton:focus { + background-color: rgba(12, 12, 13, 0.3); + background-color: var(--overlay-button-hover-color); +} + +@media (prefers-color-scheme: dark) { + + .overlayButton:focus { + background-color: rgba(115, 115, 115, 1); + background-color: var(--overlay-button-hover-color); + } } .toolbarButton > span { @@ -1016,94 +1979,219 @@ html[dir='rtl'] .splitToolbarButton > .toolbarButton { .toolbarButton[disabled], .secondaryToolbarButton[disabled], .overlayButton[disabled] { - opacity: .5; + opacity: 0.5; } .splitToolbarButton.toggled .toolbarButton { margin: 0; } -.splitToolbarButton:hover > .toolbarButton, -.splitToolbarButton:focus > .toolbarButton, -.splitToolbarButton.toggled > .toolbarButton, -.toolbarButton.textButton { - background-color: rgba(0, 0, 0, 0.12); - background-image: linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)); - background-clip: padding-box; - border: 1px solid rgba(0, 0, 0, 0.35); - border-color: rgba(0, 0, 0, 0.32) rgba(0, 0, 0, 0.38) rgba(0, 0, 0, 0.42); - box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, - 0 0 1px rgba(255, 255, 255, 0.15) inset, - 0 1px 0 rgba(255, 255, 255, 0.05); -} -.splitToolbarButton > .toolbarButton:hover, -.splitToolbarButton > .toolbarButton:focus, -.dropdownToolbarButton:hover, -.overlayButton:hover, -.overlayButton:focus, -.toolbarButton.textButton:hover, -.toolbarButton.textButton:focus { - background-color: rgba(0,0,0,0.2); - box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, - 0 0 1px rgba(255, 255, 255, 0.15) inset, - 0 0 1px rgba(0, 0, 0, 0.05); +.splitToolbarButton > .toolbarButton:hover { + background-color: rgba(221, 222, 223, 1); + background-color: var(--button-hover-color); + z-index: 199; +} + +@media (prefers-color-scheme: dark) { + + .splitToolbarButton > .toolbarButton:hover { + background-color: rgba(102, 102, 103, 1); + background-color: var(--button-hover-color); + } +} + +.splitToolbarButton > .toolbarButton:focus { + background-color: rgba(221, 222, 223, 1); + background-color: var(--button-hover-color); z-index: 199; } + +@media (prefers-color-scheme: dark) { + + .splitToolbarButton > .toolbarButton:focus { + background-color: rgba(102, 102, 103, 1); + background-color: var(--button-hover-color); + } +} + .dropdownToolbarButton:hover { - background-color: rgba(0, 0, 0, 0.26); + background-color: rgba(221, 222, 223, 1); + background-color: var(--button-hover-color); + z-index: 199; +} + +@media (prefers-color-scheme: dark) { + + .dropdownToolbarButton:hover { + background-color: rgba(102, 102, 103, 1); + background-color: var(--button-hover-color); + } +} + +.toolbarButton.textButton:hover { + background-color: rgba(221, 222, 223, 1); + background-color: var(--button-hover-color); + z-index: 199; +} + +@media (prefers-color-scheme: dark) { + + .toolbarButton.textButton:hover { + background-color: rgba(102, 102, 103, 1); + background-color: var(--button-hover-color); + } +} + +.toolbarButton.textButton:focus { + background-color: rgba(221, 222, 223, 1); + background-color: var(--button-hover-color); + z-index: 199; +} + +@media (prefers-color-scheme: dark) { + + .toolbarButton.textButton:focus { + background-color: rgba(102, 102, 103, 1); + background-color: var(--button-hover-color); + } } .splitToolbarButton > .toolbarButton { position: relative; } -html[dir='ltr'] .splitToolbarButton > .toolbarButton:first-child, -html[dir='rtl'] .splitToolbarButton > .toolbarButton:last-child { +html[dir="ltr"] .splitToolbarButton > .toolbarButton:first-child, +html[dir="rtl"] .splitToolbarButton > .toolbarButton:last-child { position: relative; margin: 0; - margin-right: -1px; - border-top-left-radius: 2px; - border-bottom-left-radius: 2px; - border-right-color: rgba(0, 0, 0, 0); } -html[dir='ltr'] .splitToolbarButton > .toolbarButton:last-child, -html[dir='rtl'] .splitToolbarButton > .toolbarButton:first-child { +html[dir="ltr"] .splitToolbarButton > .toolbarButton:last-child, +html[dir="rtl"] .splitToolbarButton > .toolbarButton:first-child { position: relative; margin: 0; - margin-left: -1px; - border-top-right-radius: 2px; - border-bottom-right-radius: 2px; - border-left-color: rgba(0, 0, 0, 0); } .splitToolbarButtonSeparator { - padding: 8px 0; + padding: 10px 0; width: 1px; - background-color: rgba(0, 0, 0, 0.5); + background-color: rgba(0, 0, 0, 0.3); + background-color: var(--separator-color); z-index: 99; - box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08); display: inline-block; - margin: 5px 0; + margin: 4px 0; +} +@media (prefers-color-scheme: dark) { + + .splitToolbarButtonSeparator { + background-color: rgba(0, 0, 0, 0.3); + background-color: var(--separator-color); + } +} + +.findbar .splitToolbarButtonSeparator { + background-color: rgba(187, 187, 188, 1); + background-color: var(--field-border-color); + margin: 0; + padding: 13px 0; +} + +@media (prefers-color-scheme: dark) { + + .findbar .splitToolbarButtonSeparator { + background-color: rgba(115, 115, 115, 1); + background-color: var(--field-border-color); + } } -html[dir='ltr'] .splitToolbarButtonSeparator { + +html[dir="ltr"] .splitToolbarButtonSeparator { float: left; } -html[dir='rtl'] .splitToolbarButtonSeparator { +html[dir="rtl"] .splitToolbarButtonSeparator { float: right; } -.splitToolbarButton:hover > .splitToolbarButtonSeparator, -.splitToolbarButton.toggled > .splitToolbarButtonSeparator { - padding: 12px 0; - margin: 1px 0; - box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03); + +.toolbarButton { + min-width: 16px; + padding: 2px 6px 0; + border: none; + border-radius: 2px; + color: rgba(12, 12, 13, 1); + color: var(--main-color); + font-size: 12px; + line-height: 14px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + /* Opera does not support user-select, use <... unselectable="on"> instead */ + cursor: default; + box-sizing: border-box; +} + +@media (prefers-color-scheme: dark) { + + .toolbarButton { + color: rgba(249, 249, 250, 1); + color: var(--main-color); + } +} + +.dropdownToolbarButton { + min-width: 16px; + padding: 2px 6px 0; + border: none; + border-radius: 2px; + color: rgba(12, 12, 13, 1); + color: var(--main-color); + font-size: 12px; + line-height: 14px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + /* Opera does not support user-select, use <... unselectable="on"> instead */ + cursor: default; + box-sizing: border-box; +} + +@media (prefers-color-scheme: dark) { + + .dropdownToolbarButton { + color: rgba(249, 249, 250, 1); + color: var(--main-color); + } +} + +.secondaryToolbarButton { + min-width: 16px; + padding: 2px 6px 0; + border: none; + border-radius: 2px; + color: rgba(12, 12, 13, 1); + color: var(--main-color); + font-size: 12px; + line-height: 14px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + /* Opera does not support user-select, use <... unselectable="on"> instead */ + cursor: default; + box-sizing: border-box; +} + +@media (prefers-color-scheme: dark) { + + .secondaryToolbarButton { + color: rgba(249, 249, 250, 1); + color: var(--main-color); + } } -.toolbarButton, -.dropdownToolbarButton, -.secondaryToolbarButton, .overlayButton { min-width: 16px; padding: 2px 6px 0; - border: 1px solid rgba(0, 0, 0, 0); + border: none; border-radius: 2px; - color: rgba(255, 255, 255, 0.8); + color: rgba(12, 12, 13, 1); + color: var(--main-color); font-size: 12px; line-height: 14px; -webkit-user-select: none; @@ -1112,100 +2200,236 @@ html[dir='rtl'] .splitToolbarButtonSeparator { user-select: none; /* Opera does not support user-select, use <... unselectable="on"> instead */ cursor: default; + box-sizing: border-box; } -html[dir='ltr'] .toolbarButton, -html[dir='ltr'] .overlayButton, -html[dir='ltr'] .dropdownToolbarButton { - margin: 3px 2px 4px 0; +@media (prefers-color-scheme: dark) { + + .overlayButton { + color: rgba(249, 249, 250, 1); + color: var(--main-color); + } +} + +html[dir="ltr"] .toolbarButton, +html[dir="ltr"] .overlayButton, +html[dir="ltr"] .dropdownToolbarButton { + margin: 2px 1px; } -html[dir='rtl'] .toolbarButton, -html[dir='rtl'] .overlayButton, -html[dir='rtl'] .dropdownToolbarButton { - margin: 3px 0 4px 2px; +html[dir="rtl"] .toolbarButton, +html[dir="rtl"] .overlayButton, +html[dir="rtl"] .dropdownToolbarButton { + margin: 2px 1px; } -.toolbarButton:hover, -.toolbarButton:focus, -.dropdownToolbarButton, -.overlayButton, -.secondaryToolbarButton:hover, +html[dir="ltr"] #toolbarViewerLeft > .toolbarButton:first-child, +html[dir="rtl"] #toolbarViewerRight > .toolbarButton:last-child { + margin-left: 2px; +} + +html[dir="ltr"] #toolbarViewerRight > .toolbarButton:last-child, +html[dir="rtl"] #toolbarViewerLeft > .toolbarButton:first-child { + margin-right: 2px; +} +.toolbarButton:hover { + background-color: rgba(221, 222, 223, 1); + background-color: var(--button-hover-color); +} +@media (prefers-color-scheme: dark) { + + .toolbarButton:hover { + background-color: rgba(102, 102, 103, 1); + background-color: var(--button-hover-color); + } +} +.toolbarButton:focus { + background-color: rgba(221, 222, 223, 1); + background-color: var(--button-hover-color); +} +@media (prefers-color-scheme: dark) { + + .toolbarButton:focus { + background-color: rgba(102, 102, 103, 1); + background-color: var(--button-hover-color); + } +} +.secondaryToolbarButton:hover { + background-color: rgba(237, 237, 237, 1); + background-color: var(--doorhanger-hover-color); +} +@media (prefers-color-scheme: dark) { + + .secondaryToolbarButton:hover { + background-color: rgba(93, 94, 98, 1); + background-color: var(--doorhanger-hover-color); + } +} .secondaryToolbarButton:focus { - background-color: rgba(0, 0, 0, 0.12); - background-image: linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)); - background-clip: padding-box; - border: 1px solid rgba(0, 0, 0, 0.35); - border-color: rgba(0, 0, 0, 0.32) rgba(0, 0, 0, 0.38) rgba(0, 0, 0, 0.42); - box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, - 0 0 1px rgba(255, 255, 255, 0.15) inset, - 0 1px 0 rgba(255, 255, 255, 0.05); + background-color: rgba(237, 237, 237, 1); + background-color: var(--doorhanger-hover-color); } +@media (prefers-color-scheme: dark) { -.toolbarButton:hover:active, -.overlayButton:hover:active, -.dropdownToolbarButton:hover:active, -.secondaryToolbarButton:hover:active { - background-color: rgba(0, 0, 0, 0.2); - background-image: linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)); - border-color: rgba(0, 0, 0, 0.35) rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.45); - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1) inset, - 0 0 1px rgba(0, 0, 0, 0.2) inset, - 0 1px 0 rgba(255, 255, 255, 0.05); + .secondaryToolbarButton:focus { + background-color: rgba(93, 94, 98, 1); + background-color: var(--doorhanger-hover-color); + } +} + +.toolbarButton.toggled { + background-color: rgba(0, 0, 0, 0.3); + background-color: var(--toggled-btn-bg-color); +} + +@media (prefers-color-scheme: dark) { + + .toolbarButton.toggled { + background-color: rgba(0, 0, 0, 0.3); + background-color: var(--toggled-btn-bg-color); + } +} + +.splitToolbarButton.toggled > .toolbarButton.toggled { + background-color: rgba(0, 0, 0, 0.3); + background-color: var(--toggled-btn-bg-color); +} + +@media (prefers-color-scheme: dark) { + + .splitToolbarButton.toggled > .toolbarButton.toggled { + background-color: rgba(0, 0, 0, 0.3); + background-color: var(--toggled-btn-bg-color); + } } -.toolbarButton.toggled, -.splitToolbarButton.toggled > .toolbarButton.toggled, .secondaryToolbarButton.toggled { background-color: rgba(0, 0, 0, 0.3); - background-image: linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)); - border-color: rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.45) rgba(0, 0, 0, 0.5); - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1) inset, - 0 0 1px rgba(0, 0, 0, 0.2) inset, - 0 1px 0 rgba(255, 255, 255, 0.05); + background-color: var(--toggled-btn-bg-color); +} + +@media (prefers-color-scheme: dark) { + + .secondaryToolbarButton.toggled { + background-color: rgba(0, 0, 0, 0.3); + background-color: var(--toggled-btn-bg-color); + } } .toolbarButton.toggled:hover:active, .splitToolbarButton.toggled > .toolbarButton.toggled:hover:active, .secondaryToolbarButton.toggled:hover:active { background-color: rgba(0, 0, 0, 0.4); - border-color: rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.5) rgba(0, 0, 0, 0.55); - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2) inset, - 0 0 1px rgba(0, 0, 0, 0.3) inset, - 0 1px 0 rgba(255, 255, 255, 0.05); } .dropdownToolbarButton { width: 140px; padding: 0; overflow: hidden; + background-color: rgba(215, 215, 219, 1); + background-color: var(--dropdown-btn-bg-color); + margin-top: 2px !important; +} + +@media (prefers-color-scheme: dark) { + + .dropdownToolbarButton { + background-color: rgba(74, 74, 79, 1); + background-color: var(--dropdown-btn-bg-color); + } } .dropdownToolbarButton::after { position: absolute; display: inline-block; - top: 4px; - content: url(images/toolbarButton-menuArrows.png); + top: 6px; + content: url(images/toolbarButton-menuArrow.svg); + content: var(--toolbarButton-menuArrow-icon); + pointer-events: none; + max-width: 16px; +} +@media (prefers-color-scheme: dark) { + + .dropdownToolbarButton::after { + content: url(images/toolbarButton-menuArrow-dark.svg); + content: var(--toolbarButton-menuArrow-icon); + } } -html[dir='ltr'] .dropdownToolbarButton::after { - right: 8px; +html[dir="ltr"] .dropdownToolbarButton::after { + right: 7px; } -html[dir='rtl'] .dropdownToolbarButton::after { - left: 8px; +html[dir="rtl"] .dropdownToolbarButton::after { + left: 7px; } .dropdownToolbarButton > select { - -webkit-appearance: none; width: 162px; - height: 23px; + height: 28px; font-size: 12px; - color: rgba(242, 242, 242, 1); + color: rgba(12, 12, 13, 1); + color: var(--main-color); margin: 0; - padding: 3px 2px 2px; + padding: 1px 0 2px; border: none; - background: rgba(0,0,0,0); /* Opera does not support 'transparent' <select> background */ + background-color: rgba(215, 215, 219, 1); + background-color: var(--dropdown-btn-bg-color); +} + +@media (prefers-color-scheme: dark) { + + .dropdownToolbarButton > select { + background-color: rgba(74, 74, 79, 1); + background-color: var(--dropdown-btn-bg-color); + } +} + +@media (prefers-color-scheme: dark) { + + .dropdownToolbarButton > select { + color: rgba(249, 249, 250, 1); + color: var(--main-color); + } +} +html[dir="ltr"] .dropdownToolbarButton > select { + padding-left: 4px; +} +html[dir="rtl"] .dropdownToolbarButton > select { + padding-right: 4px; +} +.dropdownToolbarButton > select:hover { + background-color: rgba(221, 222, 223, 1); + background-color: var(--button-hover-color); +} +@media (prefers-color-scheme: dark) { + + .dropdownToolbarButton > select:hover { + background-color: rgba(102, 102, 103, 1); + background-color: var(--button-hover-color); + } +} + +.dropdownToolbarButton > select:focus { + background-color: rgba(221, 222, 223, 1); + background-color: var(--button-hover-color); +} + +@media (prefers-color-scheme: dark) { + + .dropdownToolbarButton > select:focus { + background-color: rgba(102, 102, 103, 1); + background-color: var(--button-hover-color); + } } .dropdownToolbarButton > select > option { - background: rgba(61, 61, 61, 1); + background: rgba(255, 255, 255, 1); + background: var(--doorhanger-bg-color); +} + +@media (prefers-color-scheme: dark) { + + .dropdownToolbarButton > select > option { + background: rgba(74, 74, 79, 1); + background: var(--doorhanger-bg-color); + } } #customScaleOption { @@ -1216,164 +2440,383 @@ html[dir='rtl'] .dropdownToolbarButton::after { border-bottom: 1px rgba(255, 255, 255, 0.5) solid; } -html[dir='ltr'] .splitToolbarButton:first-child, -html[dir='ltr'] .toolbarButton:first-child, -html[dir='rtl'] .splitToolbarButton:last-child, -html[dir='rtl'] .toolbarButton:last-child { - margin-left: 4px; -} -html[dir='ltr'] .splitToolbarButton:last-child, -html[dir='ltr'] .toolbarButton:last-child, -html[dir='rtl'] .splitToolbarButton:first-child, -html[dir='rtl'] .toolbarButton:first-child { - margin-right: 4px; -} - .toolbarButtonSpacer { width: 30px; display: inline-block; height: 1px; } -html[dir='ltr'] #findPrevious { - margin-left: 3px; +html[dir="ltr"] #findPrevious { + margin-left: 0; } -html[dir='ltr'] #findNext { +html[dir="ltr"] #findNext { margin-right: 3px; } -html[dir='rtl'] #findPrevious { - margin-right: 3px; +html[dir="rtl"] #findPrevious { + margin-right: 0; } -html[dir='rtl'] #findNext { +html[dir="rtl"] #findNext { margin-left: 3px; } +.toolbarButton::before { + opacity: 0.7; + opacity: var(--toolbar-icon-opacity); + top: 6px; +} + +.secondaryToolbarButton::before { + opacity: 0.9; + opacity: var(--doorhanger-icon-opacity); + top: 5px; +} + .toolbarButton::before, .secondaryToolbarButton::before { /* All matching images have a size of 16x16 - * All relevant containers have a size of 32x25 */ + * All relevant containers have a size of 28x28 */ position: absolute; display: inline-block; - top: 4px; - left: 7px; + left: 6px; + max-width: 16px; } html[dir="ltr"] .secondaryToolbarButton::before { - left: 4px; + left: 12px; } html[dir="rtl"] .secondaryToolbarButton::before { - right: 4px; + right: 12px; } .toolbarButton#sidebarToggle::before { - content: url(images/toolbarButton-sidebarToggle.png); + content: url(images/toolbarButton-sidebarToggle.svg); + content: var(--toolbarButton-sidebarToggle-icon); } -html[dir='rtl'] .toolbarButton#sidebarToggle::before { + +@media (prefers-color-scheme: dark) { + + .toolbarButton#sidebarToggle::before { + content: url(images/toolbarButton-sidebarToggle-dark.svg); + content: var(--toolbarButton-sidebarToggle-icon); + } +} +html[dir="rtl"] .toolbarButton#sidebarToggle::before { transform: scaleX(-1); } .toolbarButton#secondaryToolbarToggle::before { - content: url(images/toolbarButton-secondaryToolbarToggle.png); + content: url(images/toolbarButton-secondaryToolbarToggle.svg); + content: var(--toolbarButton-secondaryToolbarToggle-icon); } -html[dir='rtl'] .toolbarButton#secondaryToolbarToggle::before { + +@media (prefers-color-scheme: dark) { + + .toolbarButton#secondaryToolbarToggle::before { + content: url(images/toolbarButton-secondaryToolbarToggle-dark.svg); + content: var(--toolbarButton-secondaryToolbarToggle-icon); + } +} +html[dir="rtl"] .toolbarButton#secondaryToolbarToggle::before { transform: scaleX(-1); } .toolbarButton.findPrevious::before { - content: url(images/findbarButton-previous.png); + content: url(images/findbarButton-previous.svg); + content: var(--findbarButton-previous-icon); } -html[dir='rtl'] .toolbarButton.findPrevious::before { + +@media (prefers-color-scheme: dark) { + + .toolbarButton.findPrevious::before { + content: url(images/findbarButton-previous-dark.svg); + content: var(--findbarButton-previous-icon); + } +} +html[dir="rtl"] .toolbarButton.findPrevious::before { transform: scaleX(-1); } .toolbarButton.findNext::before { - content: url(images/findbarButton-next.png); + content: url(images/findbarButton-next.svg); + content: var(--findbarButton-next-icon); +} + +@media (prefers-color-scheme: dark) { + + .toolbarButton.findNext::before { + content: url(images/findbarButton-next-dark.svg); + content: var(--findbarButton-next-icon); + } } -html[dir='rtl'] .toolbarButton.findNext::before { +html[dir="rtl"] .toolbarButton.findNext::before { transform: scaleX(-1); } .toolbarButton.pageUp::before { - content: url(images/toolbarButton-pageUp.png); + content: url(images/toolbarButton-pageUp.svg); + content: var(--toolbarButton-pageUp-icon); +} + +@media (prefers-color-scheme: dark) { + + .toolbarButton.pageUp::before { + content: url(images/toolbarButton-pageUp-dark.svg); + content: var(--toolbarButton-pageUp-icon); + } } -html[dir='rtl'] .toolbarButton.pageUp::before { +html[dir="rtl"] .toolbarButton.pageUp::before { transform: scaleX(-1); } .toolbarButton.pageDown::before { - content: url(images/toolbarButton-pageDown.png); + content: url(images/toolbarButton-pageDown.svg); + content: var(--toolbarButton-pageDown-icon); +} + +@media (prefers-color-scheme: dark) { + + .toolbarButton.pageDown::before { + content: url(images/toolbarButton-pageDown-dark.svg); + content: var(--toolbarButton-pageDown-icon); + } } -html[dir='rtl'] .toolbarButton.pageDown::before { +html[dir="rtl"] .toolbarButton.pageDown::before { transform: scaleX(-1); } .toolbarButton.zoomOut::before { - content: url(images/toolbarButton-zoomOut.png); + content: url(images/toolbarButton-zoomOut.svg); + content: var(--toolbarButton-zoomOut-icon); +} + +@media (prefers-color-scheme: dark) { + + .toolbarButton.zoomOut::before { + content: url(images/toolbarButton-zoomOut-dark.svg); + content: var(--toolbarButton-zoomOut-icon); + } } .toolbarButton.zoomIn::before { - content: url(images/toolbarButton-zoomIn.png); + content: url(images/toolbarButton-zoomIn.svg); + content: var(--toolbarButton-zoomIn-icon); +} + +@media (prefers-color-scheme: dark) { + + .toolbarButton.zoomIn::before { + content: url(images/toolbarButton-zoomIn-dark.svg); + content: var(--toolbarButton-zoomIn-icon); + } +} + +.toolbarButton.presentationMode::before { + content: url(images/toolbarButton-presentationMode.svg); + content: var(--toolbarButton-presentationMode-icon); +} + +@media (prefers-color-scheme: dark) { + + .toolbarButton.presentationMode::before { + content: url(images/toolbarButton-presentationMode-dark.svg); + content: var(--toolbarButton-presentationMode-icon); + } } -.toolbarButton.presentationMode::before, .secondaryToolbarButton.presentationMode::before { - content: url(images/toolbarButton-presentationMode.png); + content: url(images/toolbarButton-presentationMode.svg); + content: var(--toolbarButton-presentationMode-icon); +} + +@media (prefers-color-scheme: dark) { + + .secondaryToolbarButton.presentationMode::before { + content: url(images/toolbarButton-presentationMode-dark.svg); + content: var(--toolbarButton-presentationMode-icon); + } +} + +.toolbarButton.print::before { + content: url(images/toolbarButton-print.svg); + content: var(--toolbarButton-print-icon); +} + +@media (prefers-color-scheme: dark) { + + .toolbarButton.print::before { + content: url(images/toolbarButton-print-dark.svg); + content: var(--toolbarButton-print-icon); + } } -.toolbarButton.print::before, .secondaryToolbarButton.print::before { - content: url(images/toolbarButton-print.png); + content: url(images/toolbarButton-print.svg); + content: var(--toolbarButton-print-icon); +} + +@media (prefers-color-scheme: dark) { + + .secondaryToolbarButton.print::before { + content: url(images/toolbarButton-print-dark.svg); + content: var(--toolbarButton-print-icon); + } +} + +.toolbarButton.openFile::before { + content: url(images/toolbarButton-openFile.svg); + content: var(--toolbarButton-openFile-icon); +} + +@media (prefers-color-scheme: dark) { + + .toolbarButton.openFile::before { + content: url(images/toolbarButton-openFile-dark.svg); + content: var(--toolbarButton-openFile-icon); + } } -.toolbarButton.openFile::before, .secondaryToolbarButton.openFile::before { - content: url(images/toolbarButton-openFile.png); + content: url(images/toolbarButton-openFile.svg); + content: var(--toolbarButton-openFile-icon); +} + +@media (prefers-color-scheme: dark) { + + .secondaryToolbarButton.openFile::before { + content: url(images/toolbarButton-openFile-dark.svg); + content: var(--toolbarButton-openFile-icon); + } +} + +.toolbarButton.download::before { + content: url(images/toolbarButton-download.svg); + content: var(--toolbarButton-download-icon); +} + +@media (prefers-color-scheme: dark) { + + .toolbarButton.download::before { + content: url(images/toolbarButton-download-dark.svg); + content: var(--toolbarButton-download-icon); + } } -.toolbarButton.download::before, .secondaryToolbarButton.download::before { - content: url(images/toolbarButton-download.png); + content: url(images/toolbarButton-download.svg); + content: var(--toolbarButton-download-icon); } -.toolbarButton.bookmark, -.secondaryToolbarButton.bookmark { - box-sizing: border-box; - outline: none; - padding-top: 4px; - text-decoration: none; +@media (prefers-color-scheme: dark) { + + .secondaryToolbarButton.download::before { + content: url(images/toolbarButton-download-dark.svg); + content: var(--toolbarButton-download-icon); + } } + .secondaryToolbarButton.bookmark { - padding-top: 5px; + padding-top: 6px; + text-decoration: none; } -.bookmark[href='#'] { - opacity: .5; +.bookmark[href="#"] { + opacity: 0.5; pointer-events: none; } -.toolbarButton.bookmark::before, +.toolbarButton.bookmark::before { + content: url(images/toolbarButton-bookmark.svg); + content: var(--toolbarButton-bookmark-icon); +} + +@media (prefers-color-scheme: dark) { + + .toolbarButton.bookmark::before { + content: url(images/toolbarButton-bookmark-dark.svg); + content: var(--toolbarButton-bookmark-icon); + } +} + .secondaryToolbarButton.bookmark::before { - content: url(images/toolbarButton-bookmark.png); + content: url(images/toolbarButton-bookmark.svg); + content: var(--toolbarButton-bookmark-icon); +} + +@media (prefers-color-scheme: dark) { + + .secondaryToolbarButton.bookmark::before { + content: url(images/toolbarButton-bookmark-dark.svg); + content: var(--toolbarButton-bookmark-icon); + } } #viewThumbnail.toolbarButton::before { - content: url(images/toolbarButton-viewThumbnail.png); + content: url(images/toolbarButton-viewThumbnail.svg); + content: var(--toolbarButton-viewThumbnail-icon); +} + +@media (prefers-color-scheme: dark) { + + #viewThumbnail.toolbarButton::before { + content: url(images/toolbarButton-viewThumbnail-dark.svg); + content: var(--toolbarButton-viewThumbnail-icon); + } } #viewOutline.toolbarButton::before { - content: url(images/toolbarButton-viewOutline.png); + content: url(images/toolbarButton-viewOutline.svg); + content: var(--toolbarButton-viewOutline-icon); +} + +@media (prefers-color-scheme: dark) { + + #viewOutline.toolbarButton::before { + content: url(images/toolbarButton-viewOutline-dark.svg); + content: var(--toolbarButton-viewOutline-icon); + } } html[dir="rtl"] #viewOutline.toolbarButton::before { transform: scaleX(-1); } #viewAttachments.toolbarButton::before { - content: url(images/toolbarButton-viewAttachments.png); + content: url(images/toolbarButton-viewAttachments.svg); + content: var(--toolbarButton-viewAttachments-icon); +} + +@media (prefers-color-scheme: dark) { + + #viewAttachments.toolbarButton::before { + content: url(images/toolbarButton-viewAttachments-dark.svg); + content: var(--toolbarButton-viewAttachments-icon); + } +} + +#viewLayers.toolbarButton::before { + content: url(images/toolbarButton-viewLayers.svg); + content: var(--toolbarButton-viewLayers-icon); +} + +@media (prefers-color-scheme: dark) { + + #viewLayers.toolbarButton::before { + content: url(images/toolbarButton-viewLayers-dark.svg); + content: var(--toolbarButton-viewLayers-icon); + } } #viewFind.toolbarButton::before { - content: url(images/toolbarButton-search.png); + content: url(images/toolbarButton-search.svg); + content: var(--toolbarButton-search-icon); +} + +@media (prefers-color-scheme: dark) { + + #viewFind.toolbarButton::before { + content: url(images/toolbarButton-search-dark.svg); + content: var(--toolbarButton-search-icon); + } } .toolbarButton.pdfSidebarNotification::after { @@ -1381,43 +2824,39 @@ html[dir="rtl"] #viewOutline.toolbarButton::before { display: inline-block; top: 1px; /* Create a filled circle, with a diameter of 9 pixels, using only CSS: */ - content: ''; + content: ""; background-color: rgba(112, 219, 85, 1); height: 9px; width: 9px; border-radius: 50%; } -html[dir='ltr'] .toolbarButton.pdfSidebarNotification::after { +html[dir="ltr"] .toolbarButton.pdfSidebarNotification::after { left: 17px; } -html[dir='rtl'] .toolbarButton.pdfSidebarNotification::after { +html[dir="rtl"] .toolbarButton.pdfSidebarNotification::after { right: 17px; } .secondaryToolbarButton { position: relative; - margin: 0 0 4px 0; - padding: 3px 0 1px 0; + margin: 0; + padding: 0 0 1px 0; height: auto; - min-height: 25px; + min-height: 26px; width: auto; min-width: 100%; white-space: normal; + border-radius: 0; + box-sizing: border-box; } html[dir="ltr"] .secondaryToolbarButton { - padding-left: 24px; + padding-left: 36px; text-align: left; } html[dir="rtl"] .secondaryToolbarButton { - padding-right: 24px; + padding-right: 36px; text-align: right; } -html[dir="ltr"] .secondaryToolbarButton.bookmark { - padding-left: 27px; -} -html[dir="rtl"] .secondaryToolbarButton.bookmark { - padding-right: 27px; -} html[dir="ltr"] .secondaryToolbarButton > span { padding-right: 4px; @@ -1427,106 +2866,272 @@ html[dir="rtl"] .secondaryToolbarButton > span { } .secondaryToolbarButton.firstPage::before { - content: url(images/secondaryToolbarButton-firstPage.png); + content: url(images/secondaryToolbarButton-firstPage.svg); + content: var(--secondaryToolbarButton-firstPage-icon); +} + +@media (prefers-color-scheme: dark) { + + .secondaryToolbarButton.firstPage::before { + content: url(images/secondaryToolbarButton-firstPage-dark.svg); + content: var(--secondaryToolbarButton-firstPage-icon); + } } .secondaryToolbarButton.lastPage::before { - content: url(images/secondaryToolbarButton-lastPage.png); + content: url(images/secondaryToolbarButton-lastPage.svg); + content: var(--secondaryToolbarButton-lastPage-icon); +} + +@media (prefers-color-scheme: dark) { + + .secondaryToolbarButton.lastPage::before { + content: url(images/secondaryToolbarButton-lastPage-dark.svg); + content: var(--secondaryToolbarButton-lastPage-icon); + } } .secondaryToolbarButton.rotateCcw::before { - content: url(images/secondaryToolbarButton-rotateCcw.png); + content: url(images/secondaryToolbarButton-rotateCcw.svg); + content: var(--secondaryToolbarButton-rotateCcw-icon); +} + +@media (prefers-color-scheme: dark) { + + .secondaryToolbarButton.rotateCcw::before { + content: url(images/secondaryToolbarButton-rotateCcw-dark.svg); + content: var(--secondaryToolbarButton-rotateCcw-icon); + } } .secondaryToolbarButton.rotateCw::before { - content: url(images/secondaryToolbarButton-rotateCw.png); + content: url(images/secondaryToolbarButton-rotateCw.svg); + content: var(--secondaryToolbarButton-rotateCw-icon); +} + +@media (prefers-color-scheme: dark) { + + .secondaryToolbarButton.rotateCw::before { + content: url(images/secondaryToolbarButton-rotateCw-dark.svg); + content: var(--secondaryToolbarButton-rotateCw-icon); + } } .secondaryToolbarButton.selectTool::before { - content: url(images/secondaryToolbarButton-selectTool.png); + content: url(images/secondaryToolbarButton-selectTool.svg); + content: var(--secondaryToolbarButton-selectTool-icon); +} + +@media (prefers-color-scheme: dark) { + + .secondaryToolbarButton.selectTool::before { + content: url(images/secondaryToolbarButton-selectTool-dark.svg); + content: var(--secondaryToolbarButton-selectTool-icon); + } } .secondaryToolbarButton.handTool::before { - content: url(images/secondaryToolbarButton-handTool.png); + content: url(images/secondaryToolbarButton-handTool.svg); + content: var(--secondaryToolbarButton-handTool-icon); +} + +@media (prefers-color-scheme: dark) { + + .secondaryToolbarButton.handTool::before { + content: url(images/secondaryToolbarButton-handTool-dark.svg); + content: var(--secondaryToolbarButton-handTool-icon); + } } .secondaryToolbarButton.scrollVertical::before { - content: url(images/secondaryToolbarButton-scrollVertical.png); + content: url(images/secondaryToolbarButton-scrollVertical.svg); + content: var(--secondaryToolbarButton-scrollVertical-icon); +} + +@media (prefers-color-scheme: dark) { + + .secondaryToolbarButton.scrollVertical::before { + content: url(images/secondaryToolbarButton-scrollVertical-dark.svg); + content: var(--secondaryToolbarButton-scrollVertical-icon); + } } .secondaryToolbarButton.scrollHorizontal::before { - content: url(images/secondaryToolbarButton-scrollHorizontal.png); + content: url(images/secondaryToolbarButton-scrollHorizontal.svg); + content: var(--secondaryToolbarButton-scrollHorizontal-icon); +} + +@media (prefers-color-scheme: dark) { + + .secondaryToolbarButton.scrollHorizontal::before { + content: url(images/secondaryToolbarButton-scrollHorizontal-dark.svg); + content: var(--secondaryToolbarButton-scrollHorizontal-icon); + } } .secondaryToolbarButton.scrollWrapped::before { - content: url(images/secondaryToolbarButton-scrollWrapped.png); + content: url(images/secondaryToolbarButton-scrollWrapped.svg); + content: var(--secondaryToolbarButton-scrollWrapped-icon); +} + +@media (prefers-color-scheme: dark) { + + .secondaryToolbarButton.scrollWrapped::before { + content: url(images/secondaryToolbarButton-scrollWrapped-dark.svg); + content: var(--secondaryToolbarButton-scrollWrapped-icon); + } } .secondaryToolbarButton.spreadNone::before { - content: url(images/secondaryToolbarButton-spreadNone.png); + content: url(images/secondaryToolbarButton-spreadNone.svg); + content: var(--secondaryToolbarButton-spreadNone-icon); +} + +@media (prefers-color-scheme: dark) { + + .secondaryToolbarButton.spreadNone::before { + content: url(images/secondaryToolbarButton-spreadNone-dark.svg); + content: var(--secondaryToolbarButton-spreadNone-icon); + } } .secondaryToolbarButton.spreadOdd::before { - content: url(images/secondaryToolbarButton-spreadOdd.png); + content: url(images/secondaryToolbarButton-spreadOdd.svg); + content: var(--secondaryToolbarButton-spreadOdd-icon); +} + +@media (prefers-color-scheme: dark) { + + .secondaryToolbarButton.spreadOdd::before { + content: url(images/secondaryToolbarButton-spreadOdd-dark.svg); + content: var(--secondaryToolbarButton-spreadOdd-icon); + } } .secondaryToolbarButton.spreadEven::before { - content: url(images/secondaryToolbarButton-spreadEven.png); + content: url(images/secondaryToolbarButton-spreadEven.svg); + content: var(--secondaryToolbarButton-spreadEven-icon); +} + +@media (prefers-color-scheme: dark) { + + .secondaryToolbarButton.spreadEven::before { + content: url(images/secondaryToolbarButton-spreadEven-dark.svg); + content: var(--secondaryToolbarButton-spreadEven-icon); + } } .secondaryToolbarButton.documentProperties::before { - content: url(images/secondaryToolbarButton-documentProperties.png); + content: url(images/secondaryToolbarButton-documentProperties.svg); + content: var(--secondaryToolbarButton-documentProperties-icon); +} + +@media (prefers-color-scheme: dark) { + + .secondaryToolbarButton.documentProperties::before { + content: url(images/secondaryToolbarButton-documentProperties-dark.svg); + content: var(--secondaryToolbarButton-documentProperties-icon); + } } .verticalToolbarSeparator { display: block; - padding: 8px 0; - margin: 8px 4px; + padding: 11px 0; + margin: 5px 2px; width: 1px; - background-color: rgba(0, 0, 0, 0.5); - box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08); + background-color: rgba(0, 0, 0, 0.3); + background-color: var(--separator-color); } -html[dir='ltr'] .verticalToolbarSeparator { + +@media (prefers-color-scheme: dark) { + + .verticalToolbarSeparator { + background-color: rgba(0, 0, 0, 0.3); + background-color: var(--separator-color); + } +} +html[dir="ltr"] .verticalToolbarSeparator { margin-left: 2px; } -html[dir='rtl'] .verticalToolbarSeparator { +html[dir="rtl"] .verticalToolbarSeparator { margin-right: 2px; } .horizontalToolbarSeparator { display: block; - margin: 0 0 4px 0; + margin: 6px 0 5px 0; height: 1px; width: 100%; - background-color: rgba(0, 0, 0, 0.5); - box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08); + border-top: 1px solid rgba(222, 222, 222, 1); + border-top: 1px solid var(--doorhanger-separator-color); +} + +@media (prefers-color-scheme: dark) { + + .horizontalToolbarSeparator { + border-top: 1px solid rgba(92, 92, 97, 1); + border-top: 1px solid var(--doorhanger-separator-color); + } } .toolbarField { - padding: 3px 6px; - margin: 4px 0 4px 0; + padding: 4px 7px; + margin: 3px 0 3px 0; border-radius: 2px; - background-color: rgba(255, 255, 255, 0.09); - background-image: linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)); + background-color: rgba(255, 255, 255, 1); + background-color: var(--field-bg-color); background-clip: padding-box; border-width: 1px; border-style: solid; - border-color: rgba(0, 0, 0, 0.32) rgba(0, 0, 0, 0.38) rgba(0, 0, 0, 0.42); - box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05) inset, - 0 1px 0 rgba(255, 255, 255, 0.05); - color: rgba(242, 242, 242, 1); + border-color: rgba(187, 187, 188, 1); + border-color: var(--field-border-color); + box-shadow: none; + color: rgba(6, 6, 6, 1); + color: var(--field-color); font-size: 12px; - line-height: 14px; + line-height: 16px; outline-style: none; } -.toolbarField[type=checkbox] { - display: inline-block; - margin: 8px 0px; +@media (prefers-color-scheme: dark) { + + .toolbarField { + color: rgba(250, 250, 250, 1); + color: var(--field-color); + } +} + +@media (prefers-color-scheme: dark) { + + .toolbarField { + border-color: rgba(115, 115, 115, 1); + border-color: var(--field-border-color); + } +} + +@media (prefers-color-scheme: dark) { + + .toolbarField { + background-color: rgba(64, 64, 68, 1); + background-color: var(--field-bg-color); + } +} + +.toolbarField[type="checkbox"] { + opacity: 0; + position: absolute !important; + left: 0; +} + +html[dir="ltr"] .toolbarField[type="checkbox"] { + margin: 10px 0 3px 7px; +} + +html[dir="rtl"] .toolbarField[type="checkbox"] { + margin: 10px 7px 3px 0; } .toolbarField.pageNumber { - -webkit-appearance: none; -moz-appearance: textfield; /* hides the spinner in moz */ min-width: 16px; text-align: right; @@ -1534,34 +3139,38 @@ html[dir='rtl'] .verticalToolbarSeparator { } .toolbarField.pageNumber.visiblePageIsLoading { - background-image: url(images/loading-small.png); + background-image: url(images/loading.svg); + background-image: var(--loading-icon); background-repeat: no-repeat; - background-position: 1px; + background-position: 3px; } -.toolbarField.pageNumber::-webkit-inner-spin-button, -.toolbarField.pageNumber::-webkit-outer-spin-button { - -webkit-appearance: none; - margin: 0; +@media (prefers-color-scheme: dark) { + + .toolbarField.pageNumber.visiblePageIsLoading { + background-image: url(images/loading-dark.svg); + background-image: var(--loading-icon); + } } -.toolbarField:hover { - background-color: rgba(255, 255, 255, 0.11); - border-color: rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.43) rgba(0, 0, 0, 0.45); +.toolbarField.pageNumber::-webkit-inner-spin-button, +.toolbarField.pageNumber::-webkit-outer-spin-button { + -webkit-appearance: none; + margin: 0; } .toolbarField:focus { - background-color: rgba(255, 255, 255, 0.15); - border-color: rgba(77, 184, 255, 0.8) rgba(77, 184, 255, 0.85) rgba(77, 184, 255, 0.9); + border-color: #0a84ff; } .toolbarLabel { min-width: 16px; - padding: 3px 6px 3px 2px; - margin: 4px 2px 4px 0; + padding: 6px; + margin: 2px; border: 1px solid rgba(0, 0, 0, 0); border-radius: 2px; - color: rgba(217, 217, 217, 1); + color: rgba(12, 12, 13, 1); + color: var(--main-color); font-size: 12px; line-height: 14px; text-align: left; @@ -1572,6 +3181,21 @@ html[dir='rtl'] .verticalToolbarSeparator { cursor: default; } +@media (prefers-color-scheme: dark) { + + .toolbarLabel { + color: rgba(249, 249, 250, 1); + color: var(--main-color); + } +} + +html[dir="ltr"] #numPages.toolbarLabel { + padding-left: 2px; +} +html[dir="rtl"] #numPages.toolbarLabel { + padding-right: 2px; +} + #thumbnailView { position: absolute; width: calc(100% - 60px); @@ -1590,10 +3214,10 @@ html[dir='rtl'] .verticalToolbarSeparator { .thumbnail { margin: 0 10px 5px 10px; } -html[dir='ltr'] .thumbnail { +html[dir="ltr"] .thumbnail { float: left; } -html[dir='rtl'] .thumbnail { +html[dir="rtl"] .thumbnail { float: right; } @@ -1606,7 +3230,7 @@ html[dir='rtl'] .thumbnail { } .thumbnail:not([data-loaded]) { - border: 1px dashed rgba(255, 255, 255, 0.5); + border: 1px dashed rgba(132, 132, 132, 1); margin: -1px 9px 4px 9px; } @@ -1626,41 +3250,66 @@ html[dir='rtl'] .thumbnail { a:focus > .thumbnail > .thumbnailSelectionRing > .thumbnailImage, .thumbnail:hover > .thumbnailSelectionRing > .thumbnailImage { - opacity: .9; + opacity: 0.9; } -a:focus > .thumbnail > .thumbnailSelectionRing, -.thumbnail:hover > .thumbnailSelectionRing { +a:focus > .thumbnail > .thumbnailSelectionRing { + background-color: rgba(0, 0, 0, 0.15); + background-color: var(--sidebaritem-bg-color); + background-clip: padding-box; + color: rgba(255, 255, 255, 0.9); +} + +@media (prefers-color-scheme: dark) { + + a:focus > .thumbnail > .thumbnailSelectionRing { background-color: rgba(255, 255, 255, 0.15); - background-image: linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)); + background-color: var(--sidebaritem-bg-color); + } +} + +.thumbnail:hover > .thumbnailSelectionRing { + background-color: rgba(0, 0, 0, 0.15); + background-color: var(--sidebaritem-bg-color); background-clip: padding-box; - box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, - 0 0 1px rgba(255, 255, 255, 0.2) inset, - 0 0 1px rgba(0, 0, 0, 0.2); color: rgba(255, 255, 255, 0.9); } +@media (prefers-color-scheme: dark) { + + .thumbnail:hover > .thumbnailSelectionRing { + background-color: rgba(255, 255, 255, 0.15); + background-color: var(--sidebaritem-bg-color); + } +} + .thumbnail.selected > .thumbnailSelectionRing > .thumbnailImage { - box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5); opacity: 1; } .thumbnail.selected > .thumbnailSelectionRing { - background-color: rgba(255, 255, 255, 0.3); - background-image: linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)); + background-color: rgba(0, 0, 0, 0.15); + background-color: var(--sidebaritem-bg-color); background-clip: padding-box; - box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, - 0 0 1px rgba(255, 255, 255, 0.1) inset, - 0 0 1px rgba(0, 0, 0, 0.2); - color: rgba(255, 255, 255,1); + color: rgba(255, 255, 255, 1); +} + +@media (prefers-color-scheme: dark) { + + .thumbnail.selected > .thumbnailSelectionRing { + background-color: rgba(255, 255, 255, 0.15); + background-color: var(--sidebaritem-bg-color); + } } #outlineView, -#attachmentsView { +#attachmentsView, +#layersView { position: absolute; width: calc(100% - 8px); top: 0; bottom: 0; + padding: 4px 4px 0; overflow: auto; -webkit-overflow-scrolling: touch; -webkit-user-select: none; @@ -1669,34 +3318,27 @@ a:focus > .thumbnail > .thumbnailSelectionRing, user-select: none; } -#outlineView { - padding: 4px 4px 0; -} -#attachmentsView { - padding: 3px 4px 0; -} - -html[dir='ltr'] .outlineWithDeepNesting > .outlineItem, -html[dir='ltr'] .outlineItem > .outlineItems { +html[dir="ltr"] .treeWithDeepNesting > .treeItem, +html[dir="ltr"] .treeItem > .treeItems { margin-left: 20px; } -html[dir='rtl'] .outlineWithDeepNesting > .outlineItem, -html[dir='rtl'] .outlineItem > .outlineItems { +html[dir="rtl"] .treeWithDeepNesting > .treeItem, +html[dir="rtl"] .treeItem > .treeItems { margin-right: 20px; } -.outlineItem > a, -.attachmentsItem > button { +.treeItem > a { text-decoration: none; display: inline-block; min-width: 95%; - min-width: calc(100% - 4px); /* Subtract the right padding (left, in RTL mode) - of the container. */ + /* Subtract the right padding (left, in RTL mode) of the container: */ + min-width: calc(100% - 4px); height: auto; margin-bottom: 1px; border-radius: 2px; - color: rgba(255, 255, 255, 0.8); + color: rgba(0, 0, 0, 0.8); + color: var(--outline-color); font-size: 13px; line-height: 15px; -webkit-user-select: none; @@ -1704,87 +3346,206 @@ html[dir='rtl'] .outlineItem > .outlineItems { -ms-user-select: none; user-select: none; white-space: normal; -} - -.attachmentsItem > button { - border: 0 none; - background: none; cursor: pointer; - width: 100%; } -html[dir='ltr'] .outlineItem > a { +@media (prefers-color-scheme: dark) { + + .treeItem > a { + color: rgba(255, 255, 255, 0.8); + color: var(--outline-color); + } +} +html[dir="ltr"] .treeItem > a { padding: 2px 0 5px 4px; } -html[dir='ltr'] .attachmentsItem > button { - padding: 2px 0 3px 7px; - text-align: left; +html[dir="rtl"] .treeItem > a { + padding: 2px 4px 5px 0; } -html[dir='rtl'] .outlineItem > a { - padding: 2px 4px 5px 0; +#layersView .treeItem > a > * { + cursor: pointer; } -html[dir='rtl'] .attachmentsItem > button { - padding: 2px 7px 3px 0; - text-align: right; +html[dir="ltr"] #layersView .treeItem > a > label { + padding-left: 4px; +} +html[dir="rtl"] #layersView .treesItem > a > label { + padding-right: 4px; } -.outlineItemToggler { +.treeItemToggler { position: relative; height: 0; width: 0; color: rgba(255, 255, 255, 0.5); } -.outlineItemToggler::before { - content: url(images/treeitem-expanded.png); +.treeItemToggler::before { + content: url(images/treeitem-expanded.svg); + content: var(--treeitem-expanded-icon); display: inline-block; position: absolute; + max-width: 16px; +} +@media (prefers-color-scheme: dark) { + + .treeItemToggler::before { + content: url(images/treeitem-expanded-dark.svg); + content: var(--treeitem-expanded-icon); + } } -.outlineItemToggler.outlineItemsHidden::before { - content: url(images/treeitem-collapsed.png); +.treeItemToggler.treeItemsHidden::before { + content: url(images/treeitem-collapsed.svg); + content: var(--treeitem-collapsed-icon); + max-width: 16px; } -html[dir='rtl'] .outlineItemToggler.outlineItemsHidden::before { +@media (prefers-color-scheme: dark) { + + .treeItemToggler.treeItemsHidden::before { + content: url(images/treeitem-collapsed-dark.svg); + content: var(--treeitem-collapsed-icon); + } +} +html[dir="rtl"] .treeItemToggler.treeItemsHidden::before { transform: scaleX(-1); } -.outlineItemToggler.outlineItemsHidden ~ .outlineItems { +.treeItemToggler.treeItemsHidden ~ .treeItems { display: none; } -html[dir='ltr'] .outlineItemToggler { +html[dir="ltr"] .treeItemToggler { float: left; } -html[dir='rtl'] .outlineItemToggler { +html[dir="rtl"] .treeItemToggler { float: right; } -html[dir='ltr'] .outlineItemToggler::before { +html[dir="ltr"] .treeItemToggler::before { right: 4px; } -html[dir='rtl'] .outlineItemToggler::before { +html[dir="rtl"] .treeItemToggler::before { left: 4px; } -.outlineItemToggler:hover, -.outlineItemToggler:hover + a, -.outlineItemToggler:hover ~ .outlineItems, -.outlineItem > a:hover, -.attachmentsItem > button:hover { - background-color: rgba(255, 255, 255, 0.02); - background-image: linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)); +.treeItemToggler:hover { + background-color: rgba(0, 0, 0, 0.15); + background-color: var(--sidebaritem-bg-color); background-clip: padding-box; - box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, - 0 0 1px rgba(255, 255, 255, 0.2) inset, - 0 0 1px rgba(0, 0, 0, 0.2); border-radius: 2px; + color: rgba(0, 0, 0, 0.9); + color: var(--outline-hover-color); +} + +@media (prefers-color-scheme: dark) { + + .treeItemToggler:hover { color: rgba(255, 255, 255, 0.9); + color: var(--outline-hover-color); + } } -.outlineItem.selected { - background-color: rgba(255, 255, 255, 0.08); - background-image: linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)); +@media (prefers-color-scheme: dark) { + + .treeItemToggler:hover { + background-color: rgba(255, 255, 255, 0.15); + background-color: var(--sidebaritem-bg-color); + } +} + +.treeItemToggler:hover + a { + background-color: rgba(0, 0, 0, 0.15); + background-color: var(--sidebaritem-bg-color); background-clip: padding-box; - box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, - 0 0 1px rgba(255, 255, 255, 0.1) inset, - 0 0 1px rgba(0, 0, 0, 0.2); - color: rgba(255, 255, 255, 1); + border-radius: 2px; + color: rgba(0, 0, 0, 0.9); + color: var(--outline-hover-color); +} + +@media (prefers-color-scheme: dark) { + + .treeItemToggler:hover + a { + color: rgba(255, 255, 255, 0.9); + color: var(--outline-hover-color); + } +} + +@media (prefers-color-scheme: dark) { + + .treeItemToggler:hover + a { + background-color: rgba(255, 255, 255, 0.15); + background-color: var(--sidebaritem-bg-color); + } +} + +.treeItemToggler:hover ~ .treeItems { + background-color: rgba(0, 0, 0, 0.15); + background-color: var(--sidebaritem-bg-color); + background-clip: padding-box; + border-radius: 2px; + color: rgba(0, 0, 0, 0.9); + color: var(--outline-hover-color); +} + +@media (prefers-color-scheme: dark) { + + .treeItemToggler:hover ~ .treeItems { + color: rgba(255, 255, 255, 0.9); + color: var(--outline-hover-color); + } +} + +@media (prefers-color-scheme: dark) { + + .treeItemToggler:hover ~ .treeItems { + background-color: rgba(255, 255, 255, 0.15); + background-color: var(--sidebaritem-bg-color); + } +} + +.treeItem > a:hover { + background-color: rgba(0, 0, 0, 0.15); + background-color: var(--sidebaritem-bg-color); + background-clip: padding-box; + border-radius: 2px; + color: rgba(0, 0, 0, 0.9); + color: var(--outline-hover-color); +} + +@media (prefers-color-scheme: dark) { + + .treeItem > a:hover { + color: rgba(255, 255, 255, 0.9); + color: var(--outline-hover-color); + } +} + +@media (prefers-color-scheme: dark) { + + .treeItem > a:hover { + background-color: rgba(255, 255, 255, 0.15); + background-color: var(--sidebaritem-bg-color); + } +} + +.treeItem.selected { + background-color: rgba(0, 0, 0, 1); + background-color: var(--outline-active-bg-color); + background-clip: padding-box; + color: rgba(0, 0, 0, 0.08); + color: var(--outline-active-color); +} + +@media (prefers-color-scheme: dark) { + + .treeItem.selected { + color: rgba(255, 255, 255, 0.08); + color: var(--outline-active-color); + } +} + +@media (prefers-color-scheme: dark) { + + .treeItem.selected { + background-color: rgba(255, 255, 255, 1); + background-color: var(--outline-active-bg-color); + } } .noResults { @@ -1805,14 +3566,31 @@ html[dir='rtl'] .outlineItemToggler::before { } #errorWrapper { - background: none repeat scroll 0 0 rgba(255, 85, 85, 1); - color: rgba(255, 255, 255, 1); + background: none repeat scroll 0 0 rgba(255, 74, 74, 1); + background: none repeat scroll 0 0 var(--errorWrapper-bg-color); + color: rgba(12, 12, 13, 1); + color: var(--main-color); left: 0; position: absolute; right: 0; z-index: 1000; - padding: 3px; - font-size: 0.8em; + padding: 3px 6px; +} + +@media (prefers-color-scheme: dark) { + + #errorWrapper { + color: rgba(249, 249, 250, 1); + color: var(--main-color); + } +} + +@media (prefers-color-scheme: dark) { + + #errorWrapper { + background: none repeat scroll 0 0 rgba(199, 17, 17, 1); + background: none repeat scroll 0 0 var(--errorWrapper-bg-color); + } } .loadingInProgress #errorWrapper { top: 37px; @@ -1828,16 +3606,44 @@ html[dir='rtl'] .outlineItemToggler::before { #errorMoreInfo { background-color: rgba(255, 255, 255, 1); - color: rgba(0, 0, 0, 1); + background-color: var(--field-bg-color); + color: rgba(6, 6, 6, 1); + color: var(--field-color); + border: 1px solid rgba(187, 187, 188, 1); + border: 1px solid var(--field-border-color); padding: 3px; margin: 3px; width: 98%; } +@media (prefers-color-scheme: dark) { + + #errorMoreInfo { + border: 1px solid rgba(115, 115, 115, 1); + border: 1px solid var(--field-border-color); + } +} + +@media (prefers-color-scheme: dark) { + + #errorMoreInfo { + color: rgba(250, 250, 250, 1); + color: var(--field-color); + } +} + +@media (prefers-color-scheme: dark) { + + #errorMoreInfo { + background-color: rgba(64, 64, 68, 1); + background-color: var(--field-bg-color); + } +} + .overlayButton { width: auto; margin: 3px 4px 2px 4px !important; - padding: 2px 6px 3px 6px; + padding: 2px 11px 2px 11px; } #overlayContainer { @@ -1863,17 +3669,33 @@ html[dir='rtl'] .outlineItemToggler::before { display: inline-block; padding: 15px; border-spacing: 4px; - color: rgba(217, 217, 217, 1); + color: rgba(12, 12, 13, 1); + color: var(--main-color); font-size: 12px; line-height: 14px; - background-color: rgba(71, 71, 71, 1); /* fallback */ - background-image: url(images/texture.png), - linear-gradient(rgba(82, 82, 82,0.99), rgba(69, 69, 69, 0.95)); + background-color: rgba(255, 255, 255, 1); + background-color: var(--doorhanger-bg-color); border: 1px solid rgba(0, 0, 0, 0.5); border-radius: 4px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); } +@media (prefers-color-scheme: dark) { + + #overlayContainer > .container > .dialog { + background-color: rgba(74, 74, 79, 1); + background-color: var(--doorhanger-bg-color); + } +} + +@media (prefers-color-scheme: dark) { + + #overlayContainer > .container > .dialog { + color: rgba(249, 249, 250, 1); + color: var(--main-color); + } +} + .dialog > .row { display: table-row; } @@ -1891,8 +3713,16 @@ html[dir='rtl'] .outlineItemToggler::before { margin: 4px 0 4px 0; height: 1px; width: 100%; - background-color: rgba(0, 0, 0, 0.5); - box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08); + background-color: rgba(0, 0, 0, 0.3); + background-color: var(--separator-color); +} + +@media (prefers-color-scheme: dark) { + + .dialog .separator { + background-color: rgba(0, 0, 0, 0.3); + background-color: var(--separator-color); + } } .dialog .buttonRow { @@ -1917,10 +3747,10 @@ html[dir='rtl'] .outlineItemToggler::before { #documentPropertiesOverlay .row > * { min-width: 100px; } -html[dir='ltr'] #documentPropertiesOverlay .row > * { +html[dir="ltr"] #documentPropertiesOverlay .row > * { text-align: left; } -html[dir='rtl'] #documentPropertiesOverlay .row > * { +html[dir="rtl"] #documentPropertiesOverlay .row > * { text-align: right; } #documentPropertiesOverlay .row > span { @@ -1993,14 +3823,14 @@ html[dir='rtl'] #documentPropertiesOverlay .row > * { white-space: pre; } #PDFBug .stats .title { - font-weight: bold; + font-weight: bold; } #PDFBug table { font-size: 10px; } #viewer.textLayer-visible .textLayer { - opacity: 1.0; + opacity: 1; } #viewer.textLayer-visible .canvasWrapper { @@ -2033,7 +3863,8 @@ html[dir='rtl'] #documentPropertiesOverlay .row > * { cursor: -webkit-grab !important; cursor: grab !important; } -.grab-to-pan-grab *:not(input):not(textarea):not(button):not(select):not(:link) { +.grab-to-pan-grab + *:not(input):not(textarea):not(button):not(select):not(:link) { cursor: inherit !important; } .grab-to-pan-grab:active, @@ -2060,213 +3891,6 @@ html[dir='rtl'] #documentPropertiesOverlay .row > * { display: none; } -@media screen and (-webkit-min-device-pixel-ratio: 1.1), screen and (min-resolution: 1.1dppx) { - /* Rules for Retina screens */ - .toolbarButton::before { - transform: scale(0.5); - top: -5px; - } - - .secondaryToolbarButton::before { - transform: scale(0.5); - top: -4px; - } - - html[dir='ltr'] .toolbarButton::before, - html[dir='rtl'] .toolbarButton::before { - left: -1px; - } - - html[dir='ltr'] .secondaryToolbarButton::before { - left: -2px; - } - html[dir='rtl'] .secondaryToolbarButton::before { - left: 186px; - } - - .toolbarField.pageNumber.visiblePageIsLoading, - #findInput[data-status="pending"] { - background-image: url(images/loading-small@2x.png); - background-size: 16px 17px; - } - - .dropdownToolbarButton::after { - transform: scale(0.5); - top: -5px; - content: url(images/toolbarButton-menuArrows@2x.png); - } - html[dir='ltr'] .dropdownToolbarButton::after { - right: 4px; - } - html[dir='rtl'] .dropdownToolbarButton::after { - left: 4px; - } - - .toolbarButton#sidebarToggle::before { - content: url(images/toolbarButton-sidebarToggle@2x.png); - } - html[dir='rtl'] .toolbarButton#sidebarToggle::before { - transform: scale(-0.5, 0.5); - } - - .toolbarButton#secondaryToolbarToggle::before { - content: url(images/toolbarButton-secondaryToolbarToggle@2x.png); - } - html[dir='rtl'] .toolbarButton#secondaryToolbarToggle::before { - transform: scale(-0.5, 0.5); - } - - .toolbarButton.findPrevious::before { - content: url(images/findbarButton-previous@2x.png); - } - html[dir='rtl'] .toolbarButton.findPrevious::before { - transform: scale(-0.5, 0.5); - } - - .toolbarButton.findNext::before { - content: url(images/findbarButton-next@2x.png); - } - html[dir='rtl'] .toolbarButton.findNext::before { - transform: scale(-0.5, 0.5); - } - - .toolbarButton.pageUp::before { - content: url(images/toolbarButton-pageUp@2x.png); - } - html[dir='rtl'] .toolbarButton.pageUp::before { - transform: scale(-0.5, 0.5); - } - - .toolbarButton.pageDown::before { - content: url(images/toolbarButton-pageDown@2x.png); - } - html[dir='rtl'] .toolbarButton.pageDown::before { - transform: scale(-0.5, 0.5); - } - - .toolbarButton.zoomIn::before { - content: url(images/toolbarButton-zoomIn@2x.png); - } - - .toolbarButton.zoomOut::before { - content: url(images/toolbarButton-zoomOut@2x.png); - } - - .toolbarButton.presentationMode::before, - .secondaryToolbarButton.presentationMode::before { - content: url(images/toolbarButton-presentationMode@2x.png); - } - - .toolbarButton.print::before, - .secondaryToolbarButton.print::before { - content: url(images/toolbarButton-print@2x.png); - } - - .toolbarButton.openFile::before, - .secondaryToolbarButton.openFile::before { - content: url(images/toolbarButton-openFile@2x.png); - } - - .toolbarButton.download::before, - .secondaryToolbarButton.download::before { - content: url(images/toolbarButton-download@2x.png); - } - - .toolbarButton.bookmark::before, - .secondaryToolbarButton.bookmark::before { - content: url(images/toolbarButton-bookmark@2x.png); - } - - #viewThumbnail.toolbarButton::before { - content: url(images/toolbarButton-viewThumbnail@2x.png); - } - - #viewOutline.toolbarButton::before { - content: url(images/toolbarButton-viewOutline@2x.png); - } - html[dir="rtl"] #viewOutline.toolbarButton::before { - transform: scale(-0.5, 0.5); - } - - #viewAttachments.toolbarButton::before { - content: url(images/toolbarButton-viewAttachments@2x.png); - } - - #viewFind.toolbarButton::before { - content: url(images/toolbarButton-search@2x.png); - } - - .secondaryToolbarButton.firstPage::before { - content: url(images/secondaryToolbarButton-firstPage@2x.png); - } - - .secondaryToolbarButton.lastPage::before { - content: url(images/secondaryToolbarButton-lastPage@2x.png); - } - - .secondaryToolbarButton.rotateCcw::before { - content: url(images/secondaryToolbarButton-rotateCcw@2x.png); - } - - .secondaryToolbarButton.rotateCw::before { - content: url(images/secondaryToolbarButton-rotateCw@2x.png); - } - - .secondaryToolbarButton.selectTool::before { - content: url(images/secondaryToolbarButton-selectTool@2x.png); - } - - .secondaryToolbarButton.handTool::before { - content: url(images/secondaryToolbarButton-handTool@2x.png); - } - - .secondaryToolbarButton.scrollVertical::before { - content: url(images/secondaryToolbarButton-scrollVertical@2x.png); - } - - .secondaryToolbarButton.scrollHorizontal::before { - content: url(images/secondaryToolbarButton-scrollHorizontal@2x.png); - } - - .secondaryToolbarButton.scrollWrapped::before { - content: url(images/secondaryToolbarButton-scrollWrapped@2x.png); - } - - .secondaryToolbarButton.spreadNone::before { - content: url(images/secondaryToolbarButton-spreadNone@2x.png); - } - - .secondaryToolbarButton.spreadOdd::before { - content: url(images/secondaryToolbarButton-spreadOdd@2x.png); - } - - .secondaryToolbarButton.spreadEven::before { - content: url(images/secondaryToolbarButton-spreadEven@2x.png); - } - - .secondaryToolbarButton.documentProperties::before { - content: url(images/secondaryToolbarButton-documentProperties@2x.png); - } - - .outlineItemToggler::before { - transform: scale(0.5); - top: -1px; - content: url(images/treeitem-expanded@2x.png); - } - .outlineItemToggler.outlineItemsHidden::before { - content: url(images/treeitem-collapsed@2x.png); - } - html[dir='rtl'] .outlineItemToggler.outlineItemsHidden::before { - transform: scale(-0.5, 0.5); - } - html[dir='ltr'] .outlineItemToggler::before { - right: 0; - } - html[dir='rtl'] .outlineItemToggler::before { - left: 0; - } -} - @media print { /* General rules for printing. */ body { @@ -2274,14 +3898,22 @@ html[dir='rtl'] #documentPropertiesOverlay .row > * { } /* Rules for browsers that don't support mozPrintCallback. */ - #sidebarContainer, #secondaryToolbar, .toolbar, #loadingBox, #errorWrapper, .textLayer { + #sidebarContainer, + #secondaryToolbar, + .toolbar, + #loadingBox, + #errorWrapper, + .textLayer { display: none; } #viewerContainer { overflow: visible; } - #mainContainer, #viewerContainer, .page, .page canvas { + #mainContainer, + #viewerContainer, + .page, + .page canvas { position: static; padding: 0; margin: 0; @@ -2327,6 +3959,7 @@ html[dir='rtl'] #documentPropertiesOverlay .row > * { } #printContainer canvas, #printContainer img { + direction: ltr; display: block; } } @@ -2352,10 +3985,10 @@ html[dir='rtl'] #documentPropertiesOverlay .row > * { background-color: rgba(0, 0, 0, 0.7); } - html[dir='ltr'] #outerContainer.sidebarOpen #viewerContainer { + html[dir="ltr"] #outerContainer.sidebarOpen #viewerContainer { left: 0px !important; } - html[dir='rtl'] #outerContainer.sidebarOpen #viewerContainer { + html[dir="rtl"] #outerContainer.sidebarOpen #viewerContainer { right: 0px !important; } @@ -2388,7 +4021,8 @@ html[dir='rtl'] #documentPropertiesOverlay .row > * { } @media all and (max-width: 640px) { - .hiddenSmallView, .hiddenSmallView * { + .hiddenSmallView, + .hiddenSmallView * { display: none; } .visibleSmallView { @@ -2397,11 +4031,11 @@ html[dir='rtl'] #documentPropertiesOverlay .row > * { .toolbarButtonSpacer { width: 0; } - html[dir='ltr'] .findbar { - left: 38px; + html[dir="ltr"] .findbar { + left: 34px; } - html[dir='rtl'] .findbar { - right: 38px; + html[dir="rtl"] .findbar { + right: 34px; } } diff --git a/third-party/pdfjs/web/viewer.html b/third-party/pdfjs/web/viewer.html index db8517b1a..123a47d2c 100644 --- a/third-party/pdfjs/web/viewer.html +++ b/third-party/pdfjs/web/viewer.html @@ -1,7 +1,6 @@ <!DOCTYPE html> <!-- Copyright 2012 Mozilla Foundation -Modifications made for Epiphany by Jan-Michael Brummer <jan.brummer@tabos.org> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,7 +21,7 @@ Adobe CMap resources are covered by their own copyright but the same license: See https://github.com/adobe-type-tools/cmap-resources --> <html dir="ltr" mozdisallowselectionprint> - <head pdf_data="%s" pdf_name="%s"> + <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <meta name="google" content="notranslate"> @@ -30,7 +29,6 @@ See https://github.com/adobe-type-tools/cmap-resources <title>PDF.js viewer</title> - <base href="ephy-resource:///org/gnome/epiphany/pdfjs/web/"> <link rel="stylesheet" href="viewer.css"> @@ -39,7 +37,7 @@ See https://github.com/adobe-type-tools/cmap-resources <script src="../build/pdf.js"></script> - <script src="viewer.js"></script> + <script src="viewer.js"></script> </head> @@ -58,6 +56,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"> @@ -67,6 +68,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 --> diff --git a/third-party/pdfjs/web/viewer.js b/third-party/pdfjs/web/viewer.js index e7a792006..d89902345 100644 --- a/third-party/pdfjs/web/viewer.js +++ b/third-party/pdfjs/web/viewer.js @@ -3,7 +3,6 @@ * Javascript code in this page * * Copyright 2020 Mozilla Foundation - * Modifications made for Epiphany by Jan-Michael Brummer <jan.brummer@tabos.org> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -122,11 +121,11 @@ let pdfjsWebApp, pdfjsWebAppOptions; } ; { - __webpack_require__(33); + __webpack_require__(35); } ; { - __webpack_require__(38); + __webpack_require__(40); } function getViewerConfiguration() { @@ -189,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"), @@ -307,31 +308,35 @@ var _password_prompt = __webpack_require__(11); var _pdf_attachment_viewer = __webpack_require__(12); -var _pdf_document_properties = __webpack_require__(13); +var _pdf_document_properties = __webpack_require__(14); -var _pdf_find_bar = __webpack_require__(14); +var _pdf_find_bar = __webpack_require__(15); -var _pdf_find_controller = __webpack_require__(15); +var _pdf_find_controller = __webpack_require__(16); -var _pdf_history = __webpack_require__(17); +var _pdf_history = __webpack_require__(18); -var _pdf_link_service = __webpack_require__(18); +var _pdf_layer_viewer = __webpack_require__(19); -var _pdf_outline_viewer = __webpack_require__(19); +var _pdf_link_service = __webpack_require__(20); -var _pdf_presentation_mode = __webpack_require__(20); +var _pdf_outline_viewer = __webpack_require__(21); -var _pdf_sidebar_resizer = __webpack_require__(21); +var _pdf_presentation_mode = __webpack_require__(22); -var _pdf_thumbnail_viewer = __webpack_require__(22); +var _pdf_sidebar_resizer = __webpack_require__(23); -var _pdf_viewer = __webpack_require__(24); +var _pdf_thumbnail_viewer = __webpack_require__(24); -var _secondary_toolbar = __webpack_require__(29); +var _pdf_viewer = __webpack_require__(26); -var _toolbar = __webpack_require__(31); +var _secondary_toolbar = __webpack_require__(31); -var _view_history = __webpack_require__(32); +var _toolbar = __webpack_require__(33); + +var _viewer_compatibility = __webpack_require__(4); + +var _view_history = __webpack_require__(34); const DEFAULT_SCALE_DELTA = 1.1; const DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT = 5000; @@ -343,6 +348,8 @@ const ViewOnLoad = { PREVIOUS: 0, INITIAL: 1 }; +const KNOWN_VERSIONS = ["1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "2.0", "2.1", "2.2", "2.3"]; +const KNOWN_GENERATORS = ["acrobat distiller", "acrobat pdfwriter", "adobe livecycle", "adobe pdf library", "adobe photoshop", "ghostscript", "tcpdf", "cairo", "dvipdfm", "dvips", "pdftex", "pdfkit", "itext", "prince", "quarkxpress", "mac os x", "microsoft", "openoffice", "oracle", "luradocument", "pdf-xchange", "antenna house", "aspose.cells", "fpdf"]; class DefaultExternalServices { constructor() { @@ -412,6 +419,7 @@ const PDFViewerApplication = { pdfSidebarResizer: null, pdfOutlineViewer: null, pdfAttachmentViewer: null, + pdfLayerViewer: null, pdfCursorTools: null, store: null, downloadManager: null, @@ -429,6 +437,9 @@ const PDFViewerApplication = { externalServices: DefaultExternalServices, _boundEvents: {}, contentDispositionFilename: null, + triggerDelayedFallback: null, + _saveInProgress: false, + _wheelUnusedTicks: 0, async initialize(appConfig) { this.preferences = this.externalServices.createPreferences(); @@ -575,9 +586,7 @@ const PDFViewerApplication = { ignoreDestinationZoom: _app_options.AppOptions.get("ignoreDestinationZoom") }); this.pdfLinkService = pdfLinkService; - const downloadManager = this.externalServices.createDownloadManager({ - disableCreateObjectURL: _app_options.AppOptions.get("disableCreateObjectURL") - }); + const downloadManager = this.externalServices.createDownloadManager(); this.downloadManager = downloadManager; const findController = new _pdf_find_controller.PDFFindController({ linkService: pdfLinkService, @@ -608,6 +617,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 @@ -652,6 +662,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, @@ -818,9 +833,12 @@ const PDFViewerApplication = { this.url = ""; this.baseUrl = ""; this.contentDispositionFilename = null; + this.triggerDelayedFallback = null; + this._saveInProgress = false; this.pdfSidebar.reset(); this.pdfOutlineViewer.reset(); this.pdfAttachmentViewer.reset(); + this.pdfLayerViewer.reset(); if (this.pdfHistory) { this.pdfHistory.reset(); @@ -931,7 +949,9 @@ const PDFViewerApplication = { }); }, - download() { + download({ + sourceEventType = "download" + } = {}) { function downloadByUrl() { downloadManager.downloadUrl(url, filename); } @@ -953,11 +973,67 @@ const PDFViewerApplication = { const blob = new Blob([data], { type: "application/pdf" }); - downloadManager.download(blob, url, filename); + downloadManager.download(blob, url, filename, sourceEventType); }).catch(downloadByUrl); }, + save({ + sourceEventType = "download" + } = {}) { + if (this._saveInProgress) { + return; + } + + const url = this.baseUrl; + const filename = this.contentDispositionFilename || (0, _ui_utils.getPDFFileNameFromURL)(this.url); + const downloadManager = this.downloadManager; + + downloadManager.onerror = err => { + this.error(`PDF failed to be saved: ${err}`); + }; + + if (!this.pdfDocument || !this.downloadComplete) { + this.download({ + sourceEventType + }); + return; + } + + this._saveInProgress = true; + this.pdfDocument.saveDocument(this.pdfDocument.annotationStorage).then(data => { + const blob = new Blob([data], { + type: "application/pdf" + }); + downloadManager.download(blob, url, filename, sourceEventType); + }).catch(() => { + this.download({ + sourceEventType + }); + }).finally(() => { + this._saveInProgress = false; + }); + }, + + _delayedFallback(featureId) { + this.externalServices.reportTelemetry({ + type: "unsupportedFeature", + featureId + }); + + if (!this.triggerDelayedFallback) { + this.triggerDelayedFallback = () => { + this.fallback(featureId); + this.triggerDelayedFallback = null; + }; + } + }, + fallback(featureId) { + this.externalServices.reportTelemetry({ + type: "unsupportedFeature", + featureId + }); + if (this.fellback) { return; } @@ -971,7 +1047,9 @@ const PDFViewerApplication = { return; } - PDFViewerApplication.download(); + PDFViewerApplication.download({ + sourceEventType: "download" + }); }); }, @@ -1089,6 +1167,16 @@ const PDFViewerApplication = { baseDocumentUrl = null; this.pdfLinkService.setDocument(pdfDocument, baseDocumentUrl); this.pdfDocumentProperties.setDocument(pdfDocument, this.url); + const annotationStorage = pdfDocument.annotationStorage; + + annotationStorage.onSetModified = function () { + window.addEventListener("beforeunload", beforeUnload); + }; + + annotationStorage.onResetModified = function () { + window.removeEventListener("beforeunload", beforeUnload); + }; + const pdfViewer = this.pdfViewer; pdfViewer.setDocument(pdfDocument); const { @@ -1210,6 +1298,12 @@ const PDFViewerApplication = { attachments }); }); + pdfViewer.optionalContentConfigPromise.then(optionalContentConfig => { + this.pdfLayerViewer.render({ + optionalContentConfig, + pdfDocument + }); + }); }); this._initializePageLabels(pdfDocument); @@ -1237,7 +1331,9 @@ const PDFViewerApplication = { } console.warn("Warning: JavaScript is not supported"); - this.fallback(_pdfjsLib.UNSUPPORTED_FEATURES.javaScript); + + this._delayedFallback(_pdfjsLib.UNSUPPORTED_FEATURES.javaScript); + return true; }); @@ -1298,20 +1394,23 @@ const PDFViewerApplication = { this.setTitle(contentDispositionFilename); } - if (info.IsAcroFormPresent) { - console.warn("Warning: AcroForm/XFA is not supported"); - this.fallback(_pdfjsLib.UNSUPPORTED_FEATURES.forms); + if (info.IsXFAPresent && !info.IsAcroFormPresent) { + console.warn("Warning: XFA is not supported"); + + this._delayedFallback(_pdfjsLib.UNSUPPORTED_FEATURES.forms); + } else if ((info.IsAcroFormPresent || info.IsXFAPresent) && !this.pdfViewer.renderInteractiveForms) { + console.warn("Warning: Interactive form support is not enabled"); + + this._delayedFallback(_pdfjsLib.UNSUPPORTED_FEATURES.forms); } let versionId = "other"; - const KNOWN_VERSIONS = ["1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "2.0", "2.1", "2.2", "2.3"]; if (KNOWN_VERSIONS.includes(info.PDFFormatVersion)) { versionId = `v${info.PDFFormatVersion.replace(".", "_")}`; } let generatorId = "other"; - const KNOWN_GENERATORS = ["acrobat distiller", "acrobat pdfwriter", "adobe livecycle", "adobe pdf library", "adobe photoshop", "ghostscript", "tcpdf", "cairo", "dvipdfm", "dvips", "pdftex", "pdfkit", "itext", "prince", "quarkxpress", "mac os x", "microsoft", "openoffice", "oracle", "luradocument", "pdf-xchange", "antenna house", "aspose.cells", "fpdf"]; if (info.Producer) { const producer = info.Producer.toLowerCase(); @@ -1327,8 +1426,10 @@ const PDFViewerApplication = { let formType = null; - if (info.IsAcroFormPresent) { - formType = info.IsXFAPresent ? "xfa" : "acroform"; + if (info.IsXFAPresent) { + formType = "xfa"; + } else if (info.IsAcroFormPresent) { + formType = "acroform"; } this.externalServices.reportTelemetry({ @@ -1507,7 +1608,11 @@ const PDFViewerApplication = { const pagesOverview = this.pdfViewer.getPagesOverview(); const printContainer = this.appConfig.printContainer; - const printService = PDFPrintServiceFactory.instance.createPrintService(this.pdfDocument, pagesOverview, printContainer, this.l10n); + + const printResolution = _app_options.AppOptions.get("printResolution"); + + 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(); @@ -1520,6 +1625,10 @@ const PDFViewerApplication = { if (this.printService) { this.printService.destroy(); this.printService = null; + + if (this.pdfDocument) { + this.pdfDocument.annotationStorage.resetModified(); + } } this.forceRendering(); @@ -1582,6 +1691,8 @@ const PDFViewerApplication = { eventBus._on("download", webViewerDownload); + eventBus._on("save", webViewerSave); + eventBus._on("firstpage", webViewerFirstPage); eventBus._on("lastpage", webViewerLastPage); @@ -1604,6 +1715,8 @@ const PDFViewerApplication = { eventBus._on("rotateccw", webViewerRotateCcw); + eventBus._on("optionalcontentconfig", webViewerOptionalContentConfig); + eventBus._on("switchscrollmode", webViewerSwitchScrollMode); eventBus._on("scrollmodechanged", webViewerScrollModeChanged); @@ -1662,8 +1775,12 @@ const PDFViewerApplication = { window.addEventListener("wheel", webViewerWheel, { passive: false }); + window.addEventListener("touchstart", webViewerTouchStart, { + passive: false + }); window.addEventListener("click", webViewerClick); window.addEventListener("keydown", webViewerKeyDown); + window.addEventListener("keyup", webViewerKeyUp); window.addEventListener("resize", _boundEvents.windowResize); window.addEventListener("hashchange", _boundEvents.windowHashChange); window.addEventListener("beforeprint", _boundEvents.windowBeforePrint); @@ -1708,6 +1825,8 @@ const PDFViewerApplication = { eventBus._off("download", webViewerDownload); + eventBus._off("save", webViewerSave); + eventBus._off("firstpage", webViewerFirstPage); eventBus._off("lastpage", webViewerLastPage); @@ -1730,6 +1849,8 @@ const PDFViewerApplication = { eventBus._off("rotateccw", webViewerRotateCcw); + eventBus._off("optionalcontentconfig", webViewerOptionalContentConfig); + eventBus._off("switchscrollmode", webViewerSwitchScrollMode); eventBus._off("scrollmodechanged", webViewerScrollModeChanged); @@ -1764,8 +1885,12 @@ const PDFViewerApplication = { window.removeEventListener("wheel", webViewerWheel, { passive: false }); + window.removeEventListener("touchstart", webViewerTouchStart, { + passive: false + }); window.removeEventListener("click", webViewerClick); window.removeEventListener("keydown", webViewerKeyDown); + window.removeEventListener("keyup", webViewerKeyUp); window.removeEventListener("resize", _boundEvents.windowResize); window.removeEventListener("hashchange", _boundEvents.windowHashChange); window.removeEventListener("beforeprint", _boundEvents.windowBeforePrint); @@ -1774,6 +1899,17 @@ const PDFViewerApplication = { _boundEvents.windowHashChange = null; _boundEvents.windowBeforePrint = null; _boundEvents.windowAfterPrint = null; + }, + + accumulateWheelTicks(ticks) { + if (this._wheelUnusedTicks > 0 && ticks < 0 || this._wheelUnusedTicks < 0 && ticks > 0) { + this._wheelUnusedTicks = 0; + } + + this._wheelUnusedTicks += ticks; + const wholeTicks = Math.sign(this._wheelUnusedTicks) * Math.floor(Math.abs(this._wheelUnusedTicks)); + this._wheelUnusedTicks -= wholeTicks; + return wholeTicks; } }; @@ -1837,7 +1973,8 @@ function webViewerInitialized() { let file; const queryString = document.location.search.substring(1); const params = (0, _ui_utils.parseQueryString)(queryString); - file = ''; + file = "file" in params ? params.file : _app_options.AppOptions.get("defaultUrl"); + validateFileURL(file); const fileInput = document.createElement("input"); fileInput.id = appConfig.openFileInputName; fileInput.className = "fileInput"; @@ -1845,10 +1982,12 @@ function webViewerInitialized() { fileInput.oncontextmenu = _ui_utils.noContextMenuHandler; document.body.appendChild(fileInput); - appConfig.toolbar.openFile.setAttribute('hidden', 'true'); - appConfig.secondaryToolbar.openFileButton.setAttribute('hidden', 'true'); - - appConfig.toolbar.viewBookmark.setAttribute('hidden', 'true'); + if (!window.File || !window.FileReader || !window.FileList || !window.Blob) { + appConfig.toolbar.openFile.setAttribute("hidden", "true"); + appConfig.secondaryToolbar.openFileButton.setAttribute("hidden", "true"); + } else { + fileInput.value = null; + } fileInput.addEventListener("change", function (evt) { const files = evt.target.files; @@ -1910,18 +2049,8 @@ function webViewerInitialized() { } }, true); - var file_name = document.head.getAttribute('pdf_name') - var raw = atob(document.head.getAttribute('pdf_data')); - var raw_length = raw.length; - var array = new Uint8Array(new ArrayBuffer(raw_length)); - - for(var i = 0; i < raw_length; i++) { - array[i] = raw.charCodeAt(i); - } - try { - PDFViewerApplication.open(array); - PDFViewerApplication.setTitleUsingUrl(file_name); + webViewerOpenFileViaURL(file); } catch (reason) { PDFViewerApplication.l10n.get("loading_error", null, "An error occurred while loading the PDF.").then(msg => { PDFViewerApplication.error(msg, reason); @@ -2023,6 +2152,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; @@ -2036,9 +2169,7 @@ function webViewerPageMode({ } function webViewerNamedAction(evt) { - const action = evt.action; - - switch (action) { + switch (evt.action) { case "GoToPage": PDFViewerApplication.appConfig.toolbar.pageNumber.select(); break; @@ -2049,6 +2180,17 @@ function webViewerNamedAction(evt) { } break; + + case "Print": + if (PDFViewerApplication.supportsPrinting) { + webViewerPrint(); + } + + break; + + case "SaveAs": + webViewerSave(); + break; } } @@ -2156,7 +2298,7 @@ let webViewerFileInputChange, webViewerOpenFile; const file = evt.fileInput.files[0]; - if (!_app_options.AppOptions.get("disableCreateObjectURL")) { + if (!_viewer_compatibility.viewerCompatibilityParams.disableCreateObjectURL) { let url = URL.createObjectURL(file); if (file.name) { @@ -2200,8 +2342,24 @@ function webViewerPrint() { window.print(); } +function webViewerDownloadOrSave(sourceEventType) { + if (PDFViewerApplication.pdfDocument && PDFViewerApplication.pdfDocument.annotationStorage.size > 0) { + PDFViewerApplication.save({ + sourceEventType + }); + } else { + PDFViewerApplication.download({ + sourceEventType + }); + } +} + function webViewerDownload() { - PDFViewerApplication.download(); + webViewerDownloadOrSave("download"); +} + +function webViewerSave() { + webViewerDownloadOrSave("save"); } function webViewerFirstPage() { @@ -2260,6 +2418,10 @@ function webViewerRotateCcw() { PDFViewerApplication.rotatePages(-90); } +function webViewerOptionalContentConfig(evt) { + PDFViewerApplication.pdfViewer.optionalContentConfigPromise = evt.promise; +} + function webViewerSwitchScrollMode(evt) { PDFViewerApplication.pdfViewer.scrollMode = evt.mode; } @@ -2307,13 +2469,15 @@ function webViewerUpdateFindMatchesCount({ function webViewerUpdateFindControlState({ state, previous, - matchesCount + matchesCount, + rawQuery }) { if (PDFViewerApplication.supportsIntegratedFind) { PDFViewerApplication.externalServices.updateFindControlState({ result: state, findPrevious: previous, - matchesCount + matchesCount, + rawQuery }); } else { PDFViewerApplication.findBar.updateUIState(state, previous, matchesCount); @@ -2385,13 +2549,23 @@ function webViewerWheel(evt) { } const previousScale = pdfViewer.currentScale; - const delta = (0, _ui_utils.normalizeWheelEventDelta)(evt); - const MOUSE_WHEEL_DELTA_PER_PAGE_SCALE = 3.0; - const ticks = delta * MOUSE_WHEEL_DELTA_PER_PAGE_SCALE; + const delta = (0, _ui_utils.normalizeWheelEventDirection)(evt); + let ticks = 0; + + if (evt.deltaMode === WheelEvent.DOM_DELTA_LINE || evt.deltaMode === WheelEvent.DOM_DELTA_PAGE) { + if (Math.abs(delta) >= 1) { + ticks = Math.sign(delta); + } else { + ticks = PDFViewerApplication.accumulateWheelTicks(delta); + } + } else { + const PIXELS_PER_LINE_SCALE = 30; + ticks = PDFViewerApplication.accumulateWheelTicks(delta / PIXELS_PER_LINE_SCALE); + } if (ticks < 0) { PDFViewerApplication.zoomOut(-ticks); - } else { + } else if (ticks > 0) { PDFViewerApplication.zoomIn(ticks); } @@ -2410,7 +2584,17 @@ function webViewerWheel(evt) { } } +function webViewerTouchStart(evt) { + if (evt.touches.length > 1) { + evt.preventDefault(); + } +} + function webViewerClick(evt) { + if (PDFViewerApplication.triggerDelayedFallback && PDFViewerApplication.pdfViewer.containsElement(evt.target)) { + PDFViewerApplication.triggerDelayedFallback(); + } + if (!PDFViewerApplication.secondaryToolbar.isOpen) { return; } @@ -2422,6 +2606,14 @@ function webViewerClick(evt) { } } +function webViewerKeyUp(evt) { + if (evt.keyCode === 9) { + if (PDFViewerApplication.triggerDelayedFallback) { + PDFViewerApplication.triggerDelayedFallback(); + } + } +} + function webViewerKeyDown(evt) { if (PDFViewerApplication.overlayManager.active) { return; @@ -2730,6 +2922,12 @@ function webViewerKeyDown(evt) { } } +function beforeUnload(evt) { + evt.preventDefault(); + evt.returnValue = ""; + return false; +} + function apiPageLayoutToSpreadMode(layout) { switch (layout) { case "SinglePage": @@ -2763,6 +2961,7 @@ function apiPageModeToSidebarView(mode) { return _pdf_sidebar.SidebarView.ATTACHMENTS; case "UseOC": + return _pdf_sidebar.SidebarView.LAYERS; } return _pdf_sidebar.SidebarView.NONE; @@ -2807,6 +3006,7 @@ exports.getOutputScale = getOutputScale; exports.scrollIntoView = scrollIntoView; exports.watchScroll = watchScroll; exports.binarySearchFirstItem = binarySearchFirstItem; +exports.normalizeWheelEventDirection = normalizeWheelEventDirection; exports.normalizeWheelEventDelta = normalizeWheelEventDelta; exports.waitOnEventOrTimeout = waitOnEventOrTimeout; exports.moveToEndOfArray = moveToEndOfArray; @@ -3244,7 +3444,7 @@ function getPDFFileNameFromURL(url, defaultFilename = "document.pdf") { return suggestedFilename || defaultFilename; } -function normalizeWheelEventDelta(evt) { +function normalizeWheelEventDirection(evt) { let delta = Math.sqrt(evt.deltaX * evt.deltaX + evt.deltaY * evt.deltaY); const angle = Math.atan2(evt.deltaY, evt.deltaX); @@ -3252,6 +3452,11 @@ function normalizeWheelEventDelta(evt) { delta = -delta; } + return delta; +} + +function normalizeWheelEventDelta(evt) { + let delta = normalizeWheelEventDirection(evt); const MOUSE_DOM_DELTA_PIXEL_MODE = 0; const MOUSE_DOM_DELTA_LINE_MODE = 1; const MOUSE_PIXELS_PER_LINE = 30; @@ -3549,11 +3754,6 @@ const defaultOptions = { value: "", kind: OptionKind.VIEWER + OptionKind.PREFERENCE }, - disableCreateObjectURL: { - value: false, - compatibility: _viewer_compatibility.viewerCompatibilityParams.disableCreateObjectURL, - kind: OptionKind.VIEWER - }, disableHistory: { value: false, kind: OptionKind.VIEWER @@ -3612,7 +3812,7 @@ const defaultOptions = { kind: OptionKind.VIEWER + OptionKind.PREFERENCE }, renderInteractiveForms: { - value: false, + value: true, kind: OptionKind.VIEWER + OptionKind.PREFERENCE }, sidebarViewOnLoad: { @@ -4298,9 +4498,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; @@ -4316,6 +4518,7 @@ class PDFSidebar { this.switchView(SidebarView.THUMBS); this.outlineButton.disabled = false; this.attachmentsButton.disabled = false; + this.layersButton.disabled = false; } get visibleView() { @@ -4334,6 +4537,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; @@ -4390,6 +4597,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; @@ -4399,9 +4613,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(); @@ -4506,7 +4722,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; }); @@ -4524,6 +4740,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; } } @@ -4541,6 +4761,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; } }; @@ -4587,38 +4811,35 @@ 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 + }); + }); - this.eventBus._on("outlineloaded", evt => { - const outlineCount = evt.outlineCount; - this.outlineButton.disabled = !outlineCount; + const onTreeLoaded = (count, button, view) => { + button.disabled = !count; - if (outlineCount) { - this._showUINotification(SidebarView.OUTLINE); - } else if (this.active === SidebarView.OUTLINE) { + if (count) { + this._showUINotification(view); + } else if (this.active === view) { this.switchView(SidebarView.THUMBS); } + }; + + this.eventBus._on("outlineloaded", evt => { + onTreeLoaded(evt.outlineCount, this.outlineButton, SidebarView.OUTLINE); }); this.eventBus._on("attachmentsloaded", evt => { - if (evt.attachmentsCount) { - this.attachmentsButton.disabled = false; - - this._showUINotification(SidebarView.ATTACHMENTS); - - return; - } - - Promise.resolve().then(() => { - if (this.attachmentsView.hasChildNodes()) { - return; - } - - this.attachmentsButton.disabled = true; + onTreeLoaded(evt.attachmentsCount, this.attachmentsButton, SidebarView.ATTACHMENTS); + }); - if (this.active === SidebarView.ATTACHMENTS) { - this.switchView(SidebarView.THUMBS); - } - }); + this.eventBus._on("layersloaded", evt => { + onTreeLoaded(evt.layersCount, this.layersButton, SidebarView.LAYERS); }); this.eventBus._on("presentationmodechanged", evt => { @@ -4836,42 +5057,67 @@ exports.PDFAttachmentViewer = void 0; var _pdfjsLib = __webpack_require__(5); -class PDFAttachmentViewer { - constructor({ - container, - eventBus, - downloadManager - }) { - this.container = container; - this.eventBus = eventBus; - this.downloadManager = downloadManager; - this.reset(); +var _base_tree_viewer = __webpack_require__(13); + +var _viewer_compatibility = __webpack_require__(4); + +const PdfFileRegExp = /\.pdf$/i; + +class PDFAttachmentViewer extends _base_tree_viewer.BaseTreeViewer { + constructor(options) { + super(options); + this.downloadManager = options.downloadManager; this.eventBus._on("fileattachmentannotation", this._appendAttachment.bind(this)); } reset(keepRenderedCapability = false) { - this.attachments = null; - this.container.textContent = ""; + super.reset(); + this._attachments = null; if (!keepRenderedCapability) { this._renderedCapability = (0, _pdfjsLib.createPromiseCapability)(); } + + if (this._pendingDispatchEvent) { + clearTimeout(this._pendingDispatchEvent); + } + + this._pendingDispatchEvent = null; } _dispatchEvent(attachmentsCount) { this._renderedCapability.resolve(); + if (this._pendingDispatchEvent) { + clearTimeout(this._pendingDispatchEvent); + this._pendingDispatchEvent = null; + } + + if (attachmentsCount === 0) { + this._pendingDispatchEvent = setTimeout(() => { + this.eventBus.dispatch("attachmentsloaded", { + source: this, + attachmentsCount: 0 + }); + this._pendingDispatchEvent = null; + }); + return; + } + this.eventBus.dispatch("attachmentsloaded", { source: this, attachmentsCount }); } - _bindPdfLink(button, content, filename) { + _bindPdfLink(element, { + content, + filename + }) { let blobUrl; - button.onclick = () => { + element.onclick = () => { if (!blobUrl) { blobUrl = URL.createObjectURL(new Blob([content], { type: "application/pdf" @@ -4894,9 +5140,13 @@ class PDFAttachmentViewer { }; } - _bindLink(button, content, filename) { - button.onclick = () => { - this.downloadManager.downloadData(content, filename, ""); + _bindLink(element, { + content, + filename + }) { + element.onclick = () => { + const contentType = PdfFileRegExp.test(filename) ? "application/pdf" : ""; + this.downloadManager.downloadData(content, filename, contentType); return false; }; } @@ -4905,16 +5155,14 @@ class PDFAttachmentViewer { attachments, keepRenderedCapability = false }) { - let attachmentsCount = 0; - - if (this.attachments) { - this.reset(keepRenderedCapability === true); + if (this._attachments) { + this.reset(keepRenderedCapability); } - this.attachments = attachments || null; + this._attachments = attachments || null; if (!attachments) { - this._dispatchEvent(attachmentsCount); + this._dispatchEvent(0); return; } @@ -4922,26 +5170,36 @@ class PDFAttachmentViewer { const names = Object.keys(attachments).sort(function (a, b) { return a.toLowerCase().localeCompare(b.toLowerCase()); }); - attachmentsCount = names.length; + const fragment = document.createDocumentFragment(); + let attachmentsCount = 0; - for (let i = 0; i < attachmentsCount; i++) { - const item = attachments[names[i]]; - const filename = (0, _pdfjsLib.removeNullCharacters)((0, _pdfjsLib.getFilenameFromUrl)(item.filename)); + for (const name of names) { + const item = attachments[name]; + const filename = (0, _pdfjsLib.getFilenameFromUrl)(item.filename); const div = document.createElement("div"); - div.className = "attachmentsItem"; - const button = document.createElement("button"); - button.textContent = filename; + div.className = "treeItem"; + const element = document.createElement("a"); - if (/\.pdf$/i.test(filename) && !this.downloadManager.disableCreateObjectURL) { - this._bindPdfLink(button, item.content, filename); + if (PdfFileRegExp.test(filename) && !_viewer_compatibility.viewerCompatibilityParams.disableCreateObjectURL) { + this._bindPdfLink(element, { + content: item.content, + filename + }); } else { - this._bindLink(button, item.content, filename); + this._bindLink(element, { + content: item.content, + filename + }); } - div.appendChild(button); - this.container.appendChild(div); + element.textContent = this._normalizeTextContent(filename); + div.appendChild(element); + fragment.appendChild(div); + attachmentsCount++; } + this.container.appendChild(fragment); + this._dispatchEvent(attachmentsCount); } @@ -4950,8 +5208,13 @@ class PDFAttachmentViewer { filename, content }) { - this._renderedCapability.promise.then(() => { - let attachments = this.attachments; + const renderedPromise = this._renderedCapability.promise; + renderedPromise.then(() => { + if (renderedPromise !== this._renderedCapability.promise) { + return; + } + + let attachments = this._attachments; if (!attachments) { attachments = Object.create(null); @@ -4988,6 +5251,91 @@ exports.PDFAttachmentViewer = PDFAttachmentViewer; Object.defineProperty(exports, "__esModule", { value: true }); +exports.BaseTreeViewer = void 0; + +var _pdfjsLib = __webpack_require__(5); + +class BaseTreeViewer { + constructor(options) { + if (this.constructor === BaseTreeViewer) { + throw new Error("Cannot initialize BaseTreeViewer."); + } + + this.container = options.container; + this.eventBus = options.eventBus; + this.reset(); + } + + reset() { + this._lastToggleIsShow = true; + this.container.textContent = ""; + this.container.classList.remove("treeWithDeepNesting"); + } + + _dispatchEvent(count) { + throw new Error("Not implemented: _dispatchEvent"); + } + + _bindLink(element, params) { + throw new Error("Not implemented: _bindLink"); + } + + _normalizeTextContent(str) { + return (0, _pdfjsLib.removeNullCharacters)(str) || "\u2013"; + } + + _addToggleButton(div, hidden = false) { + const toggler = document.createElement("div"); + toggler.className = "treeItemToggler"; + + if (hidden) { + toggler.classList.add("treeItemsHidden"); + } + + toggler.onclick = evt => { + evt.stopPropagation(); + toggler.classList.toggle("treeItemsHidden"); + + if (evt.shiftKey) { + const shouldShowAll = !toggler.classList.contains("treeItemsHidden"); + + this._toggleTreeItem(div, shouldShowAll); + } + }; + + div.insertBefore(toggler, div.firstChild); + } + + _toggleTreeItem(root, show = false) { + this._lastToggleIsShow = show; + + for (const toggler of root.querySelectorAll(".treeItemToggler")) { + toggler.classList.toggle("treeItemsHidden", !show); + } + } + + _toggleAllTreeItems() { + this._toggleTreeItem(this.container, !this._lastToggleIsShow); + } + + render(params) { + throw new Error("Not implemented: render"); + } + +} + +exports.BaseTreeViewer = BaseTreeViewer; + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); exports.PDFDocumentProperties = void 0; var _pdfjsLib = __webpack_require__(5); @@ -5274,7 +5622,7 @@ class PDFDocumentProperties { exports.PDFDocumentProperties = PDFDocumentProperties; /***/ }), -/* 14 */ +/* 15 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5285,7 +5633,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.PDFFindBar = void 0; -var _pdf_find_controller = __webpack_require__(15); +var _pdf_find_controller = __webpack_require__(16); var _ui_utils = __webpack_require__(2); @@ -5485,7 +5833,7 @@ class PDFFindBar { exports.PDFFindBar = PDFFindBar; /***/ }), -/* 15 */ +/* 16 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5498,7 +5846,7 @@ exports.PDFFindController = exports.FindState = void 0; var _pdfjsLib = __webpack_require__(5); -var _pdf_find_utils = __webpack_require__(16); +var _pdf_find_utils = __webpack_require__(17); var _ui_utils = __webpack_require__(2); @@ -6157,7 +6505,8 @@ class PDFFindController { source: this, state, previous, - matchesCount: this._requestMatchesCount() + matchesCount: this._requestMatchesCount(), + rawQuery: this._state ? this._state.query : null }); } @@ -6166,7 +6515,7 @@ class PDFFindController { exports.PDFFindController = PDFFindController; /***/ }), -/* 16 */ +/* 17 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6262,7 +6611,7 @@ function getCharacterType(charCode) { } /***/ }), -/* 17 */ +/* 18 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6528,8 +6877,6 @@ class PDFHistory { } } - // FIXME: This currently breaks Epiphany due to rewriting history with baseUrl - return; if (shouldReplace) { window.history.replaceState(newState, "", newUrl); } else { @@ -6852,7 +7199,200 @@ function isDestArraysEqual(firstDest, secondDest) { } /***/ }), -/* 18 */ +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +"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"; @@ -7291,7 +7831,7 @@ class SimpleLinkService { exports.SimpleLinkService = SimpleLinkService; /***/ }), -/* 19 */ +/* 21 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7304,27 +7844,19 @@ exports.PDFOutlineViewer = void 0; var _pdfjsLib = __webpack_require__(5); -const DEFAULT_TITLE = "\u2013"; +var _base_tree_viewer = __webpack_require__(13); -class PDFOutlineViewer { - constructor({ - container, - linkService, - eventBus - }) { - this.container = container; - this.linkService = linkService; - this.eventBus = eventBus; - this.reset(); +class PDFOutlineViewer extends _base_tree_viewer.BaseTreeViewer { + constructor(options) { + super(options); + this.linkService = options.linkService; - eventBus._on("toggleoutlinetree", this.toggleOutlineTree.bind(this)); + this.eventBus._on("toggleoutlinetree", this._toggleAllTreeItems.bind(this)); } reset() { - this.outline = null; - this.lastToggleIsShow = true; - this.container.textContent = ""; - this.container.classList.remove("outlineWithDeepNesting"); + super.reset(); + this._outline = null; } _dispatchEvent(outlineCount) { @@ -7381,56 +7913,30 @@ class PDFOutlineViewer { count, items }) { - const toggler = document.createElement("div"); - toggler.className = "outlineItemToggler"; - - if (count < 0 && Math.abs(count) === items.length) { - toggler.classList.add("outlineItemsHidden"); - } - - toggler.onclick = evt => { - evt.stopPropagation(); - toggler.classList.toggle("outlineItemsHidden"); - - if (evt.shiftKey) { - const shouldShowAll = !toggler.classList.contains("outlineItemsHidden"); + const hidden = count < 0 && Math.abs(count) === items.length; - this._toggleOutlineItem(div, shouldShowAll); - } - }; - - div.insertBefore(toggler, div.firstChild); - } - - _toggleOutlineItem(root, show = false) { - this.lastToggleIsShow = show; - - for (const toggler of root.querySelectorAll(".outlineItemToggler")) { - toggler.classList.toggle("outlineItemsHidden", !show); - } + super._addToggleButton(div, hidden); } - toggleOutlineTree() { - if (!this.outline) { + _toggleAllTreeItems() { + if (!this._outline) { return; } - this._toggleOutlineItem(this.container, !this.lastToggleIsShow); + super._toggleAllTreeItems(); } render({ outline }) { - let outlineCount = 0; - - if (this.outline) { + if (this._outline) { this.reset(); } - this.outline = outline || null; + this._outline = outline || null; if (!outline) { - this._dispatchEvent(outlineCount); + this._dispatchEvent(0); return; } @@ -7438,23 +7944,24 @@ class PDFOutlineViewer { const fragment = document.createDocumentFragment(); const queue = [{ parent: fragment, - items: this.outline + items: outline }]; - let hasAnyNesting = false; + let outlineCount = 0, + hasAnyNesting = false; while (queue.length > 0) { const levelData = queue.shift(); for (const item of levelData.items) { const div = document.createElement("div"); - div.className = "outlineItem"; + div.className = "treeItem"; const element = document.createElement("a"); this._bindLink(element, item); this._setStyles(element, item); - element.textContent = (0, _pdfjsLib.removeNullCharacters)(item.title) || DEFAULT_TITLE; + element.textContent = this._normalizeTextContent(item.title); div.appendChild(element); if (item.items.length > 0) { @@ -7463,7 +7970,7 @@ class PDFOutlineViewer { this._addToggleButton(div, item); const itemsDiv = document.createElement("div"); - itemsDiv.className = "outlineItems"; + itemsDiv.className = "treeItems"; div.appendChild(itemsDiv); queue.push({ parent: itemsDiv, @@ -7477,8 +7984,8 @@ class PDFOutlineViewer { } if (hasAnyNesting) { - this.container.classList.add("outlineWithDeepNesting"); - this.lastToggleIsShow = fragment.querySelectorAll(".outlineItemsHidden").length === 0; + this.container.classList.add("treeWithDeepNesting"); + this._lastToggleIsShow = fragment.querySelectorAll(".treeItemsHidden").length === 0; } this.container.appendChild(fragment); @@ -7491,7 +7998,7 @@ class PDFOutlineViewer { exports.PDFOutlineViewer = PDFOutlineViewer; /***/ }), -/* 20 */ +/* 22 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7900,7 +8407,7 @@ class PDFPresentationMode { exports.PDFPresentationMode = PDFPresentationMode; /***/ }), -/* 21 */ +/* 23 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8049,7 +8556,7 @@ class PDFSidebarResizer { exports.PDFSidebarResizer = PDFSidebarResizer; /***/ }), -/* 22 */ +/* 24 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8062,7 +8569,7 @@ exports.PDFThumbnailViewer = void 0; var _ui_utils = __webpack_require__(2); -var _pdf_thumbnail_view = __webpack_require__(23); +var _pdf_thumbnail_view = __webpack_require__(25); const THUMBNAIL_SCROLL_MARGIN = -19; const THUMBNAIL_SELECTED_CLASS = "selected"; @@ -8070,6 +8577,7 @@ const THUMBNAIL_SELECTED_CLASS = "selected"; class PDFThumbnailViewer { constructor({ container, + eventBus, linkService, renderingQueue, l10n = _ui_utils.NullL10n @@ -8081,6 +8589,10 @@ class PDFThumbnailViewer { this.scroll = (0, _ui_utils.watchScroll)(this.container, this._scrollUpdated.bind(this)); this._resetView(); + + eventBus._on("optionalcontentconfigchanged", () => { + this._setImageDisabled = true; + }); } _scrollUpdated() { @@ -8178,7 +8690,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 = ""; } @@ -8195,19 +8709,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 }); @@ -8306,7 +8829,7 @@ class PDFThumbnailViewer { exports.PDFThumbnailViewer = PDFThumbnailViewer; /***/ }), -/* 23 */ +/* 25 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8370,8 +8893,10 @@ class PDFThumbnailView { container, id, defaultViewport, + optionalContentConfigPromise, linkService, renderingQueue, + checkSetImageDisabled, disableCanvasToImageConversion = false, l10n = _ui_utils.NullL10n }) { @@ -8382,11 +8907,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; @@ -8611,7 +9142,8 @@ class PDFThumbnailView { const renderContext = { canvasContext: ctx, - viewport: drawViewport + viewport: drawViewport, + optionalContentConfigPromise: this._optionalContentConfigPromise }; const renderTask = this.renderTask = pdfPage.render(renderContext); renderTask.onContinue = renderContinueCallback; @@ -8624,6 +9156,10 @@ class PDFThumbnailView { } setImage(pageView) { + if (this._checkSetImageDisabled()) { + return; + } + if (this.renderingState !== _pdf_rendering_queue.RenderingStates.INITIAL) { return; } @@ -8676,14 +9212,18 @@ class PDFThumbnailView { } get _thumbPageTitle() { + var _this$pageLabel; + return this.l10n.get("thumb_page_title", { - page: this.pageLabel !== null ? this.pageLabel : this.id + page: (_this$pageLabel = this.pageLabel) != null ? _this$pageLabel : this.id }, "Page {{page}}"); } get _thumbPageCanvas() { + var _this$pageLabel2; + return this.l10n.get("thumb_page_canvas", { - page: this.pageLabel !== null ? this.pageLabel : this.id + page: (_this$pageLabel2 = this.pageLabel) != null ? _this$pageLabel2 : this.id }, "Thumbnail of Page {{page}}"); } @@ -8716,7 +9256,7 @@ class PDFThumbnailView { exports.PDFThumbnailView = PDFThumbnailView; /***/ }), -/* 24 */ +/* 26 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8727,7 +9267,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.PDFViewer = void 0; -var _base_viewer = __webpack_require__(25); +var _base_viewer = __webpack_require__(27); var _pdfjsLib = __webpack_require__(5); @@ -8803,7 +9343,7 @@ class PDFViewer extends _base_viewer.BaseViewer { exports.PDFViewer = PDFViewer; /***/ }), -/* 25 */ +/* 27 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8818,15 +9358,15 @@ var _ui_utils = __webpack_require__(2); var _pdf_rendering_queue = __webpack_require__(8); -var _annotation_layer_builder = __webpack_require__(26); +var _annotation_layer_builder = __webpack_require__(28); var _pdfjsLib = __webpack_require__(5); -var _pdf_page_view = __webpack_require__(27); +var _pdf_page_view = __webpack_require__(29); -var _pdf_link_service = __webpack_require__(18); +var _pdf_link_service = __webpack_require__(20); -var _text_layer_builder = __webpack_require__(28); +var _text_layer_builder = __webpack_require__(30); const DEFAULT_CACHE_SIZE = 10; @@ -8889,6 +9429,11 @@ class BaseViewer { this._name = this.constructor.name; this.container = options.container; this.viewer = options.viewer || options.container.firstElementChild; + + if (!(this.container instanceof HTMLDivElement && this.viewer instanceof HTMLDivElement)) { + throw new Error("Invalid `container` and/or `viewer` option."); + } + this.eventBus = options.eventBus; this.linkService = options.linkService || new _pdf_link_service.SimpleLinkService(); this.downloadManager = options.downloadManager || null; @@ -8896,7 +9441,7 @@ class BaseViewer { this.removePageBorders = options.removePageBorders || false; this.textLayerMode = Number.isInteger(options.textLayerMode) ? options.textLayerMode : _ui_utils.TextLayerMode.ENABLE; this.imageResourcesPath = options.imageResourcesPath || ""; - this.renderInteractiveForms = options.renderInteractiveForms || false; + this.renderInteractiveForms = typeof options.renderInteractiveForms === "boolean" ? options.renderInteractiveForms : true; this.enablePrintAutoRotate = options.enablePrintAutoRotate || false; this.renderer = options.renderer || _ui_utils.RendererType.CANVAS; this.enableWebGL = options.enableWebGL || false; @@ -9127,6 +9672,8 @@ 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", { @@ -9164,6 +9711,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 @@ -9177,6 +9725,8 @@ class BaseViewer { id: pageNum, scale, defaultViewport: viewport.clone(), + annotationStorage, + optionalContentConfigPromise, renderingQueue: this.renderingQueue, textLayerFactory, textLayerMode: this.textLayerMode, @@ -9288,6 +9838,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)(); @@ -9759,10 +10310,11 @@ class BaseViewer { }); } - createAnnotationLayerBuilder(pageDiv, pdfPage, imageResourcesPath = "", renderInteractiveForms = false, l10n = _ui_utils.NullL10n) { + createAnnotationLayerBuilder(pageDiv, pdfPage, annotationStorage = null, imageResourcesPath = "", renderInteractiveForms = false, l10n = _ui_utils.NullL10n) { return new _annotation_layer_builder.AnnotationLayerBuilder({ pageDiv, pdfPage, + annotationStorage, imageResourcesPath, renderInteractiveForms, linkService: this.linkService, @@ -9801,9 +10353,8 @@ class BaseViewer { return pagesOverview; } - const isFirstPagePortrait = (0, _ui_utils.isPortraitOrientation)(pagesOverview[0]); return pagesOverview.map(function (size) { - if (isFirstPagePortrait === (0, _ui_utils.isPortraitOrientation)(size)) { + if ((0, _ui_utils.isPortraitOrientation)(size)) { return size; } @@ -9815,6 +10366,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; } @@ -9923,7 +10512,7 @@ class BaseViewer { exports.BaseViewer = BaseViewer; /***/ }), -/* 26 */ +/* 28 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -9938,7 +10527,7 @@ var _pdfjsLib = __webpack_require__(5); var _ui_utils = __webpack_require__(2); -var _pdf_link_service = __webpack_require__(18); +var _pdf_link_service = __webpack_require__(20); class AnnotationLayerBuilder { constructor({ @@ -9946,8 +10535,9 @@ class AnnotationLayerBuilder { pdfPage, linkService, downloadManager, + annotationStorage = null, imageResourcesPath = "", - renderInteractiveForms = false, + renderInteractiveForms = true, l10n = _ui_utils.NullL10n }) { this.pageDiv = pageDiv; @@ -9957,18 +10547,23 @@ class AnnotationLayerBuilder { this.imageResourcesPath = imageResourcesPath; this.renderInteractiveForms = renderInteractiveForms; this.l10n = l10n; + this.annotationStorage = annotationStorage; this.div = null; this._cancelled = false; } render(viewport, intent = "display") { - this.pdfPage.getAnnotations({ + return this.pdfPage.getAnnotations({ intent }).then(annotations => { if (this._cancelled) { return; } + if (annotations.length === 0) { + return; + } + const parameters = { viewport: viewport.clone({ dontFlip: true @@ -9979,16 +10574,13 @@ class AnnotationLayerBuilder { imageResourcesPath: this.imageResourcesPath, renderInteractiveForms: this.renderInteractiveForms, linkService: this.linkService, - downloadManager: this.downloadManager + downloadManager: this.downloadManager, + annotationStorage: this.annotationStorage }; if (this.div) { _pdfjsLib.AnnotationLayer.update(parameters); } else { - if (annotations.length === 0) { - return; - } - this.div = document.createElement("div"); this.div.className = "annotationLayer"; this.pageDiv.appendChild(this.div); @@ -10018,14 +10610,15 @@ class AnnotationLayerBuilder { exports.AnnotationLayerBuilder = AnnotationLayerBuilder; class DefaultAnnotationLayerFactory { - createAnnotationLayerBuilder(pageDiv, pdfPage, imageResourcesPath = "", renderInteractiveForms = false, l10n = _ui_utils.NullL10n) { + createAnnotationLayerBuilder(pageDiv, pdfPage, annotationStorage = null, imageResourcesPath = "", renderInteractiveForms = true, l10n = _ui_utils.NullL10n) { return new AnnotationLayerBuilder({ pageDiv, pdfPage, imageResourcesPath, renderInteractiveForms, linkService: new _pdf_link_service.SimpleLinkService(), - l10n + l10n, + annotationStorage }); } @@ -10034,7 +10627,7 @@ class DefaultAnnotationLayerFactory { exports.DefaultAnnotationLayerFactory = DefaultAnnotationLayerFactory; /***/ }), -/* 27 */ +/* 29 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -10067,10 +10660,12 @@ class PDFPageView { this.scale = options.scale || _ui_utils.DEFAULT_SCALE; this.viewport = defaultViewport; 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 || ""; - this.renderInteractiveForms = options.renderInteractiveForms || false; + this.renderInteractiveForms = typeof options.renderInteractiveForms === "boolean" ? options.renderInteractiveForms : true; this.useOnlyCssZoom = options.useOnlyCssZoom || false; this.maxCanvasPixels = options.maxCanvasPixels || MAX_CANVAS_PIXELS; this.eventBus = options.eventBus; @@ -10117,6 +10712,22 @@ class PDFPageView { } } + async _renderAnnotationLayer() { + let error = null; + + try { + await this.annotationLayer.render(this.viewport, "display"); + } catch (ex) { + error = ex; + } finally { + this.eventBus.dispatch("annotationlayerrendered", { + source: this, + pageNumber: this.id, + error + }); + } + } + _resetZoomLayer(removeFromDOM = false) { if (!this.zoomLayer) { return; @@ -10184,13 +10795,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, @@ -10324,7 +10939,7 @@ class PDFPageView { } if (redrawAnnotations && this.annotationLayer) { - this.annotationLayer.render(this.viewport, "display"); + this._renderAnnotationLayer(); } } @@ -10463,10 +11078,10 @@ class PDFPageView { if (this.annotationLayerFactory) { if (!this.annotationLayer) { - this.annotationLayer = this.annotationLayerFactory.createAnnotationLayerBuilder(div, pdfPage, this.imageResourcesPath, this.renderInteractiveForms, this.l10n); + this.annotationLayer = this.annotationLayerFactory.createAnnotationLayerBuilder(div, pdfPage, this._annotationStorage, this.imageResourcesPath, this.renderInteractiveForms, this.l10n); } - this.annotationLayer.render(this.viewport, "display"); + this._renderAnnotationLayer(); } div.setAttribute("data-loaded", true); @@ -10553,7 +11168,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); @@ -10632,7 +11248,7 @@ class PDFPageView { exports.PDFPageView = PDFPageView; /***/ }), -/* 28 */ +/* 30 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -11016,7 +11632,7 @@ class DefaultTextLayerFactory { exports.DefaultTextLayerFactory = DefaultTextLayerFactory; /***/ }), -/* 29 */ +/* 31 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -11031,7 +11647,7 @@ var _ui_utils = __webpack_require__(2); var _pdf_cursor_tools = __webpack_require__(6); -var _pdf_single_page_viewer = __webpack_require__(30); +var _pdf_single_page_viewer = __webpack_require__(32); class SecondaryToolbar { constructor(options, mainContainer, eventBus) { @@ -11334,7 +11950,7 @@ class SecondaryToolbar { exports.SecondaryToolbar = SecondaryToolbar; /***/ }), -/* 30 */ +/* 32 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -11345,7 +11961,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.PDFSinglePageViewer = void 0; -var _base_viewer = __webpack_require__(25); +var _base_viewer = __webpack_require__(27); var _pdfjsLib = __webpack_require__(5); @@ -11456,7 +12072,7 @@ class PDFSinglePageViewer extends _base_viewer.BaseViewer { exports.PDFSinglePageViewer = PDFSinglePageViewer; /***/ }), -/* 31 */ +/* 33 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -11709,7 +12325,7 @@ class Toolbar { } const overflow = SCALE_SELECT_WIDTH - SCALE_SELECT_CONTAINER_WIDTH; - maxWidth += 1.5 * overflow; + maxWidth += 2 * overflow; if (maxWidth > SCALE_SELECT_CONTAINER_WIDTH) { items.scaleSelect.style.width = `${maxWidth + overflow}px`; @@ -11726,7 +12342,7 @@ class Toolbar { exports.Toolbar = Toolbar; /***/ }), -/* 32 */ +/* 34 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -11822,7 +12438,7 @@ class ViewHistory { exports.ViewHistory = ViewHistory; /***/ }), -/* 33 */ +/* 35 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -11835,11 +12451,11 @@ exports.GenericCom = void 0; var _app = __webpack_require__(1); -var _preferences = __webpack_require__(34); +var _preferences = __webpack_require__(36); -var _download_manager = __webpack_require__(35); +var _download_manager = __webpack_require__(37); -var _genericl10n = __webpack_require__(36); +var _genericl10n = __webpack_require__(38); ; const GenericCom = {}; @@ -11876,7 +12492,7 @@ class GenericExternalServices extends _app.DefaultExternalServices { _app.PDFViewerApplication.externalServices = GenericExternalServices; /***/ }), -/* 34 */ +/* 36 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -11905,7 +12521,7 @@ function getDefaultPreferences() { "ignoreDestinationZoom": false, "pdfBugEnabled": false, "renderer": "canvas", - "renderInteractiveForms": false, + "renderInteractiveForms": true, "sidebarViewOnLoad": -1, "scrollModeOnLoad": -1, "spreadModeOnLoad": -1, @@ -12026,7 +12642,7 @@ class BasePreferences { exports.BasePreferences = BasePreferences; /***/ }), -/* 35 */ +/* 37 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12042,7 +12658,6 @@ var _pdfjsLib = __webpack_require__(5); var _viewer_compatibility = __webpack_require__(4); ; -const DISABLE_CREATE_OBJECT_URL = _viewer_compatibility.viewerCompatibilityParams.disableCreateObjectURL || false; function download(blobUrl, filename) { const a = document.createElement("a"); @@ -12064,12 +12679,6 @@ function download(blobUrl, filename) { } class DownloadManager { - constructor({ - disableCreateObjectURL = DISABLE_CREATE_OBJECT_URL - }) { - this.disableCreateObjectURL = disableCreateObjectURL; - } - downloadUrl(url, filename) { if (!(0, _pdfjsLib.createValidAbsoluteUrl)(url, "http://example.com")) { return; @@ -12086,11 +12695,11 @@ class DownloadManager { return; } - const blobUrl = (0, _pdfjsLib.createObjectURL)(data, contentType, this.disableCreateObjectURL); + const blobUrl = (0, _pdfjsLib.createObjectURL)(data, contentType, _viewer_compatibility.viewerCompatibilityParams.disableCreateObjectURL); download(blobUrl, filename); } - download(blob, url, filename) { + download(blob, url, filename, sourceEventType = "download") { if (navigator.msSaveBlob) { if (!navigator.msSaveBlob(blob, filename)) { this.downloadUrl(url, filename); @@ -12099,7 +12708,7 @@ class DownloadManager { return; } - if (this.disableCreateObjectURL) { + if (_viewer_compatibility.viewerCompatibilityParams.disableCreateObjectURL) { this.downloadUrl(url, filename); return; } @@ -12113,7 +12722,7 @@ class DownloadManager { exports.DownloadManager = DownloadManager; /***/ }), -/* 36 */ +/* 38 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12124,7 +12733,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.GenericL10n = void 0; -__webpack_require__(37); +__webpack_require__(39); const webL10n = document.webL10n; @@ -12163,7 +12772,7 @@ class GenericL10n { exports.GenericL10n = GenericL10n; /***/ }), -/* 37 */ +/* 39 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12986,7 +13595,7 @@ document.webL10n = function (window, document, undefined) { }(window, document); /***/ }), -/* 38 */ +/* 40 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -13001,15 +13610,14 @@ var _ui_utils = __webpack_require__(2); var _app = __webpack_require__(1); -var _app_options = __webpack_require__(3); +var _viewer_compatibility = __webpack_require__(4); let activeService = null; let overlayManager = null; -function renderPage(activeServiceOnEntry, pdfDocument, pageNumber, size) { +function renderPage(activeServiceOnEntry, pdfDocument, pageNumber, size, printResolution, optionalContentConfigPromise) { const scratchCanvas = activeService.scratchCanvas; - const PRINT_RESOLUTION = _app_options.AppOptions.get("printResolution") || 150; - const PRINT_UNITS = PRINT_RESOLUTION / 72.0; + const PRINT_UNITS = printResolution / 72.0; scratchCanvas.width = Math.floor(size.width * PRINT_UNITS); scratchCanvas.height = Math.floor(size.height * PRINT_UNITS); const width = Math.floor(size.width * _ui_utils.CSS_UNITS) + "px"; @@ -13027,7 +13635,9 @@ function renderPage(activeServiceOnEntry, pdfDocument, pageNumber, size) { scale: 1, rotation: size.rotation }), - intent: "print" + intent: "print", + annotationStorage: pdfDocument.annotationStorage, + optionalContentConfigPromise }; return pdfPage.render(renderContext).promise; }).then(function () { @@ -13038,12 +13648,13 @@ function renderPage(activeServiceOnEntry, pdfDocument, pageNumber, size) { }); } -function PDFPrintService(pdfDocument, pagesOverview, printContainer, l10n) { +function PDFPrintService(pdfDocument, pagesOverview, printContainer, printResolution, optionalContentConfigPromise = null, l10n) { this.pdfDocument = pdfDocument; this.pagesOverview = pagesOverview; this.printContainer = printContainer; + this._printResolution = printResolution || 150; + this._optionalContentConfigPromise = optionalContentConfigPromise || pdfDocument.getOptionalContentConfig(); this.l10n = l10n || _ui_utils.NullL10n; - this.disableCreateObjectURL = _app_options.AppOptions.get("disableCreateObjectURL"); this.currentPage = -1; this.scratchCanvas = document.createElement("canvas"); } @@ -13107,7 +13718,7 @@ PDFPrintService.prototype = { const index = this.currentPage; renderProgress(index, pageCount, this.l10n); - renderPage(this, this.pdfDocument, index + 1, this.pagesOverview[index]).then(this.useRenderedPage.bind(this)).then(function () { + renderPage(this, this.pdfDocument, index + 1, this.pagesOverview[index], this._printResolution, this._optionalContentConfigPromise).then(this.useRenderedPage.bind(this)).then(function () { renderNextPage(resolve, reject); }, reject); }; @@ -13122,7 +13733,7 @@ PDFPrintService.prototype = { img.style.height = printItem.height; const scratchCanvas = this.scratchCanvas; - if ("toBlob" in scratchCanvas && !this.disableCreateObjectURL) { + if ("toBlob" in scratchCanvas && !_viewer_compatibility.viewerCompatibilityParams.disableCreateObjectURL) { scratchCanvas.toBlob(function (blob) { img.src = URL.createObjectURL(blob); }); @@ -13273,12 +13884,12 @@ function ensureOverlay() { _app.PDFPrintServiceFactory.instance = { supportsPrinting: true, - createPrintService(pdfDocument, pagesOverview, printContainer, l10n) { + createPrintService(pdfDocument, pagesOverview, printContainer, printResolution, optionalContentConfigPromise, l10n) { if (activeService) { throw new Error("The print service is created and active."); } - activeService = new PDFPrintService(pdfDocument, pagesOverview, printContainer, l10n); + activeService = new PDFPrintService(pdfDocument, pagesOverview, printContainer, printResolution, optionalContentConfigPromise, l10n); return activeService; } @@ -13286,4 +13897,4 @@ _app.PDFPrintServiceFactory.instance = { /***/ }) /******/ ]); -//# sourceMappingURL=viewer.js.map +//# sourceMappingURL=viewer.js.map
\ No newline at end of file |