[api-minor] Let the cMapPacked parameter, in getDocument, default to true

The initial CMap support was added in PR 4259 using the "raw" Adobe files, however they were quickly deemed to be unnecessarily large. As a result PR 4470 introduced the more compact "binary" CMap format, with both of those PRs being included in the very same release (version `0.8.1334`) .

Please note that we've thus never shipped anything *except* the "binary" CMap files with the PDF library, and furthermore note that we've not even once updated the CMap files since they were originally added almost nine years ago.

Requiring users to remember that `cMapPacked = true` is necessary, in addition to setting the `cMapUrl` parameter, in order for CMap loading to work feels like a less than ideal API.
Hence this patch, which suggests that we simply let `cMapPacked` default to `true` now.
This commit is contained in:
Jonas Jenwald 2023-01-30 14:12:06 +01:00
parent 3d35b48f46
commit c5d6391898
7 changed files with 13 additions and 21 deletions

View file

@ -21,10 +21,7 @@ import { Ref } from "../../src/core/primitives.js";
const TEST_PDFS_PATH = isNodeJS ? "./test/pdfs/" : "../pdfs/";
const CMAP_PARAMS = {
cMapUrl: isNodeJS ? "./external/bcmaps/" : "../../external/bcmaps/",
cMapPacked: true,
};
const CMAP_URL = isNodeJS ? "./external/bcmaps/" : "../../external/bcmaps/";
const STANDARD_FONT_DATA_URL = isNodeJS
? "./external/standard_fonts/"
@ -154,7 +151,7 @@ function isEmptyObj(obj) {
export {
buildGetDocumentParams,
CMAP_PARAMS,
CMAP_URL,
createIdFactory,
DefaultFileReaderFactory,
isEmptyObj,