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
opList,
[55000] Fix | Delete
separateForm: false,
[55001] Fix | Delete
separateCanvas: isUsingOwnCanvas
[55002] Fix | Delete
};
[55003] Fix | Delete
}
[55004] Fix | Delete
async save(evaluator, task, annotationStorage) {
[55005] Fix | Delete
return null;
[55006] Fix | Delete
}
[55007] Fix | Delete
get hasTextContent() {
[55008] Fix | Delete
return false;
[55009] Fix | Delete
}
[55010] Fix | Delete
async extractTextContent(evaluator, task, viewBox) {
[55011] Fix | Delete
if (!this.appearance) {
[55012] Fix | Delete
return;
[55013] Fix | Delete
}
[55014] Fix | Delete
const resources = await this.loadResources(["ExtGState", "Font", "Properties", "XObject"], this.appearance);
[55015] Fix | Delete
const text = [];
[55016] Fix | Delete
const buffer = [];
[55017] Fix | Delete
let firstPosition = null;
[55018] Fix | Delete
const sink = {
[55019] Fix | Delete
desiredSize: Math.Infinity,
[55020] Fix | Delete
ready: true,
[55021] Fix | Delete
enqueue(chunk, size) {
[55022] Fix | Delete
for (const item of chunk.items) {
[55023] Fix | Delete
if (item.str === undefined) {
[55024] Fix | Delete
continue;
[55025] Fix | Delete
}
[55026] Fix | Delete
firstPosition ||= item.transform.slice(-2);
[55027] Fix | Delete
buffer.push(item.str);
[55028] Fix | Delete
if (item.hasEOL) {
[55029] Fix | Delete
text.push(buffer.join("").trimEnd());
[55030] Fix | Delete
buffer.length = 0;
[55031] Fix | Delete
}
[55032] Fix | Delete
}
[55033] Fix | Delete
}
[55034] Fix | Delete
};
[55035] Fix | Delete
await evaluator.getTextContent({
[55036] Fix | Delete
stream: this.appearance,
[55037] Fix | Delete
task,
[55038] Fix | Delete
resources,
[55039] Fix | Delete
includeMarkedContent: true,
[55040] Fix | Delete
keepWhiteSpace: true,
[55041] Fix | Delete
sink,
[55042] Fix | Delete
viewBox
[55043] Fix | Delete
});
[55044] Fix | Delete
this.reset();
[55045] Fix | Delete
if (buffer.length) {
[55046] Fix | Delete
text.push(buffer.join("").trimEnd());
[55047] Fix | Delete
}
[55048] Fix | Delete
if (text.length > 1 || text[0]) {
[55049] Fix | Delete
const appearanceDict = this.appearance.dict;
[55050] Fix | Delete
const bbox = lookupRect(appearanceDict.getArray("BBox"), null);
[55051] Fix | Delete
const matrix = lookupMatrix(appearanceDict.getArray("Matrix"), null);
[55052] Fix | Delete
this.data.textPosition = this._transformPoint(firstPosition, bbox, matrix);
[55053] Fix | Delete
this.data.textContent = text;
[55054] Fix | Delete
}
[55055] Fix | Delete
}
[55056] Fix | Delete
_transformPoint(coords, bbox, matrix) {
[55057] Fix | Delete
const {
[55058] Fix | Delete
rect
[55059] Fix | Delete
} = this.data;
[55060] Fix | Delete
bbox ||= [0, 0, 1, 1];
[55061] Fix | Delete
matrix ||= [1, 0, 0, 1, 0, 0];
[55062] Fix | Delete
const transform = getTransformMatrix(rect, bbox, matrix);
[55063] Fix | Delete
transform[4] -= rect[0];
[55064] Fix | Delete
transform[5] -= rect[1];
[55065] Fix | Delete
coords = Util.applyTransform(coords, transform);
[55066] Fix | Delete
return Util.applyTransform(coords, matrix);
[55067] Fix | Delete
}
[55068] Fix | Delete
getFieldObject() {
[55069] Fix | Delete
if (this.data.kidIds) {
[55070] Fix | Delete
return {
[55071] Fix | Delete
id: this.data.id,
[55072] Fix | Delete
actions: this.data.actions,
[55073] Fix | Delete
name: this.data.fieldName,
[55074] Fix | Delete
strokeColor: this.data.borderColor,
[55075] Fix | Delete
fillColor: this.data.backgroundColor,
[55076] Fix | Delete
type: "",
[55077] Fix | Delete
kidIds: this.data.kidIds,
[55078] Fix | Delete
page: this.data.pageIndex,
[55079] Fix | Delete
rotation: this.rotation
[55080] Fix | Delete
};
[55081] Fix | Delete
}
[55082] Fix | Delete
return null;
[55083] Fix | Delete
}
[55084] Fix | Delete
reset() {
[55085] Fix | Delete
for (const stream of this._streams) {
[55086] Fix | Delete
stream.reset();
[55087] Fix | Delete
}
[55088] Fix | Delete
}
[55089] Fix | Delete
_constructFieldName(dict) {
[55090] Fix | Delete
if (!dict.has("T") && !dict.has("Parent")) {
[55091] Fix | Delete
warn("Unknown field name, falling back to empty field name.");
[55092] Fix | Delete
return "";
[55093] Fix | Delete
}
[55094] Fix | Delete
if (!dict.has("Parent")) {
[55095] Fix | Delete
return stringToPDFString(dict.get("T"));
[55096] Fix | Delete
}
[55097] Fix | Delete
const fieldName = [];
[55098] Fix | Delete
if (dict.has("T")) {
[55099] Fix | Delete
fieldName.unshift(stringToPDFString(dict.get("T")));
[55100] Fix | Delete
}
[55101] Fix | Delete
let loopDict = dict;
[55102] Fix | Delete
const visited = new RefSet();
[55103] Fix | Delete
if (dict.objId) {
[55104] Fix | Delete
visited.put(dict.objId);
[55105] Fix | Delete
}
[55106] Fix | Delete
while (loopDict.has("Parent")) {
[55107] Fix | Delete
loopDict = loopDict.get("Parent");
[55108] Fix | Delete
if (!(loopDict instanceof Dict) || loopDict.objId && visited.has(loopDict.objId)) {
[55109] Fix | Delete
break;
[55110] Fix | Delete
}
[55111] Fix | Delete
if (loopDict.objId) {
[55112] Fix | Delete
visited.put(loopDict.objId);
[55113] Fix | Delete
}
[55114] Fix | Delete
if (loopDict.has("T")) {
[55115] Fix | Delete
fieldName.unshift(stringToPDFString(loopDict.get("T")));
[55116] Fix | Delete
}
[55117] Fix | Delete
}
[55118] Fix | Delete
return fieldName.join(".");
[55119] Fix | Delete
}
[55120] Fix | Delete
}
[55121] Fix | Delete
class AnnotationBorderStyle {
[55122] Fix | Delete
constructor() {
[55123] Fix | Delete
this.width = 1;
[55124] Fix | Delete
this.style = AnnotationBorderStyleType.SOLID;
[55125] Fix | Delete
this.dashArray = [3];
[55126] Fix | Delete
this.horizontalCornerRadius = 0;
[55127] Fix | Delete
this.verticalCornerRadius = 0;
[55128] Fix | Delete
}
[55129] Fix | Delete
setWidth(width, rect = [0, 0, 0, 0]) {
[55130] Fix | Delete
if (width instanceof Name) {
[55131] Fix | Delete
this.width = 0;
[55132] Fix | Delete
return;
[55133] Fix | Delete
}
[55134] Fix | Delete
if (typeof width === "number") {
[55135] Fix | Delete
if (width > 0) {
[55136] Fix | Delete
const maxWidth = (rect[2] - rect[0]) / 2;
[55137] Fix | Delete
const maxHeight = (rect[3] - rect[1]) / 2;
[55138] Fix | Delete
if (maxWidth > 0 && maxHeight > 0 && (width > maxWidth || width > maxHeight)) {
[55139] Fix | Delete
warn(`AnnotationBorderStyle.setWidth - ignoring width: ${width}`);
[55140] Fix | Delete
width = 1;
[55141] Fix | Delete
}
[55142] Fix | Delete
}
[55143] Fix | Delete
this.width = width;
[55144] Fix | Delete
}
[55145] Fix | Delete
}
[55146] Fix | Delete
setStyle(style) {
[55147] Fix | Delete
if (!(style instanceof Name)) {
[55148] Fix | Delete
return;
[55149] Fix | Delete
}
[55150] Fix | Delete
switch (style.name) {
[55151] Fix | Delete
case "S":
[55152] Fix | Delete
this.style = AnnotationBorderStyleType.SOLID;
[55153] Fix | Delete
break;
[55154] Fix | Delete
case "D":
[55155] Fix | Delete
this.style = AnnotationBorderStyleType.DASHED;
[55156] Fix | Delete
break;
[55157] Fix | Delete
case "B":
[55158] Fix | Delete
this.style = AnnotationBorderStyleType.BEVELED;
[55159] Fix | Delete
break;
[55160] Fix | Delete
case "I":
[55161] Fix | Delete
this.style = AnnotationBorderStyleType.INSET;
[55162] Fix | Delete
break;
[55163] Fix | Delete
case "U":
[55164] Fix | Delete
this.style = AnnotationBorderStyleType.UNDERLINE;
[55165] Fix | Delete
break;
[55166] Fix | Delete
default:
[55167] Fix | Delete
break;
[55168] Fix | Delete
}
[55169] Fix | Delete
}
[55170] Fix | Delete
setDashArray(dashArray, forceStyle = false) {
[55171] Fix | Delete
if (Array.isArray(dashArray)) {
[55172] Fix | Delete
let isValid = true;
[55173] Fix | Delete
let allZeros = true;
[55174] Fix | Delete
for (const element of dashArray) {
[55175] Fix | Delete
const validNumber = +element >= 0;
[55176] Fix | Delete
if (!validNumber) {
[55177] Fix | Delete
isValid = false;
[55178] Fix | Delete
break;
[55179] Fix | Delete
} else if (element > 0) {
[55180] Fix | Delete
allZeros = false;
[55181] Fix | Delete
}
[55182] Fix | Delete
}
[55183] Fix | Delete
if (dashArray.length === 0 || isValid && !allZeros) {
[55184] Fix | Delete
this.dashArray = dashArray;
[55185] Fix | Delete
if (forceStyle) {
[55186] Fix | Delete
this.setStyle(Name.get("D"));
[55187] Fix | Delete
}
[55188] Fix | Delete
} else {
[55189] Fix | Delete
this.width = 0;
[55190] Fix | Delete
}
[55191] Fix | Delete
} else if (dashArray) {
[55192] Fix | Delete
this.width = 0;
[55193] Fix | Delete
}
[55194] Fix | Delete
}
[55195] Fix | Delete
setHorizontalCornerRadius(radius) {
[55196] Fix | Delete
if (Number.isInteger(radius)) {
[55197] Fix | Delete
this.horizontalCornerRadius = radius;
[55198] Fix | Delete
}
[55199] Fix | Delete
}
[55200] Fix | Delete
setVerticalCornerRadius(radius) {
[55201] Fix | Delete
if (Number.isInteger(radius)) {
[55202] Fix | Delete
this.verticalCornerRadius = radius;
[55203] Fix | Delete
}
[55204] Fix | Delete
}
[55205] Fix | Delete
}
[55206] Fix | Delete
class MarkupAnnotation extends Annotation {
[55207] Fix | Delete
constructor(params) {
[55208] Fix | Delete
super(params);
[55209] Fix | Delete
const {
[55210] Fix | Delete
dict
[55211] Fix | Delete
} = params;
[55212] Fix | Delete
if (dict.has("IRT")) {
[55213] Fix | Delete
const rawIRT = dict.getRaw("IRT");
[55214] Fix | Delete
this.data.inReplyTo = rawIRT instanceof Ref ? rawIRT.toString() : null;
[55215] Fix | Delete
const rt = dict.get("RT");
[55216] Fix | Delete
this.data.replyType = rt instanceof Name ? rt.name : AnnotationReplyType.REPLY;
[55217] Fix | Delete
}
[55218] Fix | Delete
let popupRef = null;
[55219] Fix | Delete
if (this.data.replyType === AnnotationReplyType.GROUP) {
[55220] Fix | Delete
const parent = dict.get("IRT");
[55221] Fix | Delete
this.setTitle(parent.get("T"));
[55222] Fix | Delete
this.data.titleObj = this._title;
[55223] Fix | Delete
this.setContents(parent.get("Contents"));
[55224] Fix | Delete
this.data.contentsObj = this._contents;
[55225] Fix | Delete
if (!parent.has("CreationDate")) {
[55226] Fix | Delete
this.data.creationDate = null;
[55227] Fix | Delete
} else {
[55228] Fix | Delete
this.setCreationDate(parent.get("CreationDate"));
[55229] Fix | Delete
this.data.creationDate = this.creationDate;
[55230] Fix | Delete
}
[55231] Fix | Delete
if (!parent.has("M")) {
[55232] Fix | Delete
this.data.modificationDate = null;
[55233] Fix | Delete
} else {
[55234] Fix | Delete
this.setModificationDate(parent.get("M"));
[55235] Fix | Delete
this.data.modificationDate = this.modificationDate;
[55236] Fix | Delete
}
[55237] Fix | Delete
popupRef = parent.getRaw("Popup");
[55238] Fix | Delete
if (!parent.has("C")) {
[55239] Fix | Delete
this.data.color = null;
[55240] Fix | Delete
} else {
[55241] Fix | Delete
this.setColor(parent.getArray("C"));
[55242] Fix | Delete
this.data.color = this.color;
[55243] Fix | Delete
}
[55244] Fix | Delete
} else {
[55245] Fix | Delete
this.data.titleObj = this._title;
[55246] Fix | Delete
this.setCreationDate(dict.get("CreationDate"));
[55247] Fix | Delete
this.data.creationDate = this.creationDate;
[55248] Fix | Delete
popupRef = dict.getRaw("Popup");
[55249] Fix | Delete
if (!dict.has("C")) {
[55250] Fix | Delete
this.data.color = null;
[55251] Fix | Delete
}
[55252] Fix | Delete
}
[55253] Fix | Delete
this.data.popupRef = popupRef instanceof Ref ? popupRef.toString() : null;
[55254] Fix | Delete
if (dict.has("RC")) {
[55255] Fix | Delete
this.data.richText = XFAFactory.getRichTextAsHtml(dict.get("RC"));
[55256] Fix | Delete
}
[55257] Fix | Delete
}
[55258] Fix | Delete
setCreationDate(creationDate) {
[55259] Fix | Delete
this.creationDate = typeof creationDate === "string" ? creationDate : null;
[55260] Fix | Delete
}
[55261] Fix | Delete
_setDefaultAppearance({
[55262] Fix | Delete
xref,
[55263] Fix | Delete
extra,
[55264] Fix | Delete
strokeColor,
[55265] Fix | Delete
fillColor,
[55266] Fix | Delete
blendMode,
[55267] Fix | Delete
strokeAlpha,
[55268] Fix | Delete
fillAlpha,
[55269] Fix | Delete
pointsCallback
[55270] Fix | Delete
}) {
[55271] Fix | Delete
let minX = Number.MAX_VALUE;
[55272] Fix | Delete
let minY = Number.MAX_VALUE;
[55273] Fix | Delete
let maxX = Number.MIN_VALUE;
[55274] Fix | Delete
let maxY = Number.MIN_VALUE;
[55275] Fix | Delete
const buffer = ["q"];
[55276] Fix | Delete
if (extra) {
[55277] Fix | Delete
buffer.push(extra);
[55278] Fix | Delete
}
[55279] Fix | Delete
if (strokeColor) {
[55280] Fix | Delete
buffer.push(`${strokeColor[0]} ${strokeColor[1]} ${strokeColor[2]} RG`);
[55281] Fix | Delete
}
[55282] Fix | Delete
if (fillColor) {
[55283] Fix | Delete
buffer.push(`${fillColor[0]} ${fillColor[1]} ${fillColor[2]} rg`);
[55284] Fix | Delete
}
[55285] Fix | Delete
let pointsArray = this.data.quadPoints;
[55286] Fix | Delete
if (!pointsArray) {
[55287] Fix | Delete
pointsArray = [[{
[55288] Fix | Delete
x: this.rectangle[0],
[55289] Fix | Delete
y: this.rectangle[3]
[55290] Fix | Delete
}, {
[55291] Fix | Delete
x: this.rectangle[2],
[55292] Fix | Delete
y: this.rectangle[3]
[55293] Fix | Delete
}, {
[55294] Fix | Delete
x: this.rectangle[0],
[55295] Fix | Delete
y: this.rectangle[1]
[55296] Fix | Delete
}, {
[55297] Fix | Delete
x: this.rectangle[2],
[55298] Fix | Delete
y: this.rectangle[1]
[55299] Fix | Delete
}]];
[55300] Fix | Delete
}
[55301] Fix | Delete
for (const points of pointsArray) {
[55302] Fix | Delete
const [mX, MX, mY, MY] = pointsCallback(buffer, points);
[55303] Fix | Delete
minX = Math.min(minX, mX);
[55304] Fix | Delete
maxX = Math.max(maxX, MX);
[55305] Fix | Delete
minY = Math.min(minY, mY);
[55306] Fix | Delete
maxY = Math.max(maxY, MY);
[55307] Fix | Delete
}
[55308] Fix | Delete
buffer.push("Q");
[55309] Fix | Delete
const formDict = new Dict(xref);
[55310] Fix | Delete
const appearanceStreamDict = new Dict(xref);
[55311] Fix | Delete
appearanceStreamDict.set("Subtype", Name.get("Form"));
[55312] Fix | Delete
const appearanceStream = new StringStream(buffer.join(" "));
[55313] Fix | Delete
appearanceStream.dict = appearanceStreamDict;
[55314] Fix | Delete
formDict.set("Fm0", appearanceStream);
[55315] Fix | Delete
const gsDict = new Dict(xref);
[55316] Fix | Delete
if (blendMode) {
[55317] Fix | Delete
gsDict.set("BM", Name.get(blendMode));
[55318] Fix | Delete
}
[55319] Fix | Delete
if (typeof strokeAlpha === "number") {
[55320] Fix | Delete
gsDict.set("CA", strokeAlpha);
[55321] Fix | Delete
}
[55322] Fix | Delete
if (typeof fillAlpha === "number") {
[55323] Fix | Delete
gsDict.set("ca", fillAlpha);
[55324] Fix | Delete
}
[55325] Fix | Delete
const stateDict = new Dict(xref);
[55326] Fix | Delete
stateDict.set("GS0", gsDict);
[55327] Fix | Delete
const resources = new Dict(xref);
[55328] Fix | Delete
resources.set("ExtGState", stateDict);
[55329] Fix | Delete
resources.set("XObject", formDict);
[55330] Fix | Delete
const appearanceDict = new Dict(xref);
[55331] Fix | Delete
appearanceDict.set("Resources", resources);
[55332] Fix | Delete
const bbox = this.data.rect = [minX, minY, maxX, maxY];
[55333] Fix | Delete
appearanceDict.set("BBox", bbox);
[55334] Fix | Delete
this.appearance = new StringStream("/GS0 gs /Fm0 Do");
[55335] Fix | Delete
this.appearance.dict = appearanceDict;
[55336] Fix | Delete
this._streams.push(this.appearance, appearanceStream);
[55337] Fix | Delete
}
[55338] Fix | Delete
static async createNewAnnotation(xref, annotation, dependencies, params) {
[55339] Fix | Delete
const annotationRef = annotation.ref ||= xref.getNewTemporaryRef();
[55340] Fix | Delete
const ap = await this.createNewAppearanceStream(annotation, xref, params);
[55341] Fix | Delete
const buffer = [];
[55342] Fix | Delete
let annotationDict;
[55343] Fix | Delete
if (ap) {
[55344] Fix | Delete
const apRef = xref.getNewTemporaryRef();
[55345] Fix | Delete
annotationDict = this.createNewDict(annotation, xref, {
[55346] Fix | Delete
apRef
[55347] Fix | Delete
});
[55348] Fix | Delete
await writeObject(apRef, ap, buffer, xref);
[55349] Fix | Delete
dependencies.push({
[55350] Fix | Delete
ref: apRef,
[55351] Fix | Delete
data: buffer.join("")
[55352] Fix | Delete
});
[55353] Fix | Delete
} else {
[55354] Fix | Delete
annotationDict = this.createNewDict(annotation, xref, {});
[55355] Fix | Delete
}
[55356] Fix | Delete
if (Number.isInteger(annotation.parentTreeId)) {
[55357] Fix | Delete
annotationDict.set("StructParent", annotation.parentTreeId);
[55358] Fix | Delete
}
[55359] Fix | Delete
buffer.length = 0;
[55360] Fix | Delete
await writeObject(annotationRef, annotationDict, buffer, xref);
[55361] Fix | Delete
return {
[55362] Fix | Delete
ref: annotationRef,
[55363] Fix | Delete
data: buffer.join("")
[55364] Fix | Delete
};
[55365] Fix | Delete
}
[55366] Fix | Delete
static async createNewPrintAnnotation(annotationGlobals, xref, annotation, params) {
[55367] Fix | Delete
const ap = await this.createNewAppearanceStream(annotation, xref, params);
[55368] Fix | Delete
const annotationDict = this.createNewDict(annotation, xref, {
[55369] Fix | Delete
ap
[55370] Fix | Delete
});
[55371] Fix | Delete
const newAnnotation = new this.prototype.constructor({
[55372] Fix | Delete
dict: annotationDict,
[55373] Fix | Delete
xref,
[55374] Fix | Delete
annotationGlobals,
[55375] Fix | Delete
evaluatorOptions: params.evaluatorOptions
[55376] Fix | Delete
});
[55377] Fix | Delete
if (annotation.ref) {
[55378] Fix | Delete
newAnnotation.ref = newAnnotation.refToReplace = annotation.ref;
[55379] Fix | Delete
}
[55380] Fix | Delete
return newAnnotation;
[55381] Fix | Delete
}
[55382] Fix | Delete
}
[55383] Fix | Delete
class WidgetAnnotation extends Annotation {
[55384] Fix | Delete
constructor(params) {
[55385] Fix | Delete
super(params);
[55386] Fix | Delete
const {
[55387] Fix | Delete
dict,
[55388] Fix | Delete
xref,
[55389] Fix | Delete
annotationGlobals
[55390] Fix | Delete
} = params;
[55391] Fix | Delete
const data = this.data;
[55392] Fix | Delete
this._needAppearances = params.needAppearances;
[55393] Fix | Delete
data.annotationType = AnnotationType.WIDGET;
[55394] Fix | Delete
if (data.fieldName === undefined) {
[55395] Fix | Delete
data.fieldName = this._constructFieldName(dict);
[55396] Fix | Delete
}
[55397] Fix | Delete
if (data.actions === undefined) {
[55398] Fix | Delete
data.actions = collectActions(xref, dict, AnnotationActionEventType);
[55399] Fix | Delete
}
[55400] Fix | Delete
let fieldValue = getInheritableProperty({
[55401] Fix | Delete
dict,
[55402] Fix | Delete
key: "V",
[55403] Fix | Delete
getArray: true
[55404] Fix | Delete
});
[55405] Fix | Delete
data.fieldValue = this._decodeFormValue(fieldValue);
[55406] Fix | Delete
const defaultFieldValue = getInheritableProperty({
[55407] Fix | Delete
dict,
[55408] Fix | Delete
key: "DV",
[55409] Fix | Delete
getArray: true
[55410] Fix | Delete
});
[55411] Fix | Delete
data.defaultFieldValue = this._decodeFormValue(defaultFieldValue);
[55412] Fix | Delete
if (fieldValue === undefined && annotationGlobals.xfaDatasets) {
[55413] Fix | Delete
const path = this._title.str;
[55414] Fix | Delete
if (path) {
[55415] Fix | Delete
this._hasValueFromXFA = true;
[55416] Fix | Delete
data.fieldValue = fieldValue = annotationGlobals.xfaDatasets.getValue(path);
[55417] Fix | Delete
}
[55418] Fix | Delete
}
[55419] Fix | Delete
if (fieldValue === undefined && data.defaultFieldValue !== null) {
[55420] Fix | Delete
data.fieldValue = data.defaultFieldValue;
[55421] Fix | Delete
}
[55422] Fix | Delete
data.alternativeText = stringToPDFString(dict.get("TU") || "");
[55423] Fix | Delete
this.setDefaultAppearance(params);
[55424] Fix | Delete
data.hasAppearance ||= this._needAppearances && data.fieldValue !== undefined && data.fieldValue !== null;
[55425] Fix | Delete
const fieldType = getInheritableProperty({
[55426] Fix | Delete
dict,
[55427] Fix | Delete
key: "FT"
[55428] Fix | Delete
});
[55429] Fix | Delete
data.fieldType = fieldType instanceof Name ? fieldType.name : null;
[55430] Fix | Delete
const localResources = getInheritableProperty({
[55431] Fix | Delete
dict,
[55432] Fix | Delete
key: "DR"
[55433] Fix | Delete
});
[55434] Fix | Delete
const acroFormResources = annotationGlobals.acroForm.get("DR");
[55435] Fix | Delete
const appearanceResources = this.appearance?.dict.get("Resources");
[55436] Fix | Delete
this._fieldResources = {
[55437] Fix | Delete
localResources,
[55438] Fix | Delete
acroFormResources,
[55439] Fix | Delete
appearanceResources,
[55440] Fix | Delete
mergedResources: Dict.merge({
[55441] Fix | Delete
xref,
[55442] Fix | Delete
dictArray: [localResources, appearanceResources, acroFormResources],
[55443] Fix | Delete
mergeSubDicts: true
[55444] Fix | Delete
})
[55445] Fix | Delete
};
[55446] Fix | Delete
data.fieldFlags = getInheritableProperty({
[55447] Fix | Delete
dict,
[55448] Fix | Delete
key: "Ff"
[55449] Fix | Delete
});
[55450] Fix | Delete
if (!Number.isInteger(data.fieldFlags) || data.fieldFlags < 0) {
[55451] Fix | Delete
data.fieldFlags = 0;
[55452] Fix | Delete
}
[55453] Fix | Delete
data.readOnly = this.hasFieldFlag(AnnotationFieldFlag.READONLY);
[55454] Fix | Delete
data.required = this.hasFieldFlag(AnnotationFieldFlag.REQUIRED);
[55455] Fix | Delete
data.hidden = this._hasFlag(data.annotationFlags, AnnotationFlag.HIDDEN) || this._hasFlag(data.annotationFlags, AnnotationFlag.NOVIEW);
[55456] Fix | Delete
}
[55457] Fix | Delete
_decodeFormValue(formValue) {
[55458] Fix | Delete
if (Array.isArray(formValue)) {
[55459] Fix | Delete
return formValue.filter(item => typeof item === "string").map(item => stringToPDFString(item));
[55460] Fix | Delete
} else if (formValue instanceof Name) {
[55461] Fix | Delete
return stringToPDFString(formValue.name);
[55462] Fix | Delete
} else if (typeof formValue === "string") {
[55463] Fix | Delete
return stringToPDFString(formValue);
[55464] Fix | Delete
}
[55465] Fix | Delete
return null;
[55466] Fix | Delete
}
[55467] Fix | Delete
hasFieldFlag(flag) {
[55468] Fix | Delete
return !!(this.data.fieldFlags & flag);
[55469] Fix | Delete
}
[55470] Fix | Delete
_isViewable(flags) {
[55471] Fix | Delete
return true;
[55472] Fix | Delete
}
[55473] Fix | Delete
mustBeViewed(annotationStorage, renderForms) {
[55474] Fix | Delete
if (renderForms) {
[55475] Fix | Delete
return this.viewable;
[55476] Fix | Delete
}
[55477] Fix | Delete
return super.mustBeViewed(annotationStorage, renderForms) && !this._hasFlag(this.flags, AnnotationFlag.NOVIEW);
[55478] Fix | Delete
}
[55479] Fix | Delete
getRotationMatrix(annotationStorage) {
[55480] Fix | Delete
let rotation = annotationStorage?.get(this.data.id)?.rotation;
[55481] Fix | Delete
if (rotation === undefined) {
[55482] Fix | Delete
rotation = this.rotation;
[55483] Fix | Delete
}
[55484] Fix | Delete
if (rotation === 0) {
[55485] Fix | Delete
return IDENTITY_MATRIX;
[55486] Fix | Delete
}
[55487] Fix | Delete
const width = this.data.rect[2] - this.data.rect[0];
[55488] Fix | Delete
const height = this.data.rect[3] - this.data.rect[1];
[55489] Fix | Delete
return getRotationMatrix(rotation, width, height);
[55490] Fix | Delete
}
[55491] Fix | Delete
getBorderAndBackgroundAppearances(annotationStorage) {
[55492] Fix | Delete
let rotation = annotationStorage?.get(this.data.id)?.rotation;
[55493] Fix | Delete
if (rotation === undefined) {
[55494] Fix | Delete
rotation = this.rotation;
[55495] Fix | Delete
}
[55496] Fix | Delete
if (!this.backgroundColor && !this.borderColor) {
[55497] Fix | Delete
return "";
[55498] Fix | Delete
}
[55499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function