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/clone/wp-conte.../plugins/embedpre.../assets/pdf/build
File: pdf.worker.js
return true;
[42000] Fix | Delete
}
[42001] Fix | Delete
function fetchDest(dest) {
[42002] Fix | Delete
if (dest instanceof Dict) {
[42003] Fix | Delete
dest = dest.get("D");
[42004] Fix | Delete
}
[42005] Fix | Delete
return isValidExplicitDest(dest) ? dest : null;
[42006] Fix | Delete
}
[42007] Fix | Delete
function fetchRemoteDest(action) {
[42008] Fix | Delete
let dest = action.get("D");
[42009] Fix | Delete
if (dest) {
[42010] Fix | Delete
if (dest instanceof Name) {
[42011] Fix | Delete
dest = dest.name;
[42012] Fix | Delete
}
[42013] Fix | Delete
if (typeof dest === "string") {
[42014] Fix | Delete
return stringToPDFString(dest);
[42015] Fix | Delete
} else if (isValidExplicitDest(dest)) {
[42016] Fix | Delete
return JSON.stringify(dest);
[42017] Fix | Delete
}
[42018] Fix | Delete
}
[42019] Fix | Delete
return null;
[42020] Fix | Delete
}
[42021] Fix | Delete
class Catalog {
[42022] Fix | Delete
constructor(pdfManager, xref) {
[42023] Fix | Delete
this.pdfManager = pdfManager;
[42024] Fix | Delete
this.xref = xref;
[42025] Fix | Delete
this._catDict = xref.getCatalogObj();
[42026] Fix | Delete
if (!(this._catDict instanceof Dict)) {
[42027] Fix | Delete
throw new FormatError("Catalog object is not a dictionary.");
[42028] Fix | Delete
}
[42029] Fix | Delete
this.toplevelPagesDict;
[42030] Fix | Delete
this._actualNumPages = null;
[42031] Fix | Delete
this.fontCache = new RefSetCache();
[42032] Fix | Delete
this.builtInCMapCache = new Map();
[42033] Fix | Delete
this.standardFontDataCache = new Map();
[42034] Fix | Delete
this.globalImageCache = new GlobalImageCache();
[42035] Fix | Delete
this.pageKidsCountCache = new RefSetCache();
[42036] Fix | Delete
this.pageIndexCache = new RefSetCache();
[42037] Fix | Delete
this.nonBlendModesSet = new RefSet();
[42038] Fix | Delete
this.systemFontCache = new Map();
[42039] Fix | Delete
}
[42040] Fix | Delete
cloneDict() {
[42041] Fix | Delete
return this._catDict.clone();
[42042] Fix | Delete
}
[42043] Fix | Delete
get version() {
[42044] Fix | Delete
const version = this._catDict.get("Version");
[42045] Fix | Delete
if (version instanceof Name) {
[42046] Fix | Delete
if (PDF_VERSION_REGEXP.test(version.name)) {
[42047] Fix | Delete
return shadow(this, "version", version.name);
[42048] Fix | Delete
}
[42049] Fix | Delete
warn(`Invalid PDF catalog version: ${version.name}`);
[42050] Fix | Delete
}
[42051] Fix | Delete
return shadow(this, "version", null);
[42052] Fix | Delete
}
[42053] Fix | Delete
get lang() {
[42054] Fix | Delete
const lang = this._catDict.get("Lang");
[42055] Fix | Delete
return shadow(this, "lang", lang && typeof lang === "string" ? stringToPDFString(lang) : null);
[42056] Fix | Delete
}
[42057] Fix | Delete
get needsRendering() {
[42058] Fix | Delete
const needsRendering = this._catDict.get("NeedsRendering");
[42059] Fix | Delete
return shadow(this, "needsRendering", typeof needsRendering === "boolean" ? needsRendering : false);
[42060] Fix | Delete
}
[42061] Fix | Delete
get collection() {
[42062] Fix | Delete
let collection = null;
[42063] Fix | Delete
try {
[42064] Fix | Delete
const obj = this._catDict.get("Collection");
[42065] Fix | Delete
if (obj instanceof Dict && obj.size > 0) {
[42066] Fix | Delete
collection = obj;
[42067] Fix | Delete
}
[42068] Fix | Delete
} catch (ex) {
[42069] Fix | Delete
if (ex instanceof MissingDataException) {
[42070] Fix | Delete
throw ex;
[42071] Fix | Delete
}
[42072] Fix | Delete
info("Cannot fetch Collection entry; assuming no collection is present.");
[42073] Fix | Delete
}
[42074] Fix | Delete
return shadow(this, "collection", collection);
[42075] Fix | Delete
}
[42076] Fix | Delete
get acroForm() {
[42077] Fix | Delete
let acroForm = null;
[42078] Fix | Delete
try {
[42079] Fix | Delete
const obj = this._catDict.get("AcroForm");
[42080] Fix | Delete
if (obj instanceof Dict && obj.size > 0) {
[42081] Fix | Delete
acroForm = obj;
[42082] Fix | Delete
}
[42083] Fix | Delete
} catch (ex) {
[42084] Fix | Delete
if (ex instanceof MissingDataException) {
[42085] Fix | Delete
throw ex;
[42086] Fix | Delete
}
[42087] Fix | Delete
info("Cannot fetch AcroForm entry; assuming no forms are present.");
[42088] Fix | Delete
}
[42089] Fix | Delete
return shadow(this, "acroForm", acroForm);
[42090] Fix | Delete
}
[42091] Fix | Delete
get acroFormRef() {
[42092] Fix | Delete
const value = this._catDict.getRaw("AcroForm");
[42093] Fix | Delete
return shadow(this, "acroFormRef", value instanceof Ref ? value : null);
[42094] Fix | Delete
}
[42095] Fix | Delete
get metadata() {
[42096] Fix | Delete
const streamRef = this._catDict.getRaw("Metadata");
[42097] Fix | Delete
if (!(streamRef instanceof Ref)) {
[42098] Fix | Delete
return shadow(this, "metadata", null);
[42099] Fix | Delete
}
[42100] Fix | Delete
let metadata = null;
[42101] Fix | Delete
try {
[42102] Fix | Delete
const stream = this.xref.fetch(streamRef, !this.xref.encrypt?.encryptMetadata);
[42103] Fix | Delete
if (stream instanceof BaseStream && stream.dict instanceof Dict) {
[42104] Fix | Delete
const type = stream.dict.get("Type");
[42105] Fix | Delete
const subtype = stream.dict.get("Subtype");
[42106] Fix | Delete
if (isName(type, "Metadata") && isName(subtype, "XML")) {
[42107] Fix | Delete
const data = stringToUTF8String(stream.getString());
[42108] Fix | Delete
if (data) {
[42109] Fix | Delete
metadata = new MetadataParser(data).serializable;
[42110] Fix | Delete
}
[42111] Fix | Delete
}
[42112] Fix | Delete
}
[42113] Fix | Delete
} catch (ex) {
[42114] Fix | Delete
if (ex instanceof MissingDataException) {
[42115] Fix | Delete
throw ex;
[42116] Fix | Delete
}
[42117] Fix | Delete
info(`Skipping invalid Metadata: "${ex}".`);
[42118] Fix | Delete
}
[42119] Fix | Delete
return shadow(this, "metadata", metadata);
[42120] Fix | Delete
}
[42121] Fix | Delete
get markInfo() {
[42122] Fix | Delete
let markInfo = null;
[42123] Fix | Delete
try {
[42124] Fix | Delete
markInfo = this._readMarkInfo();
[42125] Fix | Delete
} catch (ex) {
[42126] Fix | Delete
if (ex instanceof MissingDataException) {
[42127] Fix | Delete
throw ex;
[42128] Fix | Delete
}
[42129] Fix | Delete
warn("Unable to read mark info.");
[42130] Fix | Delete
}
[42131] Fix | Delete
return shadow(this, "markInfo", markInfo);
[42132] Fix | Delete
}
[42133] Fix | Delete
_readMarkInfo() {
[42134] Fix | Delete
const obj = this._catDict.get("MarkInfo");
[42135] Fix | Delete
if (!(obj instanceof Dict)) {
[42136] Fix | Delete
return null;
[42137] Fix | Delete
}
[42138] Fix | Delete
const markInfo = {
[42139] Fix | Delete
Marked: false,
[42140] Fix | Delete
UserProperties: false,
[42141] Fix | Delete
Suspects: false
[42142] Fix | Delete
};
[42143] Fix | Delete
for (const key in markInfo) {
[42144] Fix | Delete
const value = obj.get(key);
[42145] Fix | Delete
if (typeof value === "boolean") {
[42146] Fix | Delete
markInfo[key] = value;
[42147] Fix | Delete
}
[42148] Fix | Delete
}
[42149] Fix | Delete
return markInfo;
[42150] Fix | Delete
}
[42151] Fix | Delete
get structTreeRoot() {
[42152] Fix | Delete
let structTree = null;
[42153] Fix | Delete
try {
[42154] Fix | Delete
structTree = this._readStructTreeRoot();
[42155] Fix | Delete
} catch (ex) {
[42156] Fix | Delete
if (ex instanceof MissingDataException) {
[42157] Fix | Delete
throw ex;
[42158] Fix | Delete
}
[42159] Fix | Delete
warn("Unable read to structTreeRoot info.");
[42160] Fix | Delete
}
[42161] Fix | Delete
return shadow(this, "structTreeRoot", structTree);
[42162] Fix | Delete
}
[42163] Fix | Delete
_readStructTreeRoot() {
[42164] Fix | Delete
const rawObj = this._catDict.getRaw("StructTreeRoot");
[42165] Fix | Delete
const obj = this.xref.fetchIfRef(rawObj);
[42166] Fix | Delete
if (!(obj instanceof Dict)) {
[42167] Fix | Delete
return null;
[42168] Fix | Delete
}
[42169] Fix | Delete
const root = new StructTreeRoot(obj, rawObj);
[42170] Fix | Delete
root.init();
[42171] Fix | Delete
return root;
[42172] Fix | Delete
}
[42173] Fix | Delete
get toplevelPagesDict() {
[42174] Fix | Delete
const pagesObj = this._catDict.get("Pages");
[42175] Fix | Delete
if (!(pagesObj instanceof Dict)) {
[42176] Fix | Delete
throw new FormatError("Invalid top-level pages dictionary.");
[42177] Fix | Delete
}
[42178] Fix | Delete
return shadow(this, "toplevelPagesDict", pagesObj);
[42179] Fix | Delete
}
[42180] Fix | Delete
get documentOutline() {
[42181] Fix | Delete
let obj = null;
[42182] Fix | Delete
try {
[42183] Fix | Delete
obj = this._readDocumentOutline();
[42184] Fix | Delete
} catch (ex) {
[42185] Fix | Delete
if (ex instanceof MissingDataException) {
[42186] Fix | Delete
throw ex;
[42187] Fix | Delete
}
[42188] Fix | Delete
warn("Unable to read document outline.");
[42189] Fix | Delete
}
[42190] Fix | Delete
return shadow(this, "documentOutline", obj);
[42191] Fix | Delete
}
[42192] Fix | Delete
_readDocumentOutline() {
[42193] Fix | Delete
let obj = this._catDict.get("Outlines");
[42194] Fix | Delete
if (!(obj instanceof Dict)) {
[42195] Fix | Delete
return null;
[42196] Fix | Delete
}
[42197] Fix | Delete
obj = obj.getRaw("First");
[42198] Fix | Delete
if (!(obj instanceof Ref)) {
[42199] Fix | Delete
return null;
[42200] Fix | Delete
}
[42201] Fix | Delete
const root = {
[42202] Fix | Delete
items: []
[42203] Fix | Delete
};
[42204] Fix | Delete
const queue = [{
[42205] Fix | Delete
obj,
[42206] Fix | Delete
parent: root
[42207] Fix | Delete
}];
[42208] Fix | Delete
const processed = new RefSet();
[42209] Fix | Delete
processed.put(obj);
[42210] Fix | Delete
const xref = this.xref,
[42211] Fix | Delete
blackColor = new Uint8ClampedArray(3);
[42212] Fix | Delete
while (queue.length > 0) {
[42213] Fix | Delete
const i = queue.shift();
[42214] Fix | Delete
const outlineDict = xref.fetchIfRef(i.obj);
[42215] Fix | Delete
if (outlineDict === null) {
[42216] Fix | Delete
continue;
[42217] Fix | Delete
}
[42218] Fix | Delete
if (!outlineDict.has("Title")) {
[42219] Fix | Delete
warn("Invalid outline item encountered.");
[42220] Fix | Delete
}
[42221] Fix | Delete
const data = {
[42222] Fix | Delete
url: null,
[42223] Fix | Delete
dest: null,
[42224] Fix | Delete
action: null
[42225] Fix | Delete
};
[42226] Fix | Delete
Catalog.parseDestDictionary({
[42227] Fix | Delete
destDict: outlineDict,
[42228] Fix | Delete
resultObj: data,
[42229] Fix | Delete
docBaseUrl: this.baseUrl,
[42230] Fix | Delete
docAttachments: this.attachments
[42231] Fix | Delete
});
[42232] Fix | Delete
const title = outlineDict.get("Title");
[42233] Fix | Delete
const flags = outlineDict.get("F") || 0;
[42234] Fix | Delete
const color = outlineDict.getArray("C");
[42235] Fix | Delete
const count = outlineDict.get("Count");
[42236] Fix | Delete
let rgbColor = blackColor;
[42237] Fix | Delete
if (isNumberArray(color, 3) && (color[0] !== 0 || color[1] !== 0 || color[2] !== 0)) {
[42238] Fix | Delete
rgbColor = ColorSpace.singletons.rgb.getRgb(color, 0);
[42239] Fix | Delete
}
[42240] Fix | Delete
const outlineItem = {
[42241] Fix | Delete
action: data.action,
[42242] Fix | Delete
attachment: data.attachment,
[42243] Fix | Delete
dest: data.dest,
[42244] Fix | Delete
url: data.url,
[42245] Fix | Delete
unsafeUrl: data.unsafeUrl,
[42246] Fix | Delete
newWindow: data.newWindow,
[42247] Fix | Delete
setOCGState: data.setOCGState,
[42248] Fix | Delete
title: typeof title === "string" ? stringToPDFString(title) : "",
[42249] Fix | Delete
color: rgbColor,
[42250] Fix | Delete
count: Number.isInteger(count) ? count : undefined,
[42251] Fix | Delete
bold: !!(flags & 2),
[42252] Fix | Delete
italic: !!(flags & 1),
[42253] Fix | Delete
items: []
[42254] Fix | Delete
};
[42255] Fix | Delete
i.parent.items.push(outlineItem);
[42256] Fix | Delete
obj = outlineDict.getRaw("First");
[42257] Fix | Delete
if (obj instanceof Ref && !processed.has(obj)) {
[42258] Fix | Delete
queue.push({
[42259] Fix | Delete
obj,
[42260] Fix | Delete
parent: outlineItem
[42261] Fix | Delete
});
[42262] Fix | Delete
processed.put(obj);
[42263] Fix | Delete
}
[42264] Fix | Delete
obj = outlineDict.getRaw("Next");
[42265] Fix | Delete
if (obj instanceof Ref && !processed.has(obj)) {
[42266] Fix | Delete
queue.push({
[42267] Fix | Delete
obj,
[42268] Fix | Delete
parent: i.parent
[42269] Fix | Delete
});
[42270] Fix | Delete
processed.put(obj);
[42271] Fix | Delete
}
[42272] Fix | Delete
}
[42273] Fix | Delete
return root.items.length > 0 ? root.items : null;
[42274] Fix | Delete
}
[42275] Fix | Delete
get permissions() {
[42276] Fix | Delete
let permissions = null;
[42277] Fix | Delete
try {
[42278] Fix | Delete
permissions = this._readPermissions();
[42279] Fix | Delete
} catch (ex) {
[42280] Fix | Delete
if (ex instanceof MissingDataException) {
[42281] Fix | Delete
throw ex;
[42282] Fix | Delete
}
[42283] Fix | Delete
warn("Unable to read permissions.");
[42284] Fix | Delete
}
[42285] Fix | Delete
return shadow(this, "permissions", permissions);
[42286] Fix | Delete
}
[42287] Fix | Delete
_readPermissions() {
[42288] Fix | Delete
const encrypt = this.xref.trailer.get("Encrypt");
[42289] Fix | Delete
if (!(encrypt instanceof Dict)) {
[42290] Fix | Delete
return null;
[42291] Fix | Delete
}
[42292] Fix | Delete
let flags = encrypt.get("P");
[42293] Fix | Delete
if (typeof flags !== "number") {
[42294] Fix | Delete
return null;
[42295] Fix | Delete
}
[42296] Fix | Delete
flags += 2 ** 32;
[42297] Fix | Delete
const permissions = [];
[42298] Fix | Delete
for (const key in PermissionFlag) {
[42299] Fix | Delete
const value = PermissionFlag[key];
[42300] Fix | Delete
if (flags & value) {
[42301] Fix | Delete
permissions.push(value);
[42302] Fix | Delete
}
[42303] Fix | Delete
}
[42304] Fix | Delete
return permissions;
[42305] Fix | Delete
}
[42306] Fix | Delete
get optionalContentConfig() {
[42307] Fix | Delete
let config = null;
[42308] Fix | Delete
try {
[42309] Fix | Delete
const properties = this._catDict.get("OCProperties");
[42310] Fix | Delete
if (!properties) {
[42311] Fix | Delete
return shadow(this, "optionalContentConfig", null);
[42312] Fix | Delete
}
[42313] Fix | Delete
const defaultConfig = properties.get("D");
[42314] Fix | Delete
if (!defaultConfig) {
[42315] Fix | Delete
return shadow(this, "optionalContentConfig", null);
[42316] Fix | Delete
}
[42317] Fix | Delete
const groupsData = properties.get("OCGs");
[42318] Fix | Delete
if (!Array.isArray(groupsData)) {
[42319] Fix | Delete
return shadow(this, "optionalContentConfig", null);
[42320] Fix | Delete
}
[42321] Fix | Delete
const groups = [];
[42322] Fix | Delete
const groupRefs = new RefSet();
[42323] Fix | Delete
for (const groupRef of groupsData) {
[42324] Fix | Delete
if (!(groupRef instanceof Ref) || groupRefs.has(groupRef)) {
[42325] Fix | Delete
continue;
[42326] Fix | Delete
}
[42327] Fix | Delete
groupRefs.put(groupRef);
[42328] Fix | Delete
groups.push(this.#readOptionalContentGroup(groupRef));
[42329] Fix | Delete
}
[42330] Fix | Delete
config = this.#readOptionalContentConfig(defaultConfig, groupRefs);
[42331] Fix | Delete
config.groups = groups;
[42332] Fix | Delete
} catch (ex) {
[42333] Fix | Delete
if (ex instanceof MissingDataException) {
[42334] Fix | Delete
throw ex;
[42335] Fix | Delete
}
[42336] Fix | Delete
warn(`Unable to read optional content config: ${ex}`);
[42337] Fix | Delete
}
[42338] Fix | Delete
return shadow(this, "optionalContentConfig", config);
[42339] Fix | Delete
}
[42340] Fix | Delete
#readOptionalContentGroup(groupRef) {
[42341] Fix | Delete
const group = this.xref.fetch(groupRef);
[42342] Fix | Delete
const obj = {
[42343] Fix | Delete
id: groupRef.toString(),
[42344] Fix | Delete
name: null,
[42345] Fix | Delete
intent: null,
[42346] Fix | Delete
usage: {
[42347] Fix | Delete
print: null,
[42348] Fix | Delete
view: null
[42349] Fix | Delete
}
[42350] Fix | Delete
};
[42351] Fix | Delete
const name = group.get("Name");
[42352] Fix | Delete
if (typeof name === "string") {
[42353] Fix | Delete
obj.name = stringToPDFString(name);
[42354] Fix | Delete
}
[42355] Fix | Delete
let intent = group.getArray("Intent");
[42356] Fix | Delete
if (!Array.isArray(intent)) {
[42357] Fix | Delete
intent = [intent];
[42358] Fix | Delete
}
[42359] Fix | Delete
if (intent.every(i => i instanceof Name)) {
[42360] Fix | Delete
obj.intent = intent.map(i => i.name);
[42361] Fix | Delete
}
[42362] Fix | Delete
const usage = group.get("Usage");
[42363] Fix | Delete
if (!(usage instanceof Dict)) {
[42364] Fix | Delete
return obj;
[42365] Fix | Delete
}
[42366] Fix | Delete
const usageObj = obj.usage;
[42367] Fix | Delete
const print = usage.get("Print");
[42368] Fix | Delete
if (print instanceof Dict) {
[42369] Fix | Delete
const printState = print.get("PrintState");
[42370] Fix | Delete
if (printState instanceof Name) {
[42371] Fix | Delete
switch (printState.name) {
[42372] Fix | Delete
case "ON":
[42373] Fix | Delete
case "OFF":
[42374] Fix | Delete
usageObj.print = {
[42375] Fix | Delete
printState: printState.name
[42376] Fix | Delete
};
[42377] Fix | Delete
}
[42378] Fix | Delete
}
[42379] Fix | Delete
}
[42380] Fix | Delete
const view = usage.get("View");
[42381] Fix | Delete
if (view instanceof Dict) {
[42382] Fix | Delete
const viewState = view.get("ViewState");
[42383] Fix | Delete
if (viewState instanceof Name) {
[42384] Fix | Delete
switch (viewState.name) {
[42385] Fix | Delete
case "ON":
[42386] Fix | Delete
case "OFF":
[42387] Fix | Delete
usageObj.view = {
[42388] Fix | Delete
viewState: viewState.name
[42389] Fix | Delete
};
[42390] Fix | Delete
}
[42391] Fix | Delete
}
[42392] Fix | Delete
}
[42393] Fix | Delete
return obj;
[42394] Fix | Delete
}
[42395] Fix | Delete
#readOptionalContentConfig(config, contentGroupRefs) {
[42396] Fix | Delete
function parseOnOff(refs) {
[42397] Fix | Delete
const onParsed = [];
[42398] Fix | Delete
if (Array.isArray(refs)) {
[42399] Fix | Delete
for (const value of refs) {
[42400] Fix | Delete
if (!(value instanceof Ref)) {
[42401] Fix | Delete
continue;
[42402] Fix | Delete
}
[42403] Fix | Delete
if (contentGroupRefs.has(value)) {
[42404] Fix | Delete
onParsed.push(value.toString());
[42405] Fix | Delete
}
[42406] Fix | Delete
}
[42407] Fix | Delete
}
[42408] Fix | Delete
return onParsed;
[42409] Fix | Delete
}
[42410] Fix | Delete
function parseOrder(refs, nestedLevels = 0) {
[42411] Fix | Delete
if (!Array.isArray(refs)) {
[42412] Fix | Delete
return null;
[42413] Fix | Delete
}
[42414] Fix | Delete
const order = [];
[42415] Fix | Delete
for (const value of refs) {
[42416] Fix | Delete
if (value instanceof Ref && contentGroupRefs.has(value)) {
[42417] Fix | Delete
parsedOrderRefs.put(value);
[42418] Fix | Delete
order.push(value.toString());
[42419] Fix | Delete
continue;
[42420] Fix | Delete
}
[42421] Fix | Delete
const nestedOrder = parseNestedOrder(value, nestedLevels);
[42422] Fix | Delete
if (nestedOrder) {
[42423] Fix | Delete
order.push(nestedOrder);
[42424] Fix | Delete
}
[42425] Fix | Delete
}
[42426] Fix | Delete
if (nestedLevels > 0) {
[42427] Fix | Delete
return order;
[42428] Fix | Delete
}
[42429] Fix | Delete
const hiddenGroups = [];
[42430] Fix | Delete
for (const groupRef of contentGroupRefs) {
[42431] Fix | Delete
if (parsedOrderRefs.has(groupRef)) {
[42432] Fix | Delete
continue;
[42433] Fix | Delete
}
[42434] Fix | Delete
hiddenGroups.push(groupRef.toString());
[42435] Fix | Delete
}
[42436] Fix | Delete
if (hiddenGroups.length) {
[42437] Fix | Delete
order.push({
[42438] Fix | Delete
name: null,
[42439] Fix | Delete
order: hiddenGroups
[42440] Fix | Delete
});
[42441] Fix | Delete
}
[42442] Fix | Delete
return order;
[42443] Fix | Delete
}
[42444] Fix | Delete
function parseNestedOrder(ref, nestedLevels) {
[42445] Fix | Delete
if (++nestedLevels > MAX_NESTED_LEVELS) {
[42446] Fix | Delete
warn("parseNestedOrder - reached MAX_NESTED_LEVELS.");
[42447] Fix | Delete
return null;
[42448] Fix | Delete
}
[42449] Fix | Delete
const value = xref.fetchIfRef(ref);
[42450] Fix | Delete
if (!Array.isArray(value)) {
[42451] Fix | Delete
return null;
[42452] Fix | Delete
}
[42453] Fix | Delete
const nestedName = xref.fetchIfRef(value[0]);
[42454] Fix | Delete
if (typeof nestedName !== "string") {
[42455] Fix | Delete
return null;
[42456] Fix | Delete
}
[42457] Fix | Delete
const nestedOrder = parseOrder(value.slice(1), nestedLevels);
[42458] Fix | Delete
if (!nestedOrder || !nestedOrder.length) {
[42459] Fix | Delete
return null;
[42460] Fix | Delete
}
[42461] Fix | Delete
return {
[42462] Fix | Delete
name: stringToPDFString(nestedName),
[42463] Fix | Delete
order: nestedOrder
[42464] Fix | Delete
};
[42465] Fix | Delete
}
[42466] Fix | Delete
const xref = this.xref,
[42467] Fix | Delete
parsedOrderRefs = new RefSet(),
[42468] Fix | Delete
MAX_NESTED_LEVELS = 10;
[42469] Fix | Delete
return {
[42470] Fix | Delete
name: typeof config.get("Name") === "string" ? stringToPDFString(config.get("Name")) : null,
[42471] Fix | Delete
creator: typeof config.get("Creator") === "string" ? stringToPDFString(config.get("Creator")) : null,
[42472] Fix | Delete
baseState: config.get("BaseState") instanceof Name ? config.get("BaseState").name : null,
[42473] Fix | Delete
on: parseOnOff(config.get("ON")),
[42474] Fix | Delete
off: parseOnOff(config.get("OFF")),
[42475] Fix | Delete
order: parseOrder(config.get("Order")),
[42476] Fix | Delete
groups: null
[42477] Fix | Delete
};
[42478] Fix | Delete
}
[42479] Fix | Delete
setActualNumPages(num = null) {
[42480] Fix | Delete
this._actualNumPages = num;
[42481] Fix | Delete
}
[42482] Fix | Delete
get hasActualNumPages() {
[42483] Fix | Delete
return this._actualNumPages !== null;
[42484] Fix | Delete
}
[42485] Fix | Delete
get _pagesCount() {
[42486] Fix | Delete
const obj = this.toplevelPagesDict.get("Count");
[42487] Fix | Delete
if (!Number.isInteger(obj)) {
[42488] Fix | Delete
throw new FormatError("Page count in top-level pages dictionary is not an integer.");
[42489] Fix | Delete
}
[42490] Fix | Delete
return shadow(this, "_pagesCount", obj);
[42491] Fix | Delete
}
[42492] Fix | Delete
get numPages() {
[42493] Fix | Delete
return this.hasActualNumPages ? this._actualNumPages : this._pagesCount;
[42494] Fix | Delete
}
[42495] Fix | Delete
get destinations() {
[42496] Fix | Delete
const obj = this._readDests(),
[42497] Fix | Delete
dests = Object.create(null);
[42498] Fix | Delete
if (obj instanceof NameTree) {
[42499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function