Convert the PartialEvaluator.extractDataStructures method to be async

This commit is contained in:
Jonas Jenwald 2024-01-22 12:22:48 +01:00
parent cf0797dfbd
commit f5c01188dc

View File

@ -3428,7 +3428,7 @@ class PartialEvaluator {
});
}
extractDataStructures(dict, baseDict, properties) {
async extractDataStructures(dict, baseDict, properties) {
const xref = this.xref;
let cidToGidBytes;
// 9.10.2
@ -3554,21 +3554,19 @@ class PartialEvaluator {
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;
if (cidToGidBytes) {
properties.cidToGidMap = this.readCidToGidMap(
cidToGidBytes,
builtToUnicode
);
}
return properties;
});
properties.toUnicode = await toUnicodePromise;
const builtToUnicode = await this.buildToUnicode(properties);
properties.toUnicode = builtToUnicode;
if (cidToGidBytes) {
properties.cidToGidMap = this.readCidToGidMap(
cidToGidBytes,
builtToUnicode
);
}
return properties;
}
/**