mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-27 09:27:20 +02:00
[Debugger] Fix the content stream rendering when it's a ref to an array
It can be verified in opening stepped.pdf (see #21089).
This commit is contained in:
parent
5089cceec7
commit
5cc5d9be45
@ -316,7 +316,10 @@ const InternalViewerUtils = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
getContentTokens(contentsVal, xref) {
|
getContentTokens(contentsVal, xref) {
|
||||||
const refs = Array.isArray(contentsVal) ? contentsVal : [contentsVal];
|
// Contents may be a Ref to a stream, a direct array of Refs, or a Ref to
|
||||||
|
// an array of Refs. Resolve one level to detect the array case.
|
||||||
|
const resolvedVal = xref.fetchIfRef(contentsVal);
|
||||||
|
const refs = Array.isArray(resolvedVal) ? resolvedVal : [contentsVal];
|
||||||
const rawContents = [];
|
const rawContents = [];
|
||||||
const tokens = [];
|
const tokens = [];
|
||||||
const rawBytesArr = [];
|
const rawBytesArr = [];
|
||||||
|
|||||||
@ -196,7 +196,7 @@ class NetworkPdfManager extends BasePdfManager {
|
|||||||
try {
|
try {
|
||||||
const value = obj[prop];
|
const value = obj[prop];
|
||||||
if (typeof value === "function") {
|
if (typeof value === "function") {
|
||||||
return value.apply(obj, args);
|
return await value.apply(obj, args);
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user