mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
Attempt to infer if a CMap file actually contains just a standard Identity-H
/Identity-V
map
This commit is contained in:
parent
48b2f6d023
commit
7c7d05e7a3
3 changed files with 60 additions and 5 deletions
|
@ -1339,7 +1339,11 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||
return new ToUnicodeMap(cmap.getMap());
|
||||
} else if (isStream(cmapObj)) {
|
||||
cmap = CMapFactory.create(cmapObj,
|
||||
{ url: PDFJS.cMapUrl, packed: PDFJS.cMapPacked }, null).getMap();
|
||||
{ url: PDFJS.cMapUrl, packed: PDFJS.cMapPacked }, null);
|
||||
if (cmap instanceof IdentityCMap) {
|
||||
return new IdentityToUnicodeMap(0, 0xFFFF);
|
||||
}
|
||||
cmap = cmap.getMap();
|
||||
// Convert UTF-16BE
|
||||
// NOTE: cmap can be a sparse array, so use forEach instead of for(;;)
|
||||
// to iterate over all keys.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue