Attempt to infer if a CMap file actually contains just a standard Identity-H/Identity-V map

This commit is contained in:
Jonas Jenwald 2015-03-06 15:01:26 +01:00
parent 48b2f6d023
commit 7c7d05e7a3
3 changed files with 60 additions and 5 deletions

View file

@ -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.