1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +02:00

Add support, in Dict.merge, for merging of "sub"-dictionaries

This allows for merging of dictionaries one level deeper than previously. This could be useful e.g. for /Resources dictionaries, where you want to e.g. merge their respective /Font dictionaries (and other) together rather than picking just the first one.
This commit is contained in:
Jonas Jenwald 2020-08-28 01:05:33 +02:00
parent aa27e7fb8d
commit 784a420027
5 changed files with 115 additions and 18 deletions

View file

@ -726,8 +726,10 @@ class PartialEvaluator {
const tilingOpList = new OperatorList();
// Merge the available resources, to prevent issues when the patternDict
// is missing some /Resources entries (fixes issue6541.pdf).
const resourcesArray = [patternDict.get("Resources"), resources];
const patternResources = Dict.merge(this.xref, resourcesArray);
const patternResources = Dict.merge({
xref: this.xref,
dictArray: [patternDict.get("Resources"), resources],
});
return this.getOperatorList({
stream: pattern,