Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-conte.../plugins/embedpre.../assets/pdf/build
File: pdf.worker.js
break;
[58000] Fix | Delete
case 1:
[58001] Fix | Delete
entry.uncompressed = true;
[58002] Fix | Delete
break;
[58003] Fix | Delete
case 2:
[58004] Fix | Delete
break;
[58005] Fix | Delete
default:
[58006] Fix | Delete
throw new FormatError(`Invalid XRef entry type: ${type}`);
[58007] Fix | Delete
}
[58008] Fix | Delete
if (!this.entries[first + i]) {
[58009] Fix | Delete
this.entries[first + i] = entry;
[58010] Fix | Delete
}
[58011] Fix | Delete
}
[58012] Fix | Delete
streamState.entryNum = 0;
[58013] Fix | Delete
streamState.streamPos = stream.pos;
[58014] Fix | Delete
entryRanges.splice(0, 2);
[58015] Fix | Delete
}
[58016] Fix | Delete
}
[58017] Fix | Delete
indexObjects() {
[58018] Fix | Delete
const TAB = 0x9,
[58019] Fix | Delete
LF = 0xa,
[58020] Fix | Delete
CR = 0xd,
[58021] Fix | Delete
SPACE = 0x20;
[58022] Fix | Delete
const PERCENT = 0x25,
[58023] Fix | Delete
LT = 0x3c;
[58024] Fix | Delete
function readToken(data, offset) {
[58025] Fix | Delete
let token = "",
[58026] Fix | Delete
ch = data[offset];
[58027] Fix | Delete
while (ch !== LF && ch !== CR && ch !== LT) {
[58028] Fix | Delete
if (++offset >= data.length) {
[58029] Fix | Delete
break;
[58030] Fix | Delete
}
[58031] Fix | Delete
token += String.fromCharCode(ch);
[58032] Fix | Delete
ch = data[offset];
[58033] Fix | Delete
}
[58034] Fix | Delete
return token;
[58035] Fix | Delete
}
[58036] Fix | Delete
function skipUntil(data, offset, what) {
[58037] Fix | Delete
const length = what.length,
[58038] Fix | Delete
dataLength = data.length;
[58039] Fix | Delete
let skipped = 0;
[58040] Fix | Delete
while (offset < dataLength) {
[58041] Fix | Delete
let i = 0;
[58042] Fix | Delete
while (i < length && data[offset + i] === what[i]) {
[58043] Fix | Delete
++i;
[58044] Fix | Delete
}
[58045] Fix | Delete
if (i >= length) {
[58046] Fix | Delete
break;
[58047] Fix | Delete
}
[58048] Fix | Delete
offset++;
[58049] Fix | Delete
skipped++;
[58050] Fix | Delete
}
[58051] Fix | Delete
return skipped;
[58052] Fix | Delete
}
[58053] Fix | Delete
const gEndobjRegExp = /\b(endobj|\d+\s+\d+\s+obj|xref|trailer\s*<<)\b/g;
[58054] Fix | Delete
const gStartxrefRegExp = /\b(startxref|\d+\s+\d+\s+obj)\b/g;
[58055] Fix | Delete
const objRegExp = /^(\d+)\s+(\d+)\s+obj\b/;
[58056] Fix | Delete
const trailerBytes = new Uint8Array([116, 114, 97, 105, 108, 101, 114]);
[58057] Fix | Delete
const startxrefBytes = new Uint8Array([115, 116, 97, 114, 116, 120, 114, 101, 102]);
[58058] Fix | Delete
const xrefBytes = new Uint8Array([47, 88, 82, 101, 102]);
[58059] Fix | Delete
this.entries.length = 0;
[58060] Fix | Delete
this._cacheMap.clear();
[58061] Fix | Delete
const stream = this.stream;
[58062] Fix | Delete
stream.pos = 0;
[58063] Fix | Delete
const buffer = stream.getBytes(),
[58064] Fix | Delete
bufferStr = bytesToString(buffer),
[58065] Fix | Delete
length = buffer.length;
[58066] Fix | Delete
let position = stream.start;
[58067] Fix | Delete
const trailers = [],
[58068] Fix | Delete
xrefStms = [];
[58069] Fix | Delete
while (position < length) {
[58070] Fix | Delete
let ch = buffer[position];
[58071] Fix | Delete
if (ch === TAB || ch === LF || ch === CR || ch === SPACE) {
[58072] Fix | Delete
++position;
[58073] Fix | Delete
continue;
[58074] Fix | Delete
}
[58075] Fix | Delete
if (ch === PERCENT) {
[58076] Fix | Delete
do {
[58077] Fix | Delete
++position;
[58078] Fix | Delete
if (position >= length) {
[58079] Fix | Delete
break;
[58080] Fix | Delete
}
[58081] Fix | Delete
ch = buffer[position];
[58082] Fix | Delete
} while (ch !== LF && ch !== CR);
[58083] Fix | Delete
continue;
[58084] Fix | Delete
}
[58085] Fix | Delete
const token = readToken(buffer, position);
[58086] Fix | Delete
let m;
[58087] Fix | Delete
if (token.startsWith("xref") && (token.length === 4 || /\s/.test(token[4]))) {
[58088] Fix | Delete
position += skipUntil(buffer, position, trailerBytes);
[58089] Fix | Delete
trailers.push(position);
[58090] Fix | Delete
position += skipUntil(buffer, position, startxrefBytes);
[58091] Fix | Delete
} else if (m = objRegExp.exec(token)) {
[58092] Fix | Delete
const num = m[1] | 0,
[58093] Fix | Delete
gen = m[2] | 0;
[58094] Fix | Delete
const startPos = position + token.length;
[58095] Fix | Delete
let contentLength,
[58096] Fix | Delete
updateEntries = false;
[58097] Fix | Delete
if (!this.entries[num]) {
[58098] Fix | Delete
updateEntries = true;
[58099] Fix | Delete
} else if (this.entries[num].gen === gen) {
[58100] Fix | Delete
try {
[58101] Fix | Delete
const parser = new Parser({
[58102] Fix | Delete
lexer: new Lexer(stream.makeSubStream(startPos))
[58103] Fix | Delete
});
[58104] Fix | Delete
parser.getObj();
[58105] Fix | Delete
updateEntries = true;
[58106] Fix | Delete
} catch (ex) {
[58107] Fix | Delete
if (ex instanceof ParserEOFException) {
[58108] Fix | Delete
warn(`indexObjects -- checking object (${token}): "${ex}".`);
[58109] Fix | Delete
} else {
[58110] Fix | Delete
updateEntries = true;
[58111] Fix | Delete
}
[58112] Fix | Delete
}
[58113] Fix | Delete
}
[58114] Fix | Delete
if (updateEntries) {
[58115] Fix | Delete
this.entries[num] = {
[58116] Fix | Delete
offset: position - stream.start,
[58117] Fix | Delete
gen,
[58118] Fix | Delete
uncompressed: true
[58119] Fix | Delete
};
[58120] Fix | Delete
}
[58121] Fix | Delete
gEndobjRegExp.lastIndex = startPos;
[58122] Fix | Delete
const match = gEndobjRegExp.exec(bufferStr);
[58123] Fix | Delete
if (match) {
[58124] Fix | Delete
const endPos = gEndobjRegExp.lastIndex + 1;
[58125] Fix | Delete
contentLength = endPos - position;
[58126] Fix | Delete
if (match[1] !== "endobj") {
[58127] Fix | Delete
warn(`indexObjects: Found "${match[1]}" inside of another "obj", ` + 'caused by missing "endobj" -- trying to recover.');
[58128] Fix | Delete
contentLength -= match[1].length + 1;
[58129] Fix | Delete
}
[58130] Fix | Delete
} else {
[58131] Fix | Delete
contentLength = length - position;
[58132] Fix | Delete
}
[58133] Fix | Delete
const content = buffer.subarray(position, position + contentLength);
[58134] Fix | Delete
const xrefTagOffset = skipUntil(content, 0, xrefBytes);
[58135] Fix | Delete
if (xrefTagOffset < contentLength && content[xrefTagOffset + 5] < 64) {
[58136] Fix | Delete
xrefStms.push(position - stream.start);
[58137] Fix | Delete
this._xrefStms.add(position - stream.start);
[58138] Fix | Delete
}
[58139] Fix | Delete
position += contentLength;
[58140] Fix | Delete
} else if (token.startsWith("trailer") && (token.length === 7 || /\s/.test(token[7]))) {
[58141] Fix | Delete
trailers.push(position);
[58142] Fix | Delete
const startPos = position + token.length;
[58143] Fix | Delete
let contentLength;
[58144] Fix | Delete
gStartxrefRegExp.lastIndex = startPos;
[58145] Fix | Delete
const match = gStartxrefRegExp.exec(bufferStr);
[58146] Fix | Delete
if (match) {
[58147] Fix | Delete
const endPos = gStartxrefRegExp.lastIndex + 1;
[58148] Fix | Delete
contentLength = endPos - position;
[58149] Fix | Delete
if (match[1] !== "startxref") {
[58150] Fix | Delete
warn(`indexObjects: Found "${match[1]}" after "trailer", ` + 'caused by missing "startxref" -- trying to recover.');
[58151] Fix | Delete
contentLength -= match[1].length + 1;
[58152] Fix | Delete
}
[58153] Fix | Delete
} else {
[58154] Fix | Delete
contentLength = length - position;
[58155] Fix | Delete
}
[58156] Fix | Delete
position += contentLength;
[58157] Fix | Delete
} else {
[58158] Fix | Delete
position += token.length + 1;
[58159] Fix | Delete
}
[58160] Fix | Delete
}
[58161] Fix | Delete
for (const xrefStm of xrefStms) {
[58162] Fix | Delete
this.startXRefQueue.push(xrefStm);
[58163] Fix | Delete
this.readXRef(true);
[58164] Fix | Delete
}
[58165] Fix | Delete
const trailerDicts = [];
[58166] Fix | Delete
let isEncrypted = false;
[58167] Fix | Delete
for (const trailer of trailers) {
[58168] Fix | Delete
stream.pos = trailer;
[58169] Fix | Delete
const parser = new Parser({
[58170] Fix | Delete
lexer: new Lexer(stream),
[58171] Fix | Delete
xref: this,
[58172] Fix | Delete
allowStreams: true,
[58173] Fix | Delete
recoveryMode: true
[58174] Fix | Delete
});
[58175] Fix | Delete
const obj = parser.getObj();
[58176] Fix | Delete
if (!isCmd(obj, "trailer")) {
[58177] Fix | Delete
continue;
[58178] Fix | Delete
}
[58179] Fix | Delete
const dict = parser.getObj();
[58180] Fix | Delete
if (!(dict instanceof Dict)) {
[58181] Fix | Delete
continue;
[58182] Fix | Delete
}
[58183] Fix | Delete
trailerDicts.push(dict);
[58184] Fix | Delete
if (dict.has("Encrypt")) {
[58185] Fix | Delete
isEncrypted = true;
[58186] Fix | Delete
}
[58187] Fix | Delete
}
[58188] Fix | Delete
let trailerDict, trailerError;
[58189] Fix | Delete
for (const dict of [...trailerDicts, "genFallback", ...trailerDicts]) {
[58190] Fix | Delete
if (dict === "genFallback") {
[58191] Fix | Delete
if (!trailerError) {
[58192] Fix | Delete
break;
[58193] Fix | Delete
}
[58194] Fix | Delete
this._generationFallback = true;
[58195] Fix | Delete
continue;
[58196] Fix | Delete
}
[58197] Fix | Delete
let validPagesDict = false;
[58198] Fix | Delete
try {
[58199] Fix | Delete
const rootDict = dict.get("Root");
[58200] Fix | Delete
if (!(rootDict instanceof Dict)) {
[58201] Fix | Delete
continue;
[58202] Fix | Delete
}
[58203] Fix | Delete
const pagesDict = rootDict.get("Pages");
[58204] Fix | Delete
if (!(pagesDict instanceof Dict)) {
[58205] Fix | Delete
continue;
[58206] Fix | Delete
}
[58207] Fix | Delete
const pagesCount = pagesDict.get("Count");
[58208] Fix | Delete
if (Number.isInteger(pagesCount)) {
[58209] Fix | Delete
validPagesDict = true;
[58210] Fix | Delete
}
[58211] Fix | Delete
} catch (ex) {
[58212] Fix | Delete
trailerError = ex;
[58213] Fix | Delete
continue;
[58214] Fix | Delete
}
[58215] Fix | Delete
if (validPagesDict && (!isEncrypted || dict.has("Encrypt")) && dict.has("ID")) {
[58216] Fix | Delete
return dict;
[58217] Fix | Delete
}
[58218] Fix | Delete
trailerDict = dict;
[58219] Fix | Delete
}
[58220] Fix | Delete
if (trailerDict) {
[58221] Fix | Delete
return trailerDict;
[58222] Fix | Delete
}
[58223] Fix | Delete
if (this.topDict) {
[58224] Fix | Delete
return this.topDict;
[58225] Fix | Delete
}
[58226] Fix | Delete
throw new InvalidPDFException("Invalid PDF structure.");
[58227] Fix | Delete
}
[58228] Fix | Delete
readXRef(recoveryMode = false) {
[58229] Fix | Delete
const stream = this.stream;
[58230] Fix | Delete
const startXRefParsedCache = new Set();
[58231] Fix | Delete
while (this.startXRefQueue.length) {
[58232] Fix | Delete
try {
[58233] Fix | Delete
const startXRef = this.startXRefQueue[0];
[58234] Fix | Delete
if (startXRefParsedCache.has(startXRef)) {
[58235] Fix | Delete
warn("readXRef - skipping XRef table since it was already parsed.");
[58236] Fix | Delete
this.startXRefQueue.shift();
[58237] Fix | Delete
continue;
[58238] Fix | Delete
}
[58239] Fix | Delete
startXRefParsedCache.add(startXRef);
[58240] Fix | Delete
stream.pos = startXRef + stream.start;
[58241] Fix | Delete
const parser = new Parser({
[58242] Fix | Delete
lexer: new Lexer(stream),
[58243] Fix | Delete
xref: this,
[58244] Fix | Delete
allowStreams: true
[58245] Fix | Delete
});
[58246] Fix | Delete
let obj = parser.getObj();
[58247] Fix | Delete
let dict;
[58248] Fix | Delete
if (isCmd(obj, "xref")) {
[58249] Fix | Delete
dict = this.processXRefTable(parser);
[58250] Fix | Delete
if (!this.topDict) {
[58251] Fix | Delete
this.topDict = dict;
[58252] Fix | Delete
}
[58253] Fix | Delete
obj = dict.get("XRefStm");
[58254] Fix | Delete
if (Number.isInteger(obj) && !this._xrefStms.has(obj)) {
[58255] Fix | Delete
this._xrefStms.add(obj);
[58256] Fix | Delete
this.startXRefQueue.push(obj);
[58257] Fix | Delete
this.#firstXRefStmPos ??= obj;
[58258] Fix | Delete
}
[58259] Fix | Delete
} else if (Number.isInteger(obj)) {
[58260] Fix | Delete
if (!Number.isInteger(parser.getObj()) || !isCmd(parser.getObj(), "obj") || !((obj = parser.getObj()) instanceof BaseStream)) {
[58261] Fix | Delete
throw new FormatError("Invalid XRef stream");
[58262] Fix | Delete
}
[58263] Fix | Delete
dict = this.processXRefStream(obj);
[58264] Fix | Delete
if (!this.topDict) {
[58265] Fix | Delete
this.topDict = dict;
[58266] Fix | Delete
}
[58267] Fix | Delete
if (!dict) {
[58268] Fix | Delete
throw new FormatError("Failed to read XRef stream");
[58269] Fix | Delete
}
[58270] Fix | Delete
} else {
[58271] Fix | Delete
throw new FormatError("Invalid XRef stream header");
[58272] Fix | Delete
}
[58273] Fix | Delete
obj = dict.get("Prev");
[58274] Fix | Delete
if (Number.isInteger(obj)) {
[58275] Fix | Delete
this.startXRefQueue.push(obj);
[58276] Fix | Delete
} else if (obj instanceof Ref) {
[58277] Fix | Delete
this.startXRefQueue.push(obj.num);
[58278] Fix | Delete
}
[58279] Fix | Delete
} catch (e) {
[58280] Fix | Delete
if (e instanceof MissingDataException) {
[58281] Fix | Delete
throw e;
[58282] Fix | Delete
}
[58283] Fix | Delete
info("(while reading XRef): " + e);
[58284] Fix | Delete
}
[58285] Fix | Delete
this.startXRefQueue.shift();
[58286] Fix | Delete
}
[58287] Fix | Delete
if (this.topDict) {
[58288] Fix | Delete
return this.topDict;
[58289] Fix | Delete
}
[58290] Fix | Delete
if (recoveryMode) {
[58291] Fix | Delete
return undefined;
[58292] Fix | Delete
}
[58293] Fix | Delete
throw new XRefParseException();
[58294] Fix | Delete
}
[58295] Fix | Delete
get lastXRefStreamPos() {
[58296] Fix | Delete
return this.#firstXRefStmPos ?? (this._xrefStms.size > 0 ? Math.max(...this._xrefStms) : null);
[58297] Fix | Delete
}
[58298] Fix | Delete
getEntry(i) {
[58299] Fix | Delete
const xrefEntry = this.entries[i];
[58300] Fix | Delete
if (xrefEntry && !xrefEntry.free && xrefEntry.offset) {
[58301] Fix | Delete
return xrefEntry;
[58302] Fix | Delete
}
[58303] Fix | Delete
return null;
[58304] Fix | Delete
}
[58305] Fix | Delete
fetchIfRef(obj, suppressEncryption = false) {
[58306] Fix | Delete
if (obj instanceof Ref) {
[58307] Fix | Delete
return this.fetch(obj, suppressEncryption);
[58308] Fix | Delete
}
[58309] Fix | Delete
return obj;
[58310] Fix | Delete
}
[58311] Fix | Delete
fetch(ref, suppressEncryption = false) {
[58312] Fix | Delete
if (!(ref instanceof Ref)) {
[58313] Fix | Delete
throw new Error("ref object is not a reference");
[58314] Fix | Delete
}
[58315] Fix | Delete
const num = ref.num;
[58316] Fix | Delete
const cacheEntry = this._cacheMap.get(num);
[58317] Fix | Delete
if (cacheEntry !== undefined) {
[58318] Fix | Delete
if (cacheEntry instanceof Dict && !cacheEntry.objId) {
[58319] Fix | Delete
cacheEntry.objId = ref.toString();
[58320] Fix | Delete
}
[58321] Fix | Delete
return cacheEntry;
[58322] Fix | Delete
}
[58323] Fix | Delete
let xrefEntry = this.getEntry(num);
[58324] Fix | Delete
if (xrefEntry === null) {
[58325] Fix | Delete
this._cacheMap.set(num, xrefEntry);
[58326] Fix | Delete
return xrefEntry;
[58327] Fix | Delete
}
[58328] Fix | Delete
if (this._pendingRefs.has(ref)) {
[58329] Fix | Delete
this._pendingRefs.remove(ref);
[58330] Fix | Delete
warn(`Ignoring circular reference: ${ref}.`);
[58331] Fix | Delete
return CIRCULAR_REF;
[58332] Fix | Delete
}
[58333] Fix | Delete
this._pendingRefs.put(ref);
[58334] Fix | Delete
try {
[58335] Fix | Delete
xrefEntry = xrefEntry.uncompressed ? this.fetchUncompressed(ref, xrefEntry, suppressEncryption) : this.fetchCompressed(ref, xrefEntry, suppressEncryption);
[58336] Fix | Delete
this._pendingRefs.remove(ref);
[58337] Fix | Delete
} catch (ex) {
[58338] Fix | Delete
this._pendingRefs.remove(ref);
[58339] Fix | Delete
throw ex;
[58340] Fix | Delete
}
[58341] Fix | Delete
if (xrefEntry instanceof Dict) {
[58342] Fix | Delete
xrefEntry.objId = ref.toString();
[58343] Fix | Delete
} else if (xrefEntry instanceof BaseStream) {
[58344] Fix | Delete
xrefEntry.dict.objId = ref.toString();
[58345] Fix | Delete
}
[58346] Fix | Delete
return xrefEntry;
[58347] Fix | Delete
}
[58348] Fix | Delete
fetchUncompressed(ref, xrefEntry, suppressEncryption = false) {
[58349] Fix | Delete
const gen = ref.gen;
[58350] Fix | Delete
let num = ref.num;
[58351] Fix | Delete
if (xrefEntry.gen !== gen) {
[58352] Fix | Delete
const msg = `Inconsistent generation in XRef: ${ref}`;
[58353] Fix | Delete
if (this._generationFallback && xrefEntry.gen < gen) {
[58354] Fix | Delete
warn(msg);
[58355] Fix | Delete
return this.fetchUncompressed(Ref.get(num, xrefEntry.gen), xrefEntry, suppressEncryption);
[58356] Fix | Delete
}
[58357] Fix | Delete
throw new XRefEntryException(msg);
[58358] Fix | Delete
}
[58359] Fix | Delete
const stream = this.stream.makeSubStream(xrefEntry.offset + this.stream.start);
[58360] Fix | Delete
const parser = new Parser({
[58361] Fix | Delete
lexer: new Lexer(stream),
[58362] Fix | Delete
xref: this,
[58363] Fix | Delete
allowStreams: true
[58364] Fix | Delete
});
[58365] Fix | Delete
const obj1 = parser.getObj();
[58366] Fix | Delete
const obj2 = parser.getObj();
[58367] Fix | Delete
const obj3 = parser.getObj();
[58368] Fix | Delete
if (obj1 !== num || obj2 !== gen || !(obj3 instanceof Cmd)) {
[58369] Fix | Delete
throw new XRefEntryException(`Bad (uncompressed) XRef entry: ${ref}`);
[58370] Fix | Delete
}
[58371] Fix | Delete
if (obj3.cmd !== "obj") {
[58372] Fix | Delete
if (obj3.cmd.startsWith("obj")) {
[58373] Fix | Delete
num = parseInt(obj3.cmd.substring(3), 10);
[58374] Fix | Delete
if (!Number.isNaN(num)) {
[58375] Fix | Delete
return num;
[58376] Fix | Delete
}
[58377] Fix | Delete
}
[58378] Fix | Delete
throw new XRefEntryException(`Bad (uncompressed) XRef entry: ${ref}`);
[58379] Fix | Delete
}
[58380] Fix | Delete
xrefEntry = this.encrypt && !suppressEncryption ? parser.getObj(this.encrypt.createCipherTransform(num, gen)) : parser.getObj();
[58381] Fix | Delete
if (!(xrefEntry instanceof BaseStream)) {
[58382] Fix | Delete
this._cacheMap.set(num, xrefEntry);
[58383] Fix | Delete
}
[58384] Fix | Delete
return xrefEntry;
[58385] Fix | Delete
}
[58386] Fix | Delete
fetchCompressed(ref, xrefEntry, suppressEncryption = false) {
[58387] Fix | Delete
const tableOffset = xrefEntry.offset;
[58388] Fix | Delete
const stream = this.fetch(Ref.get(tableOffset, 0));
[58389] Fix | Delete
if (!(stream instanceof BaseStream)) {
[58390] Fix | Delete
throw new FormatError("bad ObjStm stream");
[58391] Fix | Delete
}
[58392] Fix | Delete
const first = stream.dict.get("First");
[58393] Fix | Delete
const n = stream.dict.get("N");
[58394] Fix | Delete
if (!Number.isInteger(first) || !Number.isInteger(n)) {
[58395] Fix | Delete
throw new FormatError("invalid first and n parameters for ObjStm stream");
[58396] Fix | Delete
}
[58397] Fix | Delete
let parser = new Parser({
[58398] Fix | Delete
lexer: new Lexer(stream),
[58399] Fix | Delete
xref: this,
[58400] Fix | Delete
allowStreams: true
[58401] Fix | Delete
});
[58402] Fix | Delete
const nums = new Array(n);
[58403] Fix | Delete
const offsets = new Array(n);
[58404] Fix | Delete
for (let i = 0; i < n; ++i) {
[58405] Fix | Delete
const num = parser.getObj();
[58406] Fix | Delete
if (!Number.isInteger(num)) {
[58407] Fix | Delete
throw new FormatError(`invalid object number in the ObjStm stream: ${num}`);
[58408] Fix | Delete
}
[58409] Fix | Delete
const offset = parser.getObj();
[58410] Fix | Delete
if (!Number.isInteger(offset)) {
[58411] Fix | Delete
throw new FormatError(`invalid object offset in the ObjStm stream: ${offset}`);
[58412] Fix | Delete
}
[58413] Fix | Delete
nums[i] = num;
[58414] Fix | Delete
offsets[i] = offset;
[58415] Fix | Delete
}
[58416] Fix | Delete
const start = (stream.start || 0) + first;
[58417] Fix | Delete
const entries = new Array(n);
[58418] Fix | Delete
for (let i = 0; i < n; ++i) {
[58419] Fix | Delete
const length = i < n - 1 ? offsets[i + 1] - offsets[i] : undefined;
[58420] Fix | Delete
if (length < 0) {
[58421] Fix | Delete
throw new FormatError("Invalid offset in the ObjStm stream.");
[58422] Fix | Delete
}
[58423] Fix | Delete
parser = new Parser({
[58424] Fix | Delete
lexer: new Lexer(stream.makeSubStream(start + offsets[i], length, stream.dict)),
[58425] Fix | Delete
xref: this,
[58426] Fix | Delete
allowStreams: true
[58427] Fix | Delete
});
[58428] Fix | Delete
const obj = parser.getObj();
[58429] Fix | Delete
entries[i] = obj;
[58430] Fix | Delete
if (obj instanceof BaseStream) {
[58431] Fix | Delete
continue;
[58432] Fix | Delete
}
[58433] Fix | Delete
const num = nums[i],
[58434] Fix | Delete
entry = this.entries[num];
[58435] Fix | Delete
if (entry && entry.offset === tableOffset && entry.gen === i) {
[58436] Fix | Delete
this._cacheMap.set(num, obj);
[58437] Fix | Delete
}
[58438] Fix | Delete
}
[58439] Fix | Delete
xrefEntry = entries[xrefEntry.gen];
[58440] Fix | Delete
if (xrefEntry === undefined) {
[58441] Fix | Delete
throw new XRefEntryException(`Bad (compressed) XRef entry: ${ref}`);
[58442] Fix | Delete
}
[58443] Fix | Delete
return xrefEntry;
[58444] Fix | Delete
}
[58445] Fix | Delete
async fetchIfRefAsync(obj, suppressEncryption) {
[58446] Fix | Delete
if (obj instanceof Ref) {
[58447] Fix | Delete
return this.fetchAsync(obj, suppressEncryption);
[58448] Fix | Delete
}
[58449] Fix | Delete
return obj;
[58450] Fix | Delete
}
[58451] Fix | Delete
async fetchAsync(ref, suppressEncryption) {
[58452] Fix | Delete
try {
[58453] Fix | Delete
return this.fetch(ref, suppressEncryption);
[58454] Fix | Delete
} catch (ex) {
[58455] Fix | Delete
if (!(ex instanceof MissingDataException)) {
[58456] Fix | Delete
throw ex;
[58457] Fix | Delete
}
[58458] Fix | Delete
await this.pdfManager.requestRange(ex.begin, ex.end);
[58459] Fix | Delete
return this.fetchAsync(ref, suppressEncryption);
[58460] Fix | Delete
}
[58461] Fix | Delete
}
[58462] Fix | Delete
getCatalogObj() {
[58463] Fix | Delete
return this.root;
[58464] Fix | Delete
}
[58465] Fix | Delete
}
[58466] Fix | Delete
[58467] Fix | Delete
;// CONCATENATED MODULE: ./src/core/document.js
[58468] Fix | Delete
[58469] Fix | Delete
[58470] Fix | Delete
[58471] Fix | Delete
[58472] Fix | Delete
[58473] Fix | Delete
[58474] Fix | Delete
[58475] Fix | Delete
[58476] Fix | Delete
[58477] Fix | Delete
[58478] Fix | Delete
[58479] Fix | Delete
[58480] Fix | Delete
[58481] Fix | Delete
[58482] Fix | Delete
[58483] Fix | Delete
[58484] Fix | Delete
[58485] Fix | Delete
[58486] Fix | Delete
[58487] Fix | Delete
[58488] Fix | Delete
[58489] Fix | Delete
[58490] Fix | Delete
[58491] Fix | Delete
[58492] Fix | Delete
[58493] Fix | Delete
[58494] Fix | Delete
[58495] Fix | Delete
[58496] Fix | Delete
[58497] Fix | Delete
[58498] Fix | Delete
[58499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function