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
}
[57000] Fix | Delete
}
[57001] Fix | Delete
}
[57002] Fix | Delete
class CircleAnnotation extends MarkupAnnotation {
[57003] Fix | Delete
constructor(params) {
[57004] Fix | Delete
super(params);
[57005] Fix | Delete
const {
[57006] Fix | Delete
dict,
[57007] Fix | Delete
xref
[57008] Fix | Delete
} = params;
[57009] Fix | Delete
this.data.annotationType = AnnotationType.CIRCLE;
[57010] Fix | Delete
if (!this.appearance) {
[57011] Fix | Delete
const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0];
[57012] Fix | Delete
const strokeAlpha = dict.get("CA");
[57013] Fix | Delete
const interiorColor = getRgbColor(dict.getArray("IC"), null);
[57014] Fix | Delete
const fillColor = interiorColor ? getPdfColorArray(interiorColor) : null;
[57015] Fix | Delete
const fillAlpha = fillColor ? strokeAlpha : null;
[57016] Fix | Delete
if (this.borderStyle.width === 0 && !fillColor) {
[57017] Fix | Delete
return;
[57018] Fix | Delete
}
[57019] Fix | Delete
const controlPointsDistance = 4 / 3 * Math.tan(Math.PI / (2 * 4));
[57020] Fix | Delete
this._setDefaultAppearance({
[57021] Fix | Delete
xref,
[57022] Fix | Delete
extra: `${this.borderStyle.width} w`,
[57023] Fix | Delete
strokeColor,
[57024] Fix | Delete
fillColor,
[57025] Fix | Delete
strokeAlpha,
[57026] Fix | Delete
fillAlpha,
[57027] Fix | Delete
pointsCallback: (buffer, points) => {
[57028] Fix | Delete
const x0 = points[0].x + this.borderStyle.width / 2;
[57029] Fix | Delete
const y0 = points[0].y - this.borderStyle.width / 2;
[57030] Fix | Delete
const x1 = points[3].x - this.borderStyle.width / 2;
[57031] Fix | Delete
const y1 = points[3].y + this.borderStyle.width / 2;
[57032] Fix | Delete
const xMid = x0 + (x1 - x0) / 2;
[57033] Fix | Delete
const yMid = y0 + (y1 - y0) / 2;
[57034] Fix | Delete
const xOffset = (x1 - x0) / 2 * controlPointsDistance;
[57035] Fix | Delete
const yOffset = (y1 - y0) / 2 * controlPointsDistance;
[57036] Fix | Delete
buffer.push(`${xMid} ${y1} m`, `${xMid + xOffset} ${y1} ${x1} ${yMid + yOffset} ${x1} ${yMid} c`, `${x1} ${yMid - yOffset} ${xMid + xOffset} ${y0} ${xMid} ${y0} c`, `${xMid - xOffset} ${y0} ${x0} ${yMid - yOffset} ${x0} ${yMid} c`, `${x0} ${yMid + yOffset} ${xMid - xOffset} ${y1} ${xMid} ${y1} c`, "h");
[57037] Fix | Delete
if (fillColor) {
[57038] Fix | Delete
buffer.push("B");
[57039] Fix | Delete
} else {
[57040] Fix | Delete
buffer.push("S");
[57041] Fix | Delete
}
[57042] Fix | Delete
return [points[0].x, points[1].x, points[3].y, points[1].y];
[57043] Fix | Delete
}
[57044] Fix | Delete
});
[57045] Fix | Delete
}
[57046] Fix | Delete
}
[57047] Fix | Delete
}
[57048] Fix | Delete
class PolylineAnnotation extends MarkupAnnotation {
[57049] Fix | Delete
constructor(params) {
[57050] Fix | Delete
super(params);
[57051] Fix | Delete
const {
[57052] Fix | Delete
dict,
[57053] Fix | Delete
xref
[57054] Fix | Delete
} = params;
[57055] Fix | Delete
this.data.annotationType = AnnotationType.POLYLINE;
[57056] Fix | Delete
this.data.hasOwnCanvas = this.data.noRotate;
[57057] Fix | Delete
this.data.noHTML = false;
[57058] Fix | Delete
this.data.vertices = [];
[57059] Fix | Delete
if (!(this instanceof PolygonAnnotation)) {
[57060] Fix | Delete
this.setLineEndings(dict.getArray("LE"));
[57061] Fix | Delete
this.data.lineEndings = this.lineEndings;
[57062] Fix | Delete
}
[57063] Fix | Delete
const rawVertices = dict.getArray("Vertices");
[57064] Fix | Delete
if (!isNumberArray(rawVertices, null)) {
[57065] Fix | Delete
return;
[57066] Fix | Delete
}
[57067] Fix | Delete
for (let i = 0, ii = rawVertices.length; i < ii; i += 2) {
[57068] Fix | Delete
this.data.vertices.push({
[57069] Fix | Delete
x: rawVertices[i],
[57070] Fix | Delete
y: rawVertices[i + 1]
[57071] Fix | Delete
});
[57072] Fix | Delete
}
[57073] Fix | Delete
if (!this.appearance) {
[57074] Fix | Delete
const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0];
[57075] Fix | Delete
const strokeAlpha = dict.get("CA");
[57076] Fix | Delete
const borderWidth = this.borderStyle.width || 1,
[57077] Fix | Delete
borderAdjust = 2 * borderWidth;
[57078] Fix | Delete
const bbox = [Infinity, Infinity, -Infinity, -Infinity];
[57079] Fix | Delete
for (const vertex of this.data.vertices) {
[57080] Fix | Delete
bbox[0] = Math.min(bbox[0], vertex.x - borderAdjust);
[57081] Fix | Delete
bbox[1] = Math.min(bbox[1], vertex.y - borderAdjust);
[57082] Fix | Delete
bbox[2] = Math.max(bbox[2], vertex.x + borderAdjust);
[57083] Fix | Delete
bbox[3] = Math.max(bbox[3], vertex.y + borderAdjust);
[57084] Fix | Delete
}
[57085] Fix | Delete
if (!Util.intersect(this.rectangle, bbox)) {
[57086] Fix | Delete
this.rectangle = bbox;
[57087] Fix | Delete
}
[57088] Fix | Delete
this._setDefaultAppearance({
[57089] Fix | Delete
xref,
[57090] Fix | Delete
extra: `${borderWidth} w`,
[57091] Fix | Delete
strokeColor,
[57092] Fix | Delete
strokeAlpha,
[57093] Fix | Delete
pointsCallback: (buffer, points) => {
[57094] Fix | Delete
const vertices = this.data.vertices;
[57095] Fix | Delete
for (let i = 0, ii = vertices.length; i < ii; i++) {
[57096] Fix | Delete
buffer.push(`${vertices[i].x} ${vertices[i].y} ${i === 0 ? "m" : "l"}`);
[57097] Fix | Delete
}
[57098] Fix | Delete
buffer.push("S");
[57099] Fix | Delete
return [points[0].x, points[1].x, points[3].y, points[1].y];
[57100] Fix | Delete
}
[57101] Fix | Delete
});
[57102] Fix | Delete
}
[57103] Fix | Delete
}
[57104] Fix | Delete
}
[57105] Fix | Delete
class PolygonAnnotation extends PolylineAnnotation {
[57106] Fix | Delete
constructor(params) {
[57107] Fix | Delete
super(params);
[57108] Fix | Delete
this.data.annotationType = AnnotationType.POLYGON;
[57109] Fix | Delete
}
[57110] Fix | Delete
}
[57111] Fix | Delete
class CaretAnnotation extends MarkupAnnotation {
[57112] Fix | Delete
constructor(params) {
[57113] Fix | Delete
super(params);
[57114] Fix | Delete
this.data.annotationType = AnnotationType.CARET;
[57115] Fix | Delete
}
[57116] Fix | Delete
}
[57117] Fix | Delete
class InkAnnotation extends MarkupAnnotation {
[57118] Fix | Delete
constructor(params) {
[57119] Fix | Delete
super(params);
[57120] Fix | Delete
this.data.hasOwnCanvas = this.data.noRotate;
[57121] Fix | Delete
this.data.noHTML = false;
[57122] Fix | Delete
const {
[57123] Fix | Delete
dict,
[57124] Fix | Delete
xref
[57125] Fix | Delete
} = params;
[57126] Fix | Delete
this.data.annotationType = AnnotationType.INK;
[57127] Fix | Delete
this.data.inkLists = [];
[57128] Fix | Delete
const rawInkLists = dict.getArray("InkList");
[57129] Fix | Delete
if (!Array.isArray(rawInkLists)) {
[57130] Fix | Delete
return;
[57131] Fix | Delete
}
[57132] Fix | Delete
for (let i = 0, ii = rawInkLists.length; i < ii; ++i) {
[57133] Fix | Delete
this.data.inkLists.push([]);
[57134] Fix | Delete
if (!Array.isArray(rawInkLists[i])) {
[57135] Fix | Delete
continue;
[57136] Fix | Delete
}
[57137] Fix | Delete
for (let j = 0, jj = rawInkLists[i].length; j < jj; j += 2) {
[57138] Fix | Delete
const x = xref.fetchIfRef(rawInkLists[i][j]),
[57139] Fix | Delete
y = xref.fetchIfRef(rawInkLists[i][j + 1]);
[57140] Fix | Delete
if (typeof x === "number" && typeof y === "number") {
[57141] Fix | Delete
this.data.inkLists[i].push({
[57142] Fix | Delete
x,
[57143] Fix | Delete
y
[57144] Fix | Delete
});
[57145] Fix | Delete
}
[57146] Fix | Delete
}
[57147] Fix | Delete
}
[57148] Fix | Delete
if (!this.appearance) {
[57149] Fix | Delete
const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0];
[57150] Fix | Delete
const strokeAlpha = dict.get("CA");
[57151] Fix | Delete
const borderWidth = this.borderStyle.width || 1,
[57152] Fix | Delete
borderAdjust = 2 * borderWidth;
[57153] Fix | Delete
const bbox = [Infinity, Infinity, -Infinity, -Infinity];
[57154] Fix | Delete
for (const inkLists of this.data.inkLists) {
[57155] Fix | Delete
for (const vertex of inkLists) {
[57156] Fix | Delete
bbox[0] = Math.min(bbox[0], vertex.x - borderAdjust);
[57157] Fix | Delete
bbox[1] = Math.min(bbox[1], vertex.y - borderAdjust);
[57158] Fix | Delete
bbox[2] = Math.max(bbox[2], vertex.x + borderAdjust);
[57159] Fix | Delete
bbox[3] = Math.max(bbox[3], vertex.y + borderAdjust);
[57160] Fix | Delete
}
[57161] Fix | Delete
}
[57162] Fix | Delete
if (!Util.intersect(this.rectangle, bbox)) {
[57163] Fix | Delete
this.rectangle = bbox;
[57164] Fix | Delete
}
[57165] Fix | Delete
this._setDefaultAppearance({
[57166] Fix | Delete
xref,
[57167] Fix | Delete
extra: `${borderWidth} w`,
[57168] Fix | Delete
strokeColor,
[57169] Fix | Delete
strokeAlpha,
[57170] Fix | Delete
pointsCallback: (buffer, points) => {
[57171] Fix | Delete
for (const inkList of this.data.inkLists) {
[57172] Fix | Delete
for (let i = 0, ii = inkList.length; i < ii; i++) {
[57173] Fix | Delete
buffer.push(`${inkList[i].x} ${inkList[i].y} ${i === 0 ? "m" : "l"}`);
[57174] Fix | Delete
}
[57175] Fix | Delete
buffer.push("S");
[57176] Fix | Delete
}
[57177] Fix | Delete
return [points[0].x, points[1].x, points[3].y, points[1].y];
[57178] Fix | Delete
}
[57179] Fix | Delete
});
[57180] Fix | Delete
}
[57181] Fix | Delete
}
[57182] Fix | Delete
static createNewDict(annotation, xref, {
[57183] Fix | Delete
apRef,
[57184] Fix | Delete
ap
[57185] Fix | Delete
}) {
[57186] Fix | Delete
const {
[57187] Fix | Delete
color,
[57188] Fix | Delete
opacity,
[57189] Fix | Delete
paths,
[57190] Fix | Delete
outlines,
[57191] Fix | Delete
rect,
[57192] Fix | Delete
rotation,
[57193] Fix | Delete
thickness
[57194] Fix | Delete
} = annotation;
[57195] Fix | Delete
const ink = new Dict(xref);
[57196] Fix | Delete
ink.set("Type", Name.get("Annot"));
[57197] Fix | Delete
ink.set("Subtype", Name.get("Ink"));
[57198] Fix | Delete
ink.set("CreationDate", `D:${getModificationDate()}`);
[57199] Fix | Delete
ink.set("Rect", rect);
[57200] Fix | Delete
ink.set("InkList", outlines?.points || paths.map(p => p.points));
[57201] Fix | Delete
ink.set("F", 4);
[57202] Fix | Delete
ink.set("Rotate", rotation);
[57203] Fix | Delete
if (outlines) {
[57204] Fix | Delete
ink.set("IT", Name.get("InkHighlight"));
[57205] Fix | Delete
}
[57206] Fix | Delete
const bs = new Dict(xref);
[57207] Fix | Delete
ink.set("BS", bs);
[57208] Fix | Delete
bs.set("W", thickness);
[57209] Fix | Delete
ink.set("C", Array.from(color, c => c / 255));
[57210] Fix | Delete
ink.set("CA", opacity);
[57211] Fix | Delete
const n = new Dict(xref);
[57212] Fix | Delete
ink.set("AP", n);
[57213] Fix | Delete
if (apRef) {
[57214] Fix | Delete
n.set("N", apRef);
[57215] Fix | Delete
} else {
[57216] Fix | Delete
n.set("N", ap);
[57217] Fix | Delete
}
[57218] Fix | Delete
return ink;
[57219] Fix | Delete
}
[57220] Fix | Delete
static async createNewAppearanceStream(annotation, xref, params) {
[57221] Fix | Delete
if (annotation.outlines) {
[57222] Fix | Delete
return this.createNewAppearanceStreamForHighlight(annotation, xref, params);
[57223] Fix | Delete
}
[57224] Fix | Delete
const {
[57225] Fix | Delete
color,
[57226] Fix | Delete
rect,
[57227] Fix | Delete
paths,
[57228] Fix | Delete
thickness,
[57229] Fix | Delete
opacity
[57230] Fix | Delete
} = annotation;
[57231] Fix | Delete
const appearanceBuffer = [`${thickness} w 1 J 1 j`, `${getPdfColor(color, false)}`];
[57232] Fix | Delete
if (opacity !== 1) {
[57233] Fix | Delete
appearanceBuffer.push("/R0 gs");
[57234] Fix | Delete
}
[57235] Fix | Delete
const buffer = [];
[57236] Fix | Delete
for (const {
[57237] Fix | Delete
bezier
[57238] Fix | Delete
} of paths) {
[57239] Fix | Delete
buffer.length = 0;
[57240] Fix | Delete
buffer.push(`${numberToString(bezier[0])} ${numberToString(bezier[1])} m`);
[57241] Fix | Delete
if (bezier.length === 2) {
[57242] Fix | Delete
buffer.push(`${numberToString(bezier[0])} ${numberToString(bezier[1])} l S`);
[57243] Fix | Delete
} else {
[57244] Fix | Delete
for (let i = 2, ii = bezier.length; i < ii; i += 6) {
[57245] Fix | Delete
const curve = bezier.slice(i, i + 6).map(numberToString).join(" ");
[57246] Fix | Delete
buffer.push(`${curve} c`);
[57247] Fix | Delete
}
[57248] Fix | Delete
buffer.push("S");
[57249] Fix | Delete
}
[57250] Fix | Delete
appearanceBuffer.push(buffer.join("\n"));
[57251] Fix | Delete
}
[57252] Fix | Delete
const appearance = appearanceBuffer.join("\n");
[57253] Fix | Delete
const appearanceStreamDict = new Dict(xref);
[57254] Fix | Delete
appearanceStreamDict.set("FormType", 1);
[57255] Fix | Delete
appearanceStreamDict.set("Subtype", Name.get("Form"));
[57256] Fix | Delete
appearanceStreamDict.set("Type", Name.get("XObject"));
[57257] Fix | Delete
appearanceStreamDict.set("BBox", rect);
[57258] Fix | Delete
appearanceStreamDict.set("Length", appearance.length);
[57259] Fix | Delete
if (opacity !== 1) {
[57260] Fix | Delete
const resources = new Dict(xref);
[57261] Fix | Delete
const extGState = new Dict(xref);
[57262] Fix | Delete
const r0 = new Dict(xref);
[57263] Fix | Delete
r0.set("CA", opacity);
[57264] Fix | Delete
r0.set("Type", Name.get("ExtGState"));
[57265] Fix | Delete
extGState.set("R0", r0);
[57266] Fix | Delete
resources.set("ExtGState", extGState);
[57267] Fix | Delete
appearanceStreamDict.set("Resources", resources);
[57268] Fix | Delete
}
[57269] Fix | Delete
const ap = new StringStream(appearance);
[57270] Fix | Delete
ap.dict = appearanceStreamDict;
[57271] Fix | Delete
return ap;
[57272] Fix | Delete
}
[57273] Fix | Delete
static async createNewAppearanceStreamForHighlight(annotation, xref, params) {
[57274] Fix | Delete
const {
[57275] Fix | Delete
color,
[57276] Fix | Delete
rect,
[57277] Fix | Delete
outlines: {
[57278] Fix | Delete
outline
[57279] Fix | Delete
},
[57280] Fix | Delete
opacity
[57281] Fix | Delete
} = annotation;
[57282] Fix | Delete
const appearanceBuffer = [`${getPdfColor(color, true)}`, "/R0 gs"];
[57283] Fix | Delete
appearanceBuffer.push(`${numberToString(outline[4])} ${numberToString(outline[5])} m`);
[57284] Fix | Delete
for (let i = 6, ii = outline.length; i < ii; i += 6) {
[57285] Fix | Delete
if (isNaN(outline[i]) || outline[i] === null) {
[57286] Fix | Delete
appearanceBuffer.push(`${numberToString(outline[i + 4])} ${numberToString(outline[i + 5])} l`);
[57287] Fix | Delete
} else {
[57288] Fix | Delete
const curve = outline.slice(i, i + 6).map(numberToString).join(" ");
[57289] Fix | Delete
appearanceBuffer.push(`${curve} c`);
[57290] Fix | Delete
}
[57291] Fix | Delete
}
[57292] Fix | Delete
appearanceBuffer.push("h f");
[57293] Fix | Delete
const appearance = appearanceBuffer.join("\n");
[57294] Fix | Delete
const appearanceStreamDict = new Dict(xref);
[57295] Fix | Delete
appearanceStreamDict.set("FormType", 1);
[57296] Fix | Delete
appearanceStreamDict.set("Subtype", Name.get("Form"));
[57297] Fix | Delete
appearanceStreamDict.set("Type", Name.get("XObject"));
[57298] Fix | Delete
appearanceStreamDict.set("BBox", rect);
[57299] Fix | Delete
appearanceStreamDict.set("Length", appearance.length);
[57300] Fix | Delete
const resources = new Dict(xref);
[57301] Fix | Delete
const extGState = new Dict(xref);
[57302] Fix | Delete
resources.set("ExtGState", extGState);
[57303] Fix | Delete
appearanceStreamDict.set("Resources", resources);
[57304] Fix | Delete
const r0 = new Dict(xref);
[57305] Fix | Delete
extGState.set("R0", r0);
[57306] Fix | Delete
r0.set("BM", Name.get("Multiply"));
[57307] Fix | Delete
if (opacity !== 1) {
[57308] Fix | Delete
r0.set("ca", opacity);
[57309] Fix | Delete
r0.set("Type", Name.get("ExtGState"));
[57310] Fix | Delete
}
[57311] Fix | Delete
const ap = new StringStream(appearance);
[57312] Fix | Delete
ap.dict = appearanceStreamDict;
[57313] Fix | Delete
return ap;
[57314] Fix | Delete
}
[57315] Fix | Delete
}
[57316] Fix | Delete
class HighlightAnnotation extends MarkupAnnotation {
[57317] Fix | Delete
constructor(params) {
[57318] Fix | Delete
super(params);
[57319] Fix | Delete
const {
[57320] Fix | Delete
dict,
[57321] Fix | Delete
xref
[57322] Fix | Delete
} = params;
[57323] Fix | Delete
this.data.annotationType = AnnotationType.HIGHLIGHT;
[57324] Fix | Delete
const quadPoints = this.data.quadPoints = getQuadPoints(dict, null);
[57325] Fix | Delete
if (quadPoints) {
[57326] Fix | Delete
const resources = this.appearance?.dict.get("Resources");
[57327] Fix | Delete
if (!this.appearance || !resources?.has("ExtGState")) {
[57328] Fix | Delete
if (this.appearance) {
[57329] Fix | Delete
warn("HighlightAnnotation - ignoring built-in appearance stream.");
[57330] Fix | Delete
}
[57331] Fix | Delete
const fillColor = this.color ? getPdfColorArray(this.color) : [1, 1, 0];
[57332] Fix | Delete
const fillAlpha = dict.get("CA");
[57333] Fix | Delete
this._setDefaultAppearance({
[57334] Fix | Delete
xref,
[57335] Fix | Delete
fillColor,
[57336] Fix | Delete
blendMode: "Multiply",
[57337] Fix | Delete
fillAlpha,
[57338] Fix | Delete
pointsCallback: (buffer, points) => {
[57339] Fix | Delete
buffer.push(`${points[0].x} ${points[0].y} m`, `${points[1].x} ${points[1].y} l`, `${points[3].x} ${points[3].y} l`, `${points[2].x} ${points[2].y} l`, "f");
[57340] Fix | Delete
return [points[0].x, points[1].x, points[3].y, points[1].y];
[57341] Fix | Delete
}
[57342] Fix | Delete
});
[57343] Fix | Delete
}
[57344] Fix | Delete
} else {
[57345] Fix | Delete
this.data.popupRef = null;
[57346] Fix | Delete
}
[57347] Fix | Delete
}
[57348] Fix | Delete
static createNewDict(annotation, xref, {
[57349] Fix | Delete
apRef,
[57350] Fix | Delete
ap
[57351] Fix | Delete
}) {
[57352] Fix | Delete
const {
[57353] Fix | Delete
color,
[57354] Fix | Delete
opacity,
[57355] Fix | Delete
rect,
[57356] Fix | Delete
rotation,
[57357] Fix | Delete
user,
[57358] Fix | Delete
quadPoints
[57359] Fix | Delete
} = annotation;
[57360] Fix | Delete
const highlight = new Dict(xref);
[57361] Fix | Delete
highlight.set("Type", Name.get("Annot"));
[57362] Fix | Delete
highlight.set("Subtype", Name.get("Highlight"));
[57363] Fix | Delete
highlight.set("CreationDate", `D:${getModificationDate()}`);
[57364] Fix | Delete
highlight.set("Rect", rect);
[57365] Fix | Delete
highlight.set("F", 4);
[57366] Fix | Delete
highlight.set("Border", [0, 0, 0]);
[57367] Fix | Delete
highlight.set("Rotate", rotation);
[57368] Fix | Delete
highlight.set("QuadPoints", quadPoints);
[57369] Fix | Delete
highlight.set("C", Array.from(color, c => c / 255));
[57370] Fix | Delete
highlight.set("CA", opacity);
[57371] Fix | Delete
if (user) {
[57372] Fix | Delete
highlight.set("T", isAscii(user) ? user : stringToUTF16String(user, true));
[57373] Fix | Delete
}
[57374] Fix | Delete
if (apRef || ap) {
[57375] Fix | Delete
const n = new Dict(xref);
[57376] Fix | Delete
highlight.set("AP", n);
[57377] Fix | Delete
n.set("N", apRef || ap);
[57378] Fix | Delete
}
[57379] Fix | Delete
return highlight;
[57380] Fix | Delete
}
[57381] Fix | Delete
static async createNewAppearanceStream(annotation, xref, params) {
[57382] Fix | Delete
const {
[57383] Fix | Delete
color,
[57384] Fix | Delete
rect,
[57385] Fix | Delete
outlines,
[57386] Fix | Delete
opacity
[57387] Fix | Delete
} = annotation;
[57388] Fix | Delete
const appearanceBuffer = [`${getPdfColor(color, true)}`, "/R0 gs"];
[57389] Fix | Delete
const buffer = [];
[57390] Fix | Delete
for (const outline of outlines) {
[57391] Fix | Delete
buffer.length = 0;
[57392] Fix | Delete
buffer.push(`${numberToString(outline[0])} ${numberToString(outline[1])} m`);
[57393] Fix | Delete
for (let i = 2, ii = outline.length; i < ii; i += 2) {
[57394] Fix | Delete
buffer.push(`${numberToString(outline[i])} ${numberToString(outline[i + 1])} l`);
[57395] Fix | Delete
}
[57396] Fix | Delete
buffer.push("h");
[57397] Fix | Delete
appearanceBuffer.push(buffer.join("\n"));
[57398] Fix | Delete
}
[57399] Fix | Delete
appearanceBuffer.push("f*");
[57400] Fix | Delete
const appearance = appearanceBuffer.join("\n");
[57401] Fix | Delete
const appearanceStreamDict = new Dict(xref);
[57402] Fix | Delete
appearanceStreamDict.set("FormType", 1);
[57403] Fix | Delete
appearanceStreamDict.set("Subtype", Name.get("Form"));
[57404] Fix | Delete
appearanceStreamDict.set("Type", Name.get("XObject"));
[57405] Fix | Delete
appearanceStreamDict.set("BBox", rect);
[57406] Fix | Delete
appearanceStreamDict.set("Length", appearance.length);
[57407] Fix | Delete
const resources = new Dict(xref);
[57408] Fix | Delete
const extGState = new Dict(xref);
[57409] Fix | Delete
resources.set("ExtGState", extGState);
[57410] Fix | Delete
appearanceStreamDict.set("Resources", resources);
[57411] Fix | Delete
const r0 = new Dict(xref);
[57412] Fix | Delete
extGState.set("R0", r0);
[57413] Fix | Delete
r0.set("BM", Name.get("Multiply"));
[57414] Fix | Delete
if (opacity !== 1) {
[57415] Fix | Delete
r0.set("ca", opacity);
[57416] Fix | Delete
r0.set("Type", Name.get("ExtGState"));
[57417] Fix | Delete
}
[57418] Fix | Delete
const ap = new StringStream(appearance);
[57419] Fix | Delete
ap.dict = appearanceStreamDict;
[57420] Fix | Delete
return ap;
[57421] Fix | Delete
}
[57422] Fix | Delete
}
[57423] Fix | Delete
class UnderlineAnnotation extends MarkupAnnotation {
[57424] Fix | Delete
constructor(params) {
[57425] Fix | Delete
super(params);
[57426] Fix | Delete
const {
[57427] Fix | Delete
dict,
[57428] Fix | Delete
xref
[57429] Fix | Delete
} = params;
[57430] Fix | Delete
this.data.annotationType = AnnotationType.UNDERLINE;
[57431] Fix | Delete
const quadPoints = this.data.quadPoints = getQuadPoints(dict, null);
[57432] Fix | Delete
if (quadPoints) {
[57433] Fix | Delete
if (!this.appearance) {
[57434] Fix | Delete
const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0];
[57435] Fix | Delete
const strokeAlpha = dict.get("CA");
[57436] Fix | Delete
this._setDefaultAppearance({
[57437] Fix | Delete
xref,
[57438] Fix | Delete
extra: "[] 0 d 0.571 w",
[57439] Fix | Delete
strokeColor,
[57440] Fix | Delete
strokeAlpha,
[57441] Fix | Delete
pointsCallback: (buffer, points) => {
[57442] Fix | Delete
buffer.push(`${points[2].x} ${points[2].y + 1.3} m`, `${points[3].x} ${points[3].y + 1.3} l`, "S");
[57443] Fix | Delete
return [points[0].x, points[1].x, points[3].y, points[1].y];
[57444] Fix | Delete
}
[57445] Fix | Delete
});
[57446] Fix | Delete
}
[57447] Fix | Delete
} else {
[57448] Fix | Delete
this.data.popupRef = null;
[57449] Fix | Delete
}
[57450] Fix | Delete
}
[57451] Fix | Delete
}
[57452] Fix | Delete
class SquigglyAnnotation extends MarkupAnnotation {
[57453] Fix | Delete
constructor(params) {
[57454] Fix | Delete
super(params);
[57455] Fix | Delete
const {
[57456] Fix | Delete
dict,
[57457] Fix | Delete
xref
[57458] Fix | Delete
} = params;
[57459] Fix | Delete
this.data.annotationType = AnnotationType.SQUIGGLY;
[57460] Fix | Delete
const quadPoints = this.data.quadPoints = getQuadPoints(dict, null);
[57461] Fix | Delete
if (quadPoints) {
[57462] Fix | Delete
if (!this.appearance) {
[57463] Fix | Delete
const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0];
[57464] Fix | Delete
const strokeAlpha = dict.get("CA");
[57465] Fix | Delete
this._setDefaultAppearance({
[57466] Fix | Delete
xref,
[57467] Fix | Delete
extra: "[] 0 d 1 w",
[57468] Fix | Delete
strokeColor,
[57469] Fix | Delete
strokeAlpha,
[57470] Fix | Delete
pointsCallback: (buffer, points) => {
[57471] Fix | Delete
const dy = (points[0].y - points[2].y) / 6;
[57472] Fix | Delete
let shift = dy;
[57473] Fix | Delete
let x = points[2].x;
[57474] Fix | Delete
const y = points[2].y;
[57475] Fix | Delete
const xEnd = points[3].x;
[57476] Fix | Delete
buffer.push(`${x} ${y + shift} m`);
[57477] Fix | Delete
do {
[57478] Fix | Delete
x += 2;
[57479] Fix | Delete
shift = shift === 0 ? dy : 0;
[57480] Fix | Delete
buffer.push(`${x} ${y + shift} l`);
[57481] Fix | Delete
} while (x < xEnd);
[57482] Fix | Delete
buffer.push("S");
[57483] Fix | Delete
return [points[2].x, xEnd, y - 2 * dy, y + 2 * dy];
[57484] Fix | Delete
}
[57485] Fix | Delete
});
[57486] Fix | Delete
}
[57487] Fix | Delete
} else {
[57488] Fix | Delete
this.data.popupRef = null;
[57489] Fix | Delete
}
[57490] Fix | Delete
}
[57491] Fix | Delete
}
[57492] Fix | Delete
class StrikeOutAnnotation extends MarkupAnnotation {
[57493] Fix | Delete
constructor(params) {
[57494] Fix | Delete
super(params);
[57495] Fix | Delete
const {
[57496] Fix | Delete
dict,
[57497] Fix | Delete
xref
[57498] Fix | Delete
} = params;
[57499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function