/
var
/
www
/
greso.tech
/
server
/
nsm
/
node_modules
/
pdf-lib
/
es
/
core
/
acroform
/
/var/www/greso.tech/server/nsm/node_modules/pdf-lib/es/core/acroform
mkdir
upload
Name
Size
Mode
Actions
flags.d.ts
5780
0644
edit
dl
rm
flags.d.ts.map
773
0644
edit
dl
rm
flags.js
7361
0644
edit
dl
rm
flags.js.map
1892
0644
edit
dl
rm
index.d.ts
903
0644
edit
dl
rm
index.d.ts.map
887
0644
edit
dl
rm
index.js
901
0644
edit
dl
rm
index.js.map
882
0644
edit
dl
rm
PDFAcroButton.d.ts
1034
0644
edit
dl
rm
PDFAcroButton.d.ts.map
715
0644
edit
dl
rm
PDFAcroButton.js
3876
0644
edit
dl
rm
PDFAcroButton.js.map
3144
0644
edit
dl
rm
PDFAcroCheckBox.d.ts
573
0644
edit
dl
rm
PDFAcroCheckBox.d.ts.map
478
0644
edit
dl
rm
PDFAcroCheckBox.js
1864
0644
edit
dl
rm
PDFAcroCheckBox.js.map
1644
0644
edit
dl
rm
PDFAcroChoice.d.ts
864
0644
edit
dl
rm
PDFAcroChoice.d.ts.map
772
0644
edit
dl
rm
PDFAcroChoice.js
5304
0644
edit
dl
rm
PDFAcroChoice.js.map
4730
0644
edit
dl
rm
PDFAcroComboBox.d.ts
431
0644
edit
dl
rm
PDFAcroComboBox.d.ts.map
371
0644
edit
dl
rm
PDFAcroComboBox.js
836
0644
edit
dl
rm
PDFAcroComboBox.js.map
667
0644
edit
dl
rm
PDFAcroField.d.ts
1522
0644
edit
dl
rm
PDFAcroField.d.ts.map
1296
0644
edit
dl
rm
PDFAcroField.js
5817
0644
edit
dl
rm
PDFAcroField.js.map
5019
0644
edit
dl
rm
PDFAcroForm.d.ts
737
0644
edit
dl
rm
PDFAcroForm.d.ts.map
623
0644
edit
dl
rm
PDFAcroForm.js
2990
0644
edit
dl
rm
PDFAcroForm.js.map
2859
0644
edit
dl
rm
PDFAcroListBox.d.ts
426
0644
edit
dl
rm
PDFAcroListBox.d.ts.map
368
0644
edit
dl
rm
PDFAcroListBox.js
744
0644
edit
dl
rm
PDFAcroListBox.js.map
601
0644
edit
dl
rm
PDFAcroNonTerminal.d.ts
565
0644
edit
dl
rm
PDFAcroNonTerminal.d.ts.map
426
0644
edit
dl
rm
PDFAcroNonTerminal.js
1227
0644
edit
dl
rm
PDFAcroNonTerminal.js.map
1048
0644
edit
dl
rm
PDFAcroPushButton.d.ts
441
0644
edit
dl
rm
PDFAcroPushButton.d.ts.map
378
0644
edit
dl
rm
PDFAcroPushButton.js
862
0644
edit
dl
rm
PDFAcroPushButton.js.map
677
0644
edit
dl
rm
PDFAcroRadioButton.d.ts
579
0644
edit
dl
rm
PDFAcroRadioButton.d.ts.map
482
0644
edit
dl
rm
PDFAcroRadioButton.js
2084
0644
edit
dl
rm
PDFAcroRadioButton.js.map
1920
0644
edit
dl
rm
PDFAcroSignature.d.ts
340
0644
edit
dl
rm
PDFAcroSignature.d.ts.map
316
0644
edit
dl
rm
PDFAcroSignature.js
533
0644
edit
dl
rm
PDFAcroSignature.js.map
363
0644
edit
dl
rm
PDFAcroTerminal.d.ts
656
0644
edit
dl
rm
PDFAcroTerminal.d.ts.map
486
0644
edit
dl
rm
PDFAcroTerminal.js
2751
0644
edit
dl
rm
PDFAcroTerminal.js.map
2154
0644
edit
dl
rm
PDFAcroText.d.ts
957
0644
edit
dl
rm
PDFAcroText.d.ts.map
740
0644
edit
dl
rm
PDFAcroText.js
2720
0644
edit
dl
rm
PDFAcroText.js.map
2068
0644
edit
dl
rm
utils.d.ts
396
0644
edit
dl
rm
utils.d.ts.map
338
0644
edit
dl
rm
utils.js
5202
0644
edit
dl
rm
utils.js.map
4303
0644
edit
dl
rm
Edit:
/var/www/greso.tech/server/nsm/node_modules/pdf-lib/es/core/acroform/PDFAcroButton.js
(3876B)
import { __extends } from "tslib"; import PDFString from "../objects/PDFString"; import PDFHexString from "../objects/PDFHexString"; import PDFArray from "../objects/PDFArray"; import PDFName from "../objects/PDFName"; import PDFAcroTerminal from "./PDFAcroTerminal"; import { IndexOutOfBoundsError } from "../errors"; var PDFAcroButton = /** @class */ (function (_super) { __extends(PDFAcroButton, _super); function PDFAcroButton() { return _super !== null && _super.apply(this, arguments) || this; } PDFAcroButton.prototype.Opt = function () { return this.dict.lookupMaybe(PDFName.of('Opt'), PDFString, PDFHexString, PDFArray); }; PDFAcroButton.prototype.setOpt = function (opt) { this.dict.set(PDFName.of('Opt'), this.dict.context.obj(opt)); }; PDFAcroButton.prototype.getExportValues = function () { var opt = this.Opt(); if (!opt) return undefined; if (opt instanceof PDFString || opt instanceof PDFHexString) { return [opt]; } var values = []; for (var idx = 0, len = opt.size(); idx < len; idx++) { var value = opt.lookup(idx); if (value instanceof PDFString || value instanceof PDFHexString) { values.push(value); } } return values; }; PDFAcroButton.prototype.removeExportValue = function (idx) { var opt = this.Opt(); if (!opt) return; if (opt instanceof PDFString || opt instanceof PDFHexString) { if (idx !== 0) throw new IndexOutOfBoundsError(idx, 0, 0); this.setOpt([]); } else { if (idx < 0 || idx > opt.size()) { throw new IndexOutOfBoundsError(idx, 0, opt.size()); } opt.remove(idx); } }; // Enforce use use of /Opt even if it isn't strictly necessary PDFAcroButton.prototype.normalizeExportValues = function () { var _a, _b, _c, _d; var exportValues = (_a = this.getExportValues()) !== null && _a !== void 0 ? _a : []; var Opt = []; var widgets = this.getWidgets(); for (var idx = 0, len = widgets.length; idx < len; idx++) { var widget = widgets[idx]; var exportVal = (_b = exportValues[idx]) !== null && _b !== void 0 ? _b : PDFHexString.fromText((_d = (_c = widget.getOnValue()) === null || _c === void 0 ? void 0 : _c.decodeText()) !== null && _d !== void 0 ? _d : ''); Opt.push(exportVal); } this.setOpt(Opt); }; /** * Reuses existing opt if one exists with the same value (assuming * `useExistingIdx` is `true`). Returns index of existing (or new) opt. */ PDFAcroButton.prototype.addOpt = function (opt, useExistingOptIdx) { var _a; this.normalizeExportValues(); var optText = opt.decodeText(); var existingIdx; if (useExistingOptIdx) { var exportValues = (_a = this.getExportValues()) !== null && _a !== void 0 ? _a : []; for (var idx = 0, len = exportValues.length; idx < len; idx++) { var exportVal = exportValues[idx]; if (exportVal.decodeText() === optText) existingIdx = idx; } } var Opt = this.Opt(); Opt.push(opt); return existingIdx !== null && existingIdx !== void 0 ? existingIdx : Opt.size() - 1; }; PDFAcroButton.prototype.addWidgetWithOpt = function (widget, opt, useExistingOptIdx) { var optIdx = this.addOpt(opt, useExistingOptIdx); var apStateValue = PDFName.of(String(optIdx)); this.addWidget(widget); return apStateValue; }; return PDFAcroButton; }(PDFAcroTerminal)); export default PDFAcroButton; //# sourceMappingURL=PDFAcroButton.js.map
Save
cmd:
run