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
const sortedAnnotations = [];
[59000] Fix | Delete
let popupAnnotations, widgetAnnotations;
[59001] Fix | Delete
for (const annotation of await Promise.all(annotationPromises)) {
[59002] Fix | Delete
if (!annotation) {
[59003] Fix | Delete
continue;
[59004] Fix | Delete
}
[59005] Fix | Delete
if (annotation instanceof WidgetAnnotation) {
[59006] Fix | Delete
(widgetAnnotations ||= []).push(annotation);
[59007] Fix | Delete
continue;
[59008] Fix | Delete
}
[59009] Fix | Delete
if (annotation instanceof PopupAnnotation) {
[59010] Fix | Delete
(popupAnnotations ||= []).push(annotation);
[59011] Fix | Delete
continue;
[59012] Fix | Delete
}
[59013] Fix | Delete
sortedAnnotations.push(annotation);
[59014] Fix | Delete
}
[59015] Fix | Delete
if (widgetAnnotations) {
[59016] Fix | Delete
sortedAnnotations.push(...widgetAnnotations);
[59017] Fix | Delete
}
[59018] Fix | Delete
if (popupAnnotations) {
[59019] Fix | Delete
sortedAnnotations.push(...popupAnnotations);
[59020] Fix | Delete
}
[59021] Fix | Delete
return sortedAnnotations;
[59022] Fix | Delete
});
[59023] Fix | Delete
return shadow(this, "_parsedAnnotations", promise);
[59024] Fix | Delete
}
[59025] Fix | Delete
get jsActions() {
[59026] Fix | Delete
const actions = collectActions(this.xref, this.pageDict, PageActionEventType);
[59027] Fix | Delete
return shadow(this, "jsActions", actions);
[59028] Fix | Delete
}
[59029] Fix | Delete
}
[59030] Fix | Delete
const PDF_HEADER_SIGNATURE = new Uint8Array([0x25, 0x50, 0x44, 0x46, 0x2d]);
[59031] Fix | Delete
const STARTXREF_SIGNATURE = new Uint8Array([0x73, 0x74, 0x61, 0x72, 0x74, 0x78, 0x72, 0x65, 0x66]);
[59032] Fix | Delete
const ENDOBJ_SIGNATURE = new Uint8Array([0x65, 0x6e, 0x64, 0x6f, 0x62, 0x6a]);
[59033] Fix | Delete
const FINGERPRINT_FIRST_BYTES = 1024;
[59034] Fix | Delete
const EMPTY_FINGERPRINT = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
[59035] Fix | Delete
function find(stream, signature, limit = 1024, backwards = false) {
[59036] Fix | Delete
const signatureLength = signature.length;
[59037] Fix | Delete
const scanBytes = stream.peekBytes(limit);
[59038] Fix | Delete
const scanLength = scanBytes.length - signatureLength;
[59039] Fix | Delete
if (scanLength <= 0) {
[59040] Fix | Delete
return false;
[59041] Fix | Delete
}
[59042] Fix | Delete
if (backwards) {
[59043] Fix | Delete
const signatureEnd = signatureLength - 1;
[59044] Fix | Delete
let pos = scanBytes.length - 1;
[59045] Fix | Delete
while (pos >= signatureEnd) {
[59046] Fix | Delete
let j = 0;
[59047] Fix | Delete
while (j < signatureLength && scanBytes[pos - j] === signature[signatureEnd - j]) {
[59048] Fix | Delete
j++;
[59049] Fix | Delete
}
[59050] Fix | Delete
if (j >= signatureLength) {
[59051] Fix | Delete
stream.pos += pos - signatureEnd;
[59052] Fix | Delete
return true;
[59053] Fix | Delete
}
[59054] Fix | Delete
pos--;
[59055] Fix | Delete
}
[59056] Fix | Delete
} else {
[59057] Fix | Delete
let pos = 0;
[59058] Fix | Delete
while (pos <= scanLength) {
[59059] Fix | Delete
let j = 0;
[59060] Fix | Delete
while (j < signatureLength && scanBytes[pos + j] === signature[j]) {
[59061] Fix | Delete
j++;
[59062] Fix | Delete
}
[59063] Fix | Delete
if (j >= signatureLength) {
[59064] Fix | Delete
stream.pos += pos;
[59065] Fix | Delete
return true;
[59066] Fix | Delete
}
[59067] Fix | Delete
pos++;
[59068] Fix | Delete
}
[59069] Fix | Delete
}
[59070] Fix | Delete
return false;
[59071] Fix | Delete
}
[59072] Fix | Delete
class PDFDocument {
[59073] Fix | Delete
constructor(pdfManager, stream) {
[59074] Fix | Delete
if (stream.length <= 0) {
[59075] Fix | Delete
throw new InvalidPDFException("The PDF file is empty, i.e. its size is zero bytes.");
[59076] Fix | Delete
}
[59077] Fix | Delete
this.pdfManager = pdfManager;
[59078] Fix | Delete
this.stream = stream;
[59079] Fix | Delete
this.xref = new XRef(stream, pdfManager);
[59080] Fix | Delete
this._pagePromises = new Map();
[59081] Fix | Delete
this._version = null;
[59082] Fix | Delete
const idCounters = {
[59083] Fix | Delete
font: 0
[59084] Fix | Delete
};
[59085] Fix | Delete
this._globalIdFactory = class {
[59086] Fix | Delete
static getDocId() {
[59087] Fix | Delete
return `g_${pdfManager.docId}`;
[59088] Fix | Delete
}
[59089] Fix | Delete
static createFontId() {
[59090] Fix | Delete
return `f${++idCounters.font}`;
[59091] Fix | Delete
}
[59092] Fix | Delete
static createObjId() {
[59093] Fix | Delete
unreachable("Abstract method `createObjId` called.");
[59094] Fix | Delete
}
[59095] Fix | Delete
static getPageObjId() {
[59096] Fix | Delete
unreachable("Abstract method `getPageObjId` called.");
[59097] Fix | Delete
}
[59098] Fix | Delete
};
[59099] Fix | Delete
}
[59100] Fix | Delete
parse(recoveryMode) {
[59101] Fix | Delete
this.xref.parse(recoveryMode);
[59102] Fix | Delete
this.catalog = new Catalog(this.pdfManager, this.xref);
[59103] Fix | Delete
}
[59104] Fix | Delete
get linearization() {
[59105] Fix | Delete
let linearization = null;
[59106] Fix | Delete
try {
[59107] Fix | Delete
linearization = Linearization.create(this.stream);
[59108] Fix | Delete
} catch (err) {
[59109] Fix | Delete
if (err instanceof MissingDataException) {
[59110] Fix | Delete
throw err;
[59111] Fix | Delete
}
[59112] Fix | Delete
info(err);
[59113] Fix | Delete
}
[59114] Fix | Delete
return shadow(this, "linearization", linearization);
[59115] Fix | Delete
}
[59116] Fix | Delete
get startXRef() {
[59117] Fix | Delete
const stream = this.stream;
[59118] Fix | Delete
let startXRef = 0;
[59119] Fix | Delete
if (this.linearization) {
[59120] Fix | Delete
stream.reset();
[59121] Fix | Delete
if (find(stream, ENDOBJ_SIGNATURE)) {
[59122] Fix | Delete
stream.skip(6);
[59123] Fix | Delete
let ch = stream.peekByte();
[59124] Fix | Delete
while (isWhiteSpace(ch)) {
[59125] Fix | Delete
stream.pos++;
[59126] Fix | Delete
ch = stream.peekByte();
[59127] Fix | Delete
}
[59128] Fix | Delete
startXRef = stream.pos - stream.start;
[59129] Fix | Delete
}
[59130] Fix | Delete
} else {
[59131] Fix | Delete
const step = 1024;
[59132] Fix | Delete
const startXRefLength = STARTXREF_SIGNATURE.length;
[59133] Fix | Delete
let found = false,
[59134] Fix | Delete
pos = stream.end;
[59135] Fix | Delete
while (!found && pos > 0) {
[59136] Fix | Delete
pos -= step - startXRefLength;
[59137] Fix | Delete
if (pos < 0) {
[59138] Fix | Delete
pos = 0;
[59139] Fix | Delete
}
[59140] Fix | Delete
stream.pos = pos;
[59141] Fix | Delete
found = find(stream, STARTXREF_SIGNATURE, step, true);
[59142] Fix | Delete
}
[59143] Fix | Delete
if (found) {
[59144] Fix | Delete
stream.skip(9);
[59145] Fix | Delete
let ch;
[59146] Fix | Delete
do {
[59147] Fix | Delete
ch = stream.getByte();
[59148] Fix | Delete
} while (isWhiteSpace(ch));
[59149] Fix | Delete
let str = "";
[59150] Fix | Delete
while (ch >= 0x20 && ch <= 0x39) {
[59151] Fix | Delete
str += String.fromCharCode(ch);
[59152] Fix | Delete
ch = stream.getByte();
[59153] Fix | Delete
}
[59154] Fix | Delete
startXRef = parseInt(str, 10);
[59155] Fix | Delete
if (isNaN(startXRef)) {
[59156] Fix | Delete
startXRef = 0;
[59157] Fix | Delete
}
[59158] Fix | Delete
}
[59159] Fix | Delete
}
[59160] Fix | Delete
return shadow(this, "startXRef", startXRef);
[59161] Fix | Delete
}
[59162] Fix | Delete
checkHeader() {
[59163] Fix | Delete
const stream = this.stream;
[59164] Fix | Delete
stream.reset();
[59165] Fix | Delete
if (!find(stream, PDF_HEADER_SIGNATURE)) {
[59166] Fix | Delete
return;
[59167] Fix | Delete
}
[59168] Fix | Delete
stream.moveStart();
[59169] Fix | Delete
stream.skip(PDF_HEADER_SIGNATURE.length);
[59170] Fix | Delete
let version = "",
[59171] Fix | Delete
ch;
[59172] Fix | Delete
while ((ch = stream.getByte()) > 0x20 && version.length < 7) {
[59173] Fix | Delete
version += String.fromCharCode(ch);
[59174] Fix | Delete
}
[59175] Fix | Delete
if (PDF_VERSION_REGEXP.test(version)) {
[59176] Fix | Delete
this._version = version;
[59177] Fix | Delete
} else {
[59178] Fix | Delete
warn(`Invalid PDF header version: ${version}`);
[59179] Fix | Delete
}
[59180] Fix | Delete
}
[59181] Fix | Delete
parseStartXRef() {
[59182] Fix | Delete
this.xref.setStartXRef(this.startXRef);
[59183] Fix | Delete
}
[59184] Fix | Delete
get numPages() {
[59185] Fix | Delete
let num = 0;
[59186] Fix | Delete
if (this.catalog.hasActualNumPages) {
[59187] Fix | Delete
num = this.catalog.numPages;
[59188] Fix | Delete
} else if (this.xfaFactory) {
[59189] Fix | Delete
num = this.xfaFactory.getNumPages();
[59190] Fix | Delete
} else if (this.linearization) {
[59191] Fix | Delete
num = this.linearization.numPages;
[59192] Fix | Delete
} else {
[59193] Fix | Delete
num = this.catalog.numPages;
[59194] Fix | Delete
}
[59195] Fix | Delete
return shadow(this, "numPages", num);
[59196] Fix | Delete
}
[59197] Fix | Delete
_hasOnlyDocumentSignatures(fields, recursionDepth = 0) {
[59198] Fix | Delete
const RECURSION_LIMIT = 10;
[59199] Fix | Delete
if (!Array.isArray(fields)) {
[59200] Fix | Delete
return false;
[59201] Fix | Delete
}
[59202] Fix | Delete
return fields.every(field => {
[59203] Fix | Delete
field = this.xref.fetchIfRef(field);
[59204] Fix | Delete
if (!(field instanceof Dict)) {
[59205] Fix | Delete
return false;
[59206] Fix | Delete
}
[59207] Fix | Delete
if (field.has("Kids")) {
[59208] Fix | Delete
if (++recursionDepth > RECURSION_LIMIT) {
[59209] Fix | Delete
warn("_hasOnlyDocumentSignatures: maximum recursion depth reached");
[59210] Fix | Delete
return false;
[59211] Fix | Delete
}
[59212] Fix | Delete
return this._hasOnlyDocumentSignatures(field.get("Kids"), recursionDepth);
[59213] Fix | Delete
}
[59214] Fix | Delete
const isSignature = isName(field.get("FT"), "Sig");
[59215] Fix | Delete
const rectangle = field.get("Rect");
[59216] Fix | Delete
const isInvisible = Array.isArray(rectangle) && rectangle.every(value => value === 0);
[59217] Fix | Delete
return isSignature && isInvisible;
[59218] Fix | Delete
});
[59219] Fix | Delete
}
[59220] Fix | Delete
get _xfaStreams() {
[59221] Fix | Delete
const acroForm = this.catalog.acroForm;
[59222] Fix | Delete
if (!acroForm) {
[59223] Fix | Delete
return null;
[59224] Fix | Delete
}
[59225] Fix | Delete
const xfa = acroForm.get("XFA");
[59226] Fix | Delete
const entries = {
[59227] Fix | Delete
"xdp:xdp": "",
[59228] Fix | Delete
template: "",
[59229] Fix | Delete
datasets: "",
[59230] Fix | Delete
config: "",
[59231] Fix | Delete
connectionSet: "",
[59232] Fix | Delete
localeSet: "",
[59233] Fix | Delete
stylesheet: "",
[59234] Fix | Delete
"/xdp:xdp": ""
[59235] Fix | Delete
};
[59236] Fix | Delete
if (xfa instanceof BaseStream && !xfa.isEmpty) {
[59237] Fix | Delete
entries["xdp:xdp"] = xfa;
[59238] Fix | Delete
return entries;
[59239] Fix | Delete
}
[59240] Fix | Delete
if (!Array.isArray(xfa) || xfa.length === 0) {
[59241] Fix | Delete
return null;
[59242] Fix | Delete
}
[59243] Fix | Delete
for (let i = 0, ii = xfa.length; i < ii; i += 2) {
[59244] Fix | Delete
let name;
[59245] Fix | Delete
if (i === 0) {
[59246] Fix | Delete
name = "xdp:xdp";
[59247] Fix | Delete
} else if (i === ii - 2) {
[59248] Fix | Delete
name = "/xdp:xdp";
[59249] Fix | Delete
} else {
[59250] Fix | Delete
name = xfa[i];
[59251] Fix | Delete
}
[59252] Fix | Delete
if (!entries.hasOwnProperty(name)) {
[59253] Fix | Delete
continue;
[59254] Fix | Delete
}
[59255] Fix | Delete
const data = this.xref.fetchIfRef(xfa[i + 1]);
[59256] Fix | Delete
if (!(data instanceof BaseStream) || data.isEmpty) {
[59257] Fix | Delete
continue;
[59258] Fix | Delete
}
[59259] Fix | Delete
entries[name] = data;
[59260] Fix | Delete
}
[59261] Fix | Delete
return entries;
[59262] Fix | Delete
}
[59263] Fix | Delete
get xfaDatasets() {
[59264] Fix | Delete
const streams = this._xfaStreams;
[59265] Fix | Delete
if (!streams) {
[59266] Fix | Delete
return shadow(this, "xfaDatasets", null);
[59267] Fix | Delete
}
[59268] Fix | Delete
for (const key of ["datasets", "xdp:xdp"]) {
[59269] Fix | Delete
const stream = streams[key];
[59270] Fix | Delete
if (!stream) {
[59271] Fix | Delete
continue;
[59272] Fix | Delete
}
[59273] Fix | Delete
try {
[59274] Fix | Delete
const str = stringToUTF8String(stream.getString());
[59275] Fix | Delete
const data = {
[59276] Fix | Delete
[key]: str
[59277] Fix | Delete
};
[59278] Fix | Delete
return shadow(this, "xfaDatasets", new DatasetReader(data));
[59279] Fix | Delete
} catch {
[59280] Fix | Delete
warn("XFA - Invalid utf-8 string.");
[59281] Fix | Delete
break;
[59282] Fix | Delete
}
[59283] Fix | Delete
}
[59284] Fix | Delete
return shadow(this, "xfaDatasets", null);
[59285] Fix | Delete
}
[59286] Fix | Delete
get xfaData() {
[59287] Fix | Delete
const streams = this._xfaStreams;
[59288] Fix | Delete
if (!streams) {
[59289] Fix | Delete
return null;
[59290] Fix | Delete
}
[59291] Fix | Delete
const data = Object.create(null);
[59292] Fix | Delete
for (const [key, stream] of Object.entries(streams)) {
[59293] Fix | Delete
if (!stream) {
[59294] Fix | Delete
continue;
[59295] Fix | Delete
}
[59296] Fix | Delete
try {
[59297] Fix | Delete
data[key] = stringToUTF8String(stream.getString());
[59298] Fix | Delete
} catch {
[59299] Fix | Delete
warn("XFA - Invalid utf-8 string.");
[59300] Fix | Delete
return null;
[59301] Fix | Delete
}
[59302] Fix | Delete
}
[59303] Fix | Delete
return data;
[59304] Fix | Delete
}
[59305] Fix | Delete
get xfaFactory() {
[59306] Fix | Delete
let data;
[59307] Fix | Delete
if (this.pdfManager.enableXfa && this.catalog.needsRendering && this.formInfo.hasXfa && !this.formInfo.hasAcroForm) {
[59308] Fix | Delete
data = this.xfaData;
[59309] Fix | Delete
}
[59310] Fix | Delete
return shadow(this, "xfaFactory", data ? new XFAFactory(data) : null);
[59311] Fix | Delete
}
[59312] Fix | Delete
get isPureXfa() {
[59313] Fix | Delete
return this.xfaFactory ? this.xfaFactory.isValid() : false;
[59314] Fix | Delete
}
[59315] Fix | Delete
get htmlForXfa() {
[59316] Fix | Delete
return this.xfaFactory ? this.xfaFactory.getPages() : null;
[59317] Fix | Delete
}
[59318] Fix | Delete
async loadXfaImages() {
[59319] Fix | Delete
const xfaImagesDict = await this.pdfManager.ensureCatalog("xfaImages");
[59320] Fix | Delete
if (!xfaImagesDict) {
[59321] Fix | Delete
return;
[59322] Fix | Delete
}
[59323] Fix | Delete
const keys = xfaImagesDict.getKeys();
[59324] Fix | Delete
const objectLoader = new ObjectLoader(xfaImagesDict, keys, this.xref);
[59325] Fix | Delete
await objectLoader.load();
[59326] Fix | Delete
const xfaImages = new Map();
[59327] Fix | Delete
for (const key of keys) {
[59328] Fix | Delete
const stream = xfaImagesDict.get(key);
[59329] Fix | Delete
if (stream instanceof BaseStream) {
[59330] Fix | Delete
xfaImages.set(key, stream.getBytes());
[59331] Fix | Delete
}
[59332] Fix | Delete
}
[59333] Fix | Delete
this.xfaFactory.setImages(xfaImages);
[59334] Fix | Delete
}
[59335] Fix | Delete
async loadXfaFonts(handler, task) {
[59336] Fix | Delete
const acroForm = await this.pdfManager.ensureCatalog("acroForm");
[59337] Fix | Delete
if (!acroForm) {
[59338] Fix | Delete
return;
[59339] Fix | Delete
}
[59340] Fix | Delete
const resources = await acroForm.getAsync("DR");
[59341] Fix | Delete
if (!(resources instanceof Dict)) {
[59342] Fix | Delete
return;
[59343] Fix | Delete
}
[59344] Fix | Delete
const objectLoader = new ObjectLoader(resources, ["Font"], this.xref);
[59345] Fix | Delete
await objectLoader.load();
[59346] Fix | Delete
const fontRes = resources.get("Font");
[59347] Fix | Delete
if (!(fontRes instanceof Dict)) {
[59348] Fix | Delete
return;
[59349] Fix | Delete
}
[59350] Fix | Delete
const options = Object.assign(Object.create(null), this.pdfManager.evaluatorOptions);
[59351] Fix | Delete
options.useSystemFonts = false;
[59352] Fix | Delete
const partialEvaluator = new PartialEvaluator({
[59353] Fix | Delete
xref: this.xref,
[59354] Fix | Delete
handler,
[59355] Fix | Delete
pageIndex: -1,
[59356] Fix | Delete
idFactory: this._globalIdFactory,
[59357] Fix | Delete
fontCache: this.catalog.fontCache,
[59358] Fix | Delete
builtInCMapCache: this.catalog.builtInCMapCache,
[59359] Fix | Delete
standardFontDataCache: this.catalog.standardFontDataCache,
[59360] Fix | Delete
options
[59361] Fix | Delete
});
[59362] Fix | Delete
const operatorList = new OperatorList();
[59363] Fix | Delete
const pdfFonts = [];
[59364] Fix | Delete
const initialState = {
[59365] Fix | Delete
get font() {
[59366] Fix | Delete
return pdfFonts.at(-1);
[59367] Fix | Delete
},
[59368] Fix | Delete
set font(font) {
[59369] Fix | Delete
pdfFonts.push(font);
[59370] Fix | Delete
},
[59371] Fix | Delete
clone() {
[59372] Fix | Delete
return this;
[59373] Fix | Delete
}
[59374] Fix | Delete
};
[59375] Fix | Delete
const fonts = new Map();
[59376] Fix | Delete
fontRes.forEach((fontName, font) => {
[59377] Fix | Delete
fonts.set(fontName, font);
[59378] Fix | Delete
});
[59379] Fix | Delete
const promises = [];
[59380] Fix | Delete
for (const [fontName, font] of fonts) {
[59381] Fix | Delete
const descriptor = font.get("FontDescriptor");
[59382] Fix | Delete
if (!(descriptor instanceof Dict)) {
[59383] Fix | Delete
continue;
[59384] Fix | Delete
}
[59385] Fix | Delete
let fontFamily = descriptor.get("FontFamily");
[59386] Fix | Delete
fontFamily = fontFamily.replaceAll(/[ ]+(\d)/g, "$1");
[59387] Fix | Delete
const fontWeight = descriptor.get("FontWeight");
[59388] Fix | Delete
const italicAngle = -descriptor.get("ItalicAngle");
[59389] Fix | Delete
const cssFontInfo = {
[59390] Fix | Delete
fontFamily,
[59391] Fix | Delete
fontWeight,
[59392] Fix | Delete
italicAngle
[59393] Fix | Delete
};
[59394] Fix | Delete
if (!validateCSSFont(cssFontInfo)) {
[59395] Fix | Delete
continue;
[59396] Fix | Delete
}
[59397] Fix | Delete
promises.push(partialEvaluator.handleSetFont(resources, [Name.get(fontName), 1], null, operatorList, task, initialState, null, cssFontInfo).catch(function (reason) {
[59398] Fix | Delete
warn(`loadXfaFonts: "${reason}".`);
[59399] Fix | Delete
return null;
[59400] Fix | Delete
}));
[59401] Fix | Delete
}
[59402] Fix | Delete
await Promise.all(promises);
[59403] Fix | Delete
const missingFonts = this.xfaFactory.setFonts(pdfFonts);
[59404] Fix | Delete
if (!missingFonts) {
[59405] Fix | Delete
return;
[59406] Fix | Delete
}
[59407] Fix | Delete
options.ignoreErrors = true;
[59408] Fix | Delete
promises.length = 0;
[59409] Fix | Delete
pdfFonts.length = 0;
[59410] Fix | Delete
const reallyMissingFonts = new Set();
[59411] Fix | Delete
for (const missing of missingFonts) {
[59412] Fix | Delete
if (!getXfaFontName(`${missing}-Regular`)) {
[59413] Fix | Delete
reallyMissingFonts.add(missing);
[59414] Fix | Delete
}
[59415] Fix | Delete
}
[59416] Fix | Delete
if (reallyMissingFonts.size) {
[59417] Fix | Delete
missingFonts.push("PdfJS-Fallback");
[59418] Fix | Delete
}
[59419] Fix | Delete
for (const missing of missingFonts) {
[59420] Fix | Delete
if (reallyMissingFonts.has(missing)) {
[59421] Fix | Delete
continue;
[59422] Fix | Delete
}
[59423] Fix | Delete
for (const fontInfo of [{
[59424] Fix | Delete
name: "Regular",
[59425] Fix | Delete
fontWeight: 400,
[59426] Fix | Delete
italicAngle: 0
[59427] Fix | Delete
}, {
[59428] Fix | Delete
name: "Bold",
[59429] Fix | Delete
fontWeight: 700,
[59430] Fix | Delete
italicAngle: 0
[59431] Fix | Delete
}, {
[59432] Fix | Delete
name: "Italic",
[59433] Fix | Delete
fontWeight: 400,
[59434] Fix | Delete
italicAngle: 12
[59435] Fix | Delete
}, {
[59436] Fix | Delete
name: "BoldItalic",
[59437] Fix | Delete
fontWeight: 700,
[59438] Fix | Delete
italicAngle: 12
[59439] Fix | Delete
}]) {
[59440] Fix | Delete
const name = `${missing}-${fontInfo.name}`;
[59441] Fix | Delete
const dict = getXfaFontDict(name);
[59442] Fix | Delete
promises.push(partialEvaluator.handleSetFont(resources, [Name.get(name), 1], null, operatorList, task, initialState, dict, {
[59443] Fix | Delete
fontFamily: missing,
[59444] Fix | Delete
fontWeight: fontInfo.fontWeight,
[59445] Fix | Delete
italicAngle: fontInfo.italicAngle
[59446] Fix | Delete
}).catch(function (reason) {
[59447] Fix | Delete
warn(`loadXfaFonts: "${reason}".`);
[59448] Fix | Delete
return null;
[59449] Fix | Delete
}));
[59450] Fix | Delete
}
[59451] Fix | Delete
}
[59452] Fix | Delete
await Promise.all(promises);
[59453] Fix | Delete
this.xfaFactory.appendFonts(pdfFonts, reallyMissingFonts);
[59454] Fix | Delete
}
[59455] Fix | Delete
async serializeXfaData(annotationStorage) {
[59456] Fix | Delete
return this.xfaFactory ? this.xfaFactory.serializeData(annotationStorage) : null;
[59457] Fix | Delete
}
[59458] Fix | Delete
get version() {
[59459] Fix | Delete
return this.catalog.version || this._version;
[59460] Fix | Delete
}
[59461] Fix | Delete
get formInfo() {
[59462] Fix | Delete
const formInfo = {
[59463] Fix | Delete
hasFields: false,
[59464] Fix | Delete
hasAcroForm: false,
[59465] Fix | Delete
hasXfa: false,
[59466] Fix | Delete
hasSignatures: false
[59467] Fix | Delete
};
[59468] Fix | Delete
const acroForm = this.catalog.acroForm;
[59469] Fix | Delete
if (!acroForm) {
[59470] Fix | Delete
return shadow(this, "formInfo", formInfo);
[59471] Fix | Delete
}
[59472] Fix | Delete
try {
[59473] Fix | Delete
const fields = acroForm.get("Fields");
[59474] Fix | Delete
const hasFields = Array.isArray(fields) && fields.length > 0;
[59475] Fix | Delete
formInfo.hasFields = hasFields;
[59476] Fix | Delete
const xfa = acroForm.get("XFA");
[59477] Fix | Delete
formInfo.hasXfa = Array.isArray(xfa) && xfa.length > 0 || xfa instanceof BaseStream && !xfa.isEmpty;
[59478] Fix | Delete
const sigFlags = acroForm.get("SigFlags");
[59479] Fix | Delete
const hasSignatures = !!(sigFlags & 0x1);
[59480] Fix | Delete
const hasOnlyDocumentSignatures = hasSignatures && this._hasOnlyDocumentSignatures(fields);
[59481] Fix | Delete
formInfo.hasAcroForm = hasFields && !hasOnlyDocumentSignatures;
[59482] Fix | Delete
formInfo.hasSignatures = hasSignatures;
[59483] Fix | Delete
} catch (ex) {
[59484] Fix | Delete
if (ex instanceof MissingDataException) {
[59485] Fix | Delete
throw ex;
[59486] Fix | Delete
}
[59487] Fix | Delete
warn(`Cannot fetch form information: "${ex}".`);
[59488] Fix | Delete
}
[59489] Fix | Delete
return shadow(this, "formInfo", formInfo);
[59490] Fix | Delete
}
[59491] Fix | Delete
get documentInfo() {
[59492] Fix | Delete
const docInfo = {
[59493] Fix | Delete
PDFFormatVersion: this.version,
[59494] Fix | Delete
Language: this.catalog.lang,
[59495] Fix | Delete
EncryptFilterName: this.xref.encrypt ? this.xref.encrypt.filterName : null,
[59496] Fix | Delete
IsLinearized: !!this.linearization,
[59497] Fix | Delete
IsAcroFormPresent: this.formInfo.hasAcroForm,
[59498] Fix | Delete
IsXFAPresent: this.formInfo.hasXfa,
[59499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function