1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Merge pull request #15981 from Snuffleupagus/cMapPacked-true

[api-minor] Let the `cMapPacked` parameter, in `getDocument`, default to `true`
This commit is contained in:
Tim van der Meij 2023-02-04 15:00:26 +01:00 committed by GitHub
commit e848a0e61c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 13 additions and 21 deletions

View file

@ -166,7 +166,7 @@ if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("PRODUCTION")) {
* @property {string} [cMapUrl] - The URL where the predefined Adobe CMaps are
* located. Include the trailing slash.
* @property {boolean} [cMapPacked] - Specifies if the Adobe CMaps are binary
* packed or not.
* packed or not. The default value is `true`.
* @property {Object} [CMapReaderFactory] - The factory that will be used when
* reading built-in CMap files. Providing a custom factory is useful for
* environments without Fetch API or `XMLHttpRequest` support, such as
@ -347,6 +347,7 @@ function getDocument(src) {
params[key] = val;
}
params.cMapPacked = params.cMapPacked !== false;
params.CMapReaderFactory =
params.CMapReaderFactory || DefaultCMapReaderFactory;
params.StandardFontDataFactory =

View file

@ -65,7 +65,7 @@ class BaseCanvasFactory {
}
class BaseCMapReaderFactory {
constructor({ baseUrl = null, isCompressed = false }) {
constructor({ baseUrl = null, isCompressed = true }) {
if (this.constructor === BaseCMapReaderFactory) {
unreachable("Cannot initialize BaseCMapReaderFactory.");
}