first commit
This commit is contained in:
84
node_modules/pdf-lib/cjs/core/PDFContext.d.ts
generated
vendored
Normal file
84
node_modules/pdf-lib/cjs/core/PDFContext.d.ts
generated
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
import PDFHeader from "./document/PDFHeader";
|
||||
import PDFArray from "./objects/PDFArray";
|
||||
import PDFBool from "./objects/PDFBool";
|
||||
import PDFDict from "./objects/PDFDict";
|
||||
import PDFHexString from "./objects/PDFHexString";
|
||||
import PDFName from "./objects/PDFName";
|
||||
import PDFNull from "./objects/PDFNull";
|
||||
import PDFNumber from "./objects/PDFNumber";
|
||||
import PDFObject from "./objects/PDFObject";
|
||||
import PDFRawStream from "./objects/PDFRawStream";
|
||||
import PDFRef from "./objects/PDFRef";
|
||||
import PDFStream from "./objects/PDFStream";
|
||||
import PDFString from "./objects/PDFString";
|
||||
import PDFOperator from "./operators/PDFOperator";
|
||||
import PDFContentStream from "./structures/PDFContentStream";
|
||||
import { SimpleRNG } from "../utils/rng";
|
||||
declare type LookupKey = PDFRef | PDFObject | undefined;
|
||||
interface LiteralObject {
|
||||
[name: string]: Literal | PDFObject;
|
||||
}
|
||||
interface LiteralArray {
|
||||
[index: number]: Literal | PDFObject;
|
||||
}
|
||||
declare type Literal = LiteralObject | LiteralArray | string | number | boolean | null | undefined;
|
||||
declare class PDFContext {
|
||||
static create: () => PDFContext;
|
||||
largestObjectNumber: number;
|
||||
header: PDFHeader;
|
||||
trailerInfo: {
|
||||
Root?: PDFObject;
|
||||
Encrypt?: PDFObject;
|
||||
Info?: PDFObject;
|
||||
ID?: PDFObject;
|
||||
};
|
||||
rng: SimpleRNG;
|
||||
private readonly indirectObjects;
|
||||
private pushGraphicsStateContentStreamRef?;
|
||||
private popGraphicsStateContentStreamRef?;
|
||||
private constructor();
|
||||
assign(ref: PDFRef, object: PDFObject): void;
|
||||
nextRef(): PDFRef;
|
||||
register(object: PDFObject): PDFRef;
|
||||
delete(ref: PDFRef): boolean;
|
||||
lookupMaybe(ref: LookupKey, type: typeof PDFArray): PDFArray | undefined;
|
||||
lookupMaybe(ref: LookupKey, type: typeof PDFBool): PDFBool | undefined;
|
||||
lookupMaybe(ref: LookupKey, type: typeof PDFDict): PDFDict | undefined;
|
||||
lookupMaybe(ref: LookupKey, type: typeof PDFHexString): PDFHexString | undefined;
|
||||
lookupMaybe(ref: LookupKey, type: typeof PDFName): PDFName | undefined;
|
||||
lookupMaybe(ref: LookupKey, type: typeof PDFNull): typeof PDFNull | undefined;
|
||||
lookupMaybe(ref: LookupKey, type: typeof PDFNumber): PDFNumber | undefined;
|
||||
lookupMaybe(ref: LookupKey, type: typeof PDFStream): PDFStream | undefined;
|
||||
lookupMaybe(ref: LookupKey, type: typeof PDFRef): PDFRef | undefined;
|
||||
lookupMaybe(ref: LookupKey, type: typeof PDFString): PDFString | undefined;
|
||||
lookupMaybe(ref: LookupKey, type1: typeof PDFString, type2: typeof PDFHexString): PDFString | PDFHexString | undefined;
|
||||
lookup(ref: LookupKey): PDFObject | undefined;
|
||||
lookup(ref: LookupKey, type: typeof PDFArray): PDFArray;
|
||||
lookup(ref: LookupKey, type: typeof PDFBool): PDFBool;
|
||||
lookup(ref: LookupKey, type: typeof PDFDict): PDFDict;
|
||||
lookup(ref: LookupKey, type: typeof PDFHexString): PDFHexString;
|
||||
lookup(ref: LookupKey, type: typeof PDFName): PDFName;
|
||||
lookup(ref: LookupKey, type: typeof PDFNull): typeof PDFNull;
|
||||
lookup(ref: LookupKey, type: typeof PDFNumber): PDFNumber;
|
||||
lookup(ref: LookupKey, type: typeof PDFStream): PDFStream;
|
||||
lookup(ref: LookupKey, type: typeof PDFRef): PDFRef;
|
||||
lookup(ref: LookupKey, type: typeof PDFString): PDFString;
|
||||
lookup(ref: LookupKey, type1: typeof PDFString, type2: typeof PDFHexString): PDFString | PDFHexString;
|
||||
getObjectRef(pdfObject: PDFObject): PDFRef | undefined;
|
||||
enumerateIndirectObjects(): [PDFRef, PDFObject][];
|
||||
obj(literal: null | undefined): typeof PDFNull;
|
||||
obj(literal: string): PDFName;
|
||||
obj(literal: number): PDFNumber;
|
||||
obj(literal: boolean): PDFBool;
|
||||
obj(literal: LiteralObject): PDFDict;
|
||||
obj(literal: LiteralArray): PDFArray;
|
||||
stream(contents: string | Uint8Array, dict?: LiteralObject): PDFRawStream;
|
||||
flateStream(contents: string | Uint8Array, dict?: LiteralObject): PDFRawStream;
|
||||
contentStream(operators: PDFOperator[], dict?: LiteralObject): PDFContentStream;
|
||||
formXObject(operators: PDFOperator[], dict?: LiteralObject): PDFContentStream;
|
||||
getPushGraphicsStateContentStream(): PDFRef;
|
||||
getPopGraphicsStateContentStream(): PDFRef;
|
||||
addRandomSuffix(prefix: string, suffixLength?: number): string;
|
||||
}
|
||||
export default PDFContext;
|
||||
//# sourceMappingURL=PDFContext.d.ts.map
|
||||
1
node_modules/pdf-lib/cjs/core/PDFContext.d.ts.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/PDFContext.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFContext.d.ts","sourceRoot":"","sources":["../../src/core/PDFContext.ts"],"names":[],"mappings":"AAEA,OAAO,SAAS,6BAAoC;AAEpD,OAAO,QAAQ,2BAAkC;AACjD,OAAO,OAAO,0BAAiC;AAC/C,OAAO,OAAO,0BAAiC;AAC/C,OAAO,YAAY,+BAAsC;AACzD,OAAO,OAAO,0BAAiC;AAC/C,OAAO,OAAO,0BAAiC;AAC/C,OAAO,SAAS,4BAAmC;AACnD,OAAO,SAAS,4BAAmC;AACnD,OAAO,YAAY,+BAAsC;AACzD,OAAO,MAAM,yBAAgC;AAC7C,OAAO,SAAS,4BAAmC;AACnD,OAAO,SAAS,4BAAmC;AACnD,OAAO,WAAW,gCAAuC;AAEzD,OAAO,gBAAgB,sCAA6C;AAEpE,OAAO,EAAE,SAAS,EAAE,qBAAsB;AAE1C,aAAK,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;AAEh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,gBAAgB;IAgBnB,iCAAiC,IAAI,MAAM;IAiB3C,gCAAgC,IAAI,MAAM;IAW1C,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,SAAI,GAAG,MAAM;CAG1D;AAED,eAAe,UAAU,CAAC"}
|
||||
201
node_modules/pdf-lib/cjs/core/PDFContext.js
generated
vendored
Normal file
201
node_modules/pdf-lib/cjs/core/PDFContext.js
generated
vendored
Normal file
@@ -0,0 +1,201 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var pako_1 = tslib_1.__importDefault(require("pako"));
|
||||
var PDFHeader_1 = tslib_1.__importDefault(require("./document/PDFHeader"));
|
||||
var errors_1 = require("./errors");
|
||||
var PDFArray_1 = tslib_1.__importDefault(require("./objects/PDFArray"));
|
||||
var PDFBool_1 = tslib_1.__importDefault(require("./objects/PDFBool"));
|
||||
var PDFDict_1 = tslib_1.__importDefault(require("./objects/PDFDict"));
|
||||
var PDFName_1 = tslib_1.__importDefault(require("./objects/PDFName"));
|
||||
var PDFNull_1 = tslib_1.__importDefault(require("./objects/PDFNull"));
|
||||
var PDFNumber_1 = tslib_1.__importDefault(require("./objects/PDFNumber"));
|
||||
var PDFObject_1 = tslib_1.__importDefault(require("./objects/PDFObject"));
|
||||
var PDFRawStream_1 = tslib_1.__importDefault(require("./objects/PDFRawStream"));
|
||||
var PDFRef_1 = tslib_1.__importDefault(require("./objects/PDFRef"));
|
||||
var PDFOperator_1 = tslib_1.__importDefault(require("./operators/PDFOperator"));
|
||||
var PDFOperatorNames_1 = tslib_1.__importDefault(require("./operators/PDFOperatorNames"));
|
||||
var PDFContentStream_1 = tslib_1.__importDefault(require("./structures/PDFContentStream"));
|
||||
var utils_1 = require("../utils");
|
||||
var rng_1 = require("../utils/rng");
|
||||
var byAscendingObjectNumber = function (_a, _b) {
|
||||
var a = _a[0];
|
||||
var b = _b[0];
|
||||
return a.objectNumber - b.objectNumber;
|
||||
};
|
||||
var PDFContext = /** @class */ (function () {
|
||||
function PDFContext() {
|
||||
this.largestObjectNumber = 0;
|
||||
this.header = PDFHeader_1.default.forVersion(1, 7);
|
||||
this.trailerInfo = {};
|
||||
this.indirectObjects = new Map();
|
||||
this.rng = rng_1.SimpleRNG.withSeed(1);
|
||||
}
|
||||
PDFContext.prototype.assign = function (ref, object) {
|
||||
this.indirectObjects.set(ref, object);
|
||||
if (ref.objectNumber > this.largestObjectNumber) {
|
||||
this.largestObjectNumber = ref.objectNumber;
|
||||
}
|
||||
};
|
||||
PDFContext.prototype.nextRef = function () {
|
||||
this.largestObjectNumber += 1;
|
||||
return PDFRef_1.default.of(this.largestObjectNumber);
|
||||
};
|
||||
PDFContext.prototype.register = function (object) {
|
||||
var ref = this.nextRef();
|
||||
this.assign(ref, object);
|
||||
return ref;
|
||||
};
|
||||
PDFContext.prototype.delete = function (ref) {
|
||||
return this.indirectObjects.delete(ref);
|
||||
};
|
||||
PDFContext.prototype.lookupMaybe = function (ref) {
|
||||
var types = [];
|
||||
for (var _i = 1; _i < arguments.length; _i++) {
|
||||
types[_i - 1] = arguments[_i];
|
||||
}
|
||||
// TODO: `preservePDFNull` is for backwards compatibility. Should be
|
||||
// removed in next breaking API change.
|
||||
var preservePDFNull = types.includes(PDFNull_1.default);
|
||||
var result = ref instanceof PDFRef_1.default ? this.indirectObjects.get(ref) : ref;
|
||||
if (!result || (result === PDFNull_1.default && !preservePDFNull))
|
||||
return undefined;
|
||||
for (var idx = 0, len = types.length; idx < len; idx++) {
|
||||
var type = types[idx];
|
||||
if (type === PDFNull_1.default) {
|
||||
if (result === PDFNull_1.default)
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
if (result instanceof type)
|
||||
return result;
|
||||
}
|
||||
}
|
||||
throw new errors_1.UnexpectedObjectTypeError(types, result);
|
||||
};
|
||||
PDFContext.prototype.lookup = function (ref) {
|
||||
var types = [];
|
||||
for (var _i = 1; _i < arguments.length; _i++) {
|
||||
types[_i - 1] = arguments[_i];
|
||||
}
|
||||
var result = ref instanceof PDFRef_1.default ? this.indirectObjects.get(ref) : ref;
|
||||
if (types.length === 0)
|
||||
return result;
|
||||
for (var idx = 0, len = types.length; idx < len; idx++) {
|
||||
var type = types[idx];
|
||||
if (type === PDFNull_1.default) {
|
||||
if (result === PDFNull_1.default)
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
if (result instanceof type)
|
||||
return result;
|
||||
}
|
||||
}
|
||||
throw new errors_1.UnexpectedObjectTypeError(types, result);
|
||||
};
|
||||
PDFContext.prototype.getObjectRef = function (pdfObject) {
|
||||
var entries = Array.from(this.indirectObjects.entries());
|
||||
for (var idx = 0, len = entries.length; idx < len; idx++) {
|
||||
var _a = entries[idx], ref = _a[0], object = _a[1];
|
||||
if (object === pdfObject) {
|
||||
return ref;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
PDFContext.prototype.enumerateIndirectObjects = function () {
|
||||
return Array.from(this.indirectObjects.entries()).sort(byAscendingObjectNumber);
|
||||
};
|
||||
PDFContext.prototype.obj = function (literal) {
|
||||
if (literal instanceof PDFObject_1.default) {
|
||||
return literal;
|
||||
}
|
||||
else if (literal === null || literal === undefined) {
|
||||
return PDFNull_1.default;
|
||||
}
|
||||
else if (typeof literal === 'string') {
|
||||
return PDFName_1.default.of(literal);
|
||||
}
|
||||
else if (typeof literal === 'number') {
|
||||
return PDFNumber_1.default.of(literal);
|
||||
}
|
||||
else if (typeof literal === 'boolean') {
|
||||
return literal ? PDFBool_1.default.True : PDFBool_1.default.False;
|
||||
}
|
||||
else if (Array.isArray(literal)) {
|
||||
var array = PDFArray_1.default.withContext(this);
|
||||
for (var idx = 0, len = literal.length; idx < len; idx++) {
|
||||
array.push(this.obj(literal[idx]));
|
||||
}
|
||||
return array;
|
||||
}
|
||||
else {
|
||||
var dict = PDFDict_1.default.withContext(this);
|
||||
var keys = Object.keys(literal);
|
||||
for (var idx = 0, len = keys.length; idx < len; idx++) {
|
||||
var key = keys[idx];
|
||||
var value = literal[key];
|
||||
if (value !== undefined)
|
||||
dict.set(PDFName_1.default.of(key), this.obj(value));
|
||||
}
|
||||
return dict;
|
||||
}
|
||||
};
|
||||
PDFContext.prototype.stream = function (contents, dict) {
|
||||
if (dict === void 0) { dict = {}; }
|
||||
return PDFRawStream_1.default.of(this.obj(dict), utils_1.typedArrayFor(contents));
|
||||
};
|
||||
PDFContext.prototype.flateStream = function (contents, dict) {
|
||||
if (dict === void 0) { dict = {}; }
|
||||
return this.stream(pako_1.default.deflate(utils_1.typedArrayFor(contents)), tslib_1.__assign(tslib_1.__assign({}, dict), { Filter: 'FlateDecode' }));
|
||||
};
|
||||
PDFContext.prototype.contentStream = function (operators, dict) {
|
||||
if (dict === void 0) { dict = {}; }
|
||||
return PDFContentStream_1.default.of(this.obj(dict), operators);
|
||||
};
|
||||
PDFContext.prototype.formXObject = function (operators, dict) {
|
||||
if (dict === void 0) { dict = {}; }
|
||||
return this.contentStream(operators, tslib_1.__assign(tslib_1.__assign({ BBox: this.obj([0, 0, 0, 0]), Matrix: this.obj([1, 0, 0, 1, 0, 0]) }, dict), { Type: 'XObject', Subtype: 'Form' }));
|
||||
};
|
||||
/*
|
||||
* Reference to PDFContentStream that contains a single PDFOperator: `q`.
|
||||
* Used by [[PDFPageLeaf]] instances to ensure that when content streams are
|
||||
* added to a modified PDF, they start in the default, unchanged graphics
|
||||
* state.
|
||||
*/
|
||||
PDFContext.prototype.getPushGraphicsStateContentStream = function () {
|
||||
if (this.pushGraphicsStateContentStreamRef) {
|
||||
return this.pushGraphicsStateContentStreamRef;
|
||||
}
|
||||
var dict = this.obj({});
|
||||
var op = PDFOperator_1.default.of(PDFOperatorNames_1.default.PushGraphicsState);
|
||||
var stream = PDFContentStream_1.default.of(dict, [op]);
|
||||
this.pushGraphicsStateContentStreamRef = this.register(stream);
|
||||
return this.pushGraphicsStateContentStreamRef;
|
||||
};
|
||||
/*
|
||||
* Reference to PDFContentStream that contains a single PDFOperator: `Q`.
|
||||
* Used by [[PDFPageLeaf]] instances to ensure that when content streams are
|
||||
* added to a modified PDF, they start in the default, unchanged graphics
|
||||
* state.
|
||||
*/
|
||||
PDFContext.prototype.getPopGraphicsStateContentStream = function () {
|
||||
if (this.popGraphicsStateContentStreamRef) {
|
||||
return this.popGraphicsStateContentStreamRef;
|
||||
}
|
||||
var dict = this.obj({});
|
||||
var op = PDFOperator_1.default.of(PDFOperatorNames_1.default.PopGraphicsState);
|
||||
var stream = PDFContentStream_1.default.of(dict, [op]);
|
||||
this.popGraphicsStateContentStreamRef = this.register(stream);
|
||||
return this.popGraphicsStateContentStreamRef;
|
||||
};
|
||||
PDFContext.prototype.addRandomSuffix = function (prefix, suffixLength) {
|
||||
if (suffixLength === void 0) { suffixLength = 4; }
|
||||
return prefix + "-" + Math.floor(this.rng.nextInt() * Math.pow(10, suffixLength));
|
||||
};
|
||||
PDFContext.create = function () { return new PDFContext(); };
|
||||
return PDFContext;
|
||||
}());
|
||||
exports.default = PDFContext;
|
||||
//# sourceMappingURL=PDFContext.js.map
|
||||
1
node_modules/pdf-lib/cjs/core/PDFContext.js.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/PDFContext.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
38
node_modules/pdf-lib/cjs/core/PDFObjectCopier.d.ts
generated
vendored
Normal file
38
node_modules/pdf-lib/cjs/core/PDFObjectCopier.d.ts
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
import PDFObject from "./objects/PDFObject";
|
||||
import PDFContext from "./PDFContext";
|
||||
/**
|
||||
* PDFObjectCopier copies PDFObjects from a src context to a dest context.
|
||||
* The primary use case for this is to copy pages between PDFs.
|
||||
*
|
||||
* _Copying_ an object with a PDFObjectCopier is different from _cloning_ an
|
||||
* object with its [[PDFObject.clone]] method:
|
||||
*
|
||||
* ```
|
||||
* const src: PDFContext = ...
|
||||
* const dest: PDFContext = ...
|
||||
* const originalObject: PDFObject = ...
|
||||
* const copiedObject = PDFObjectCopier.for(src, dest).copy(originalObject);
|
||||
* const clonedObject = originalObject.clone();
|
||||
* ```
|
||||
*
|
||||
* Copying an object is equivalent to cloning it and then copying over any other
|
||||
* objects that it references. Note that only dictionaries, arrays, and streams
|
||||
* (or structures build from them) can contain indirect references to other
|
||||
* objects. Copying a PDFObject that is not a dictionary, array, or stream is
|
||||
* supported, but is equivalent to cloning it.
|
||||
*/
|
||||
declare class PDFObjectCopier {
|
||||
static for: (src: PDFContext, dest: PDFContext) => PDFObjectCopier;
|
||||
private readonly src;
|
||||
private readonly dest;
|
||||
private readonly traversedObjects;
|
||||
private constructor();
|
||||
copy: <T extends PDFObject>(object: T) => T;
|
||||
private copyPDFPage;
|
||||
private copyPDFDict;
|
||||
private copyPDFArray;
|
||||
private copyPDFStream;
|
||||
private copyPDFIndirectObject;
|
||||
}
|
||||
export default PDFObjectCopier;
|
||||
//# sourceMappingURL=PDFObjectCopier.d.ts.map
|
||||
1
node_modules/pdf-lib/cjs/core/PDFObjectCopier.d.ts.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/PDFObjectCopier.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFObjectCopier.d.ts","sourceRoot":"","sources":["../../src/core/PDFObjectCopier.ts"],"names":[],"mappings":"AAGA,OAAO,SAAS,4BAAmC;AAGnD,OAAO,UAAU,qBAA4B;AAG7C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,cAAM,eAAe;IACnB,MAAM,CAAC,GAAG,QAAS,UAAU,QAAQ,UAAU,qBACd;IAEjC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAa;IACjC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAa;IAClC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAmC;IAEpE,OAAO;IAMP,IAAI,wCAOG;IAEP,OAAO,CAAC,WAAW,CAkBjB;IAEF,OAAO,CAAC,WAAW,CAgBjB;IAEF,OAAO,CAAC,YAAY,CAclB;IAEF,OAAO,CAAC,aAAa,CAenB;IAEF,OAAO,CAAC,qBAAqB,CAe3B;CACH;AAED,eAAe,eAAe,CAAC"}
|
||||
119
node_modules/pdf-lib/cjs/core/PDFObjectCopier.js
generated
vendored
Normal file
119
node_modules/pdf-lib/cjs/core/PDFObjectCopier.js
generated
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var PDFArray_1 = tslib_1.__importDefault(require("./objects/PDFArray"));
|
||||
var PDFDict_1 = tslib_1.__importDefault(require("./objects/PDFDict"));
|
||||
var PDFName_1 = tslib_1.__importDefault(require("./objects/PDFName"));
|
||||
var PDFRef_1 = tslib_1.__importDefault(require("./objects/PDFRef"));
|
||||
var PDFStream_1 = tslib_1.__importDefault(require("./objects/PDFStream"));
|
||||
var PDFPageLeaf_1 = tslib_1.__importDefault(require("./structures/PDFPageLeaf"));
|
||||
/**
|
||||
* PDFObjectCopier copies PDFObjects from a src context to a dest context.
|
||||
* The primary use case for this is to copy pages between PDFs.
|
||||
*
|
||||
* _Copying_ an object with a PDFObjectCopier is different from _cloning_ an
|
||||
* object with its [[PDFObject.clone]] method:
|
||||
*
|
||||
* ```
|
||||
* const src: PDFContext = ...
|
||||
* const dest: PDFContext = ...
|
||||
* const originalObject: PDFObject = ...
|
||||
* const copiedObject = PDFObjectCopier.for(src, dest).copy(originalObject);
|
||||
* const clonedObject = originalObject.clone();
|
||||
* ```
|
||||
*
|
||||
* Copying an object is equivalent to cloning it and then copying over any other
|
||||
* objects that it references. Note that only dictionaries, arrays, and streams
|
||||
* (or structures build from them) can contain indirect references to other
|
||||
* objects. Copying a PDFObject that is not a dictionary, array, or stream is
|
||||
* supported, but is equivalent to cloning it.
|
||||
*/
|
||||
var PDFObjectCopier = /** @class */ (function () {
|
||||
function PDFObjectCopier(src, dest) {
|
||||
var _this = this;
|
||||
this.traversedObjects = new Map();
|
||||
// prettier-ignore
|
||||
this.copy = function (object) { return (object instanceof PDFPageLeaf_1.default ? _this.copyPDFPage(object)
|
||||
: object instanceof PDFDict_1.default ? _this.copyPDFDict(object)
|
||||
: object instanceof PDFArray_1.default ? _this.copyPDFArray(object)
|
||||
: object instanceof PDFStream_1.default ? _this.copyPDFStream(object)
|
||||
: object instanceof PDFRef_1.default ? _this.copyPDFIndirectObject(object)
|
||||
: object.clone()); };
|
||||
this.copyPDFPage = function (originalPage) {
|
||||
var clonedPage = originalPage.clone();
|
||||
// Move any entries that the originalPage is inheriting from its parent
|
||||
// tree nodes directly into originalPage so they are preserved during
|
||||
// the copy.
|
||||
var InheritableEntries = PDFPageLeaf_1.default.InheritableEntries;
|
||||
for (var idx = 0, len = InheritableEntries.length; idx < len; idx++) {
|
||||
var key = PDFName_1.default.of(InheritableEntries[idx]);
|
||||
var value = clonedPage.getInheritableAttribute(key);
|
||||
if (!clonedPage.get(key) && value)
|
||||
clonedPage.set(key, value);
|
||||
}
|
||||
// Remove the parent reference to prevent the whole donor document's page
|
||||
// tree from being copied when we only need a single page.
|
||||
clonedPage.delete(PDFName_1.default.of('Parent'));
|
||||
return _this.copyPDFDict(clonedPage);
|
||||
};
|
||||
this.copyPDFDict = function (originalDict) {
|
||||
if (_this.traversedObjects.has(originalDict)) {
|
||||
return _this.traversedObjects.get(originalDict);
|
||||
}
|
||||
var clonedDict = originalDict.clone(_this.dest);
|
||||
_this.traversedObjects.set(originalDict, clonedDict);
|
||||
var entries = originalDict.entries();
|
||||
for (var idx = 0, len = entries.length; idx < len; idx++) {
|
||||
var _a = entries[idx], key = _a[0], value = _a[1];
|
||||
clonedDict.set(key, _this.copy(value));
|
||||
}
|
||||
return clonedDict;
|
||||
};
|
||||
this.copyPDFArray = function (originalArray) {
|
||||
if (_this.traversedObjects.has(originalArray)) {
|
||||
return _this.traversedObjects.get(originalArray);
|
||||
}
|
||||
var clonedArray = originalArray.clone(_this.dest);
|
||||
_this.traversedObjects.set(originalArray, clonedArray);
|
||||
for (var idx = 0, len = originalArray.size(); idx < len; idx++) {
|
||||
var value = originalArray.get(idx);
|
||||
clonedArray.set(idx, _this.copy(value));
|
||||
}
|
||||
return clonedArray;
|
||||
};
|
||||
this.copyPDFStream = function (originalStream) {
|
||||
if (_this.traversedObjects.has(originalStream)) {
|
||||
return _this.traversedObjects.get(originalStream);
|
||||
}
|
||||
var clonedStream = originalStream.clone(_this.dest);
|
||||
_this.traversedObjects.set(originalStream, clonedStream);
|
||||
var entries = originalStream.dict.entries();
|
||||
for (var idx = 0, len = entries.length; idx < len; idx++) {
|
||||
var _a = entries[idx], key = _a[0], value = _a[1];
|
||||
clonedStream.dict.set(key, _this.copy(value));
|
||||
}
|
||||
return clonedStream;
|
||||
};
|
||||
this.copyPDFIndirectObject = function (ref) {
|
||||
var alreadyMapped = _this.traversedObjects.has(ref);
|
||||
if (!alreadyMapped) {
|
||||
var newRef = _this.dest.nextRef();
|
||||
_this.traversedObjects.set(ref, newRef);
|
||||
var dereferencedValue = _this.src.lookup(ref);
|
||||
if (dereferencedValue) {
|
||||
var cloned = _this.copy(dereferencedValue);
|
||||
_this.dest.assign(newRef, cloned);
|
||||
}
|
||||
}
|
||||
return _this.traversedObjects.get(ref);
|
||||
};
|
||||
this.src = src;
|
||||
this.dest = dest;
|
||||
}
|
||||
PDFObjectCopier.for = function (src, dest) {
|
||||
return new PDFObjectCopier(src, dest);
|
||||
};
|
||||
return PDFObjectCopier;
|
||||
}());
|
||||
exports.default = PDFObjectCopier;
|
||||
//# sourceMappingURL=PDFObjectCopier.js.map
|
||||
1
node_modules/pdf-lib/cjs/core/PDFObjectCopier.js.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/PDFObjectCopier.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFObjectCopier.js","sourceRoot":"","sources":["../../src/core/PDFObjectCopier.ts"],"names":[],"mappings":";;;AAAA,wEAAiD;AACjD,sEAA+C;AAC/C,sEAA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ACtB,CAAC,CAAC;QAEM,0BAAqB,GAAG,UAAC,GAAW;YAC1C,IAAM,aAAa,GAAG,KAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAErD,IAAI,CAAC,aAAa,EAAE;gBAClB,IAAM,MAAM,GAAG,KAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;gBACnC,KAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;gBAEvC,IAAM,iBAAiB,GAAG,KAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBAC/C,IAAI,iBAAiB,EAAE;oBACrB,IAAM,MAAM,GAAG,KAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;oBAC5C,KAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;iBAClC;aACF;YAED,OAAO,KAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAW,CAAC;QAClD,CAAC,CAAC;QApGA,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAVM,mBAAG,GAAG,UAAC,GAAe,EAAE,IAAgB;QAC7C,OAAA,IAAI,eAAe,CAAC,GAAG,EAAE,IAAI,CAAC;IAA9B,CAA8B,CAAC;IA4GnC,sBAAC;CAAA,AA9GD,IA8GC;AAED,kBAAe,eAAe,CAAC"}
|
||||
22
node_modules/pdf-lib/cjs/core/acroform/PDFAcroButton.d.ts
generated
vendored
Normal file
22
node_modules/pdf-lib/cjs/core/acroform/PDFAcroButton.d.ts
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import PDFObject from "../objects/PDFObject";
|
||||
import PDFString from "../objects/PDFString";
|
||||
import PDFHexString from "../objects/PDFHexString";
|
||||
import PDFArray from "../objects/PDFArray";
|
||||
import PDFName from "../objects/PDFName";
|
||||
import PDFRef from "../objects/PDFRef";
|
||||
import PDFAcroTerminal from "./PDFAcroTerminal";
|
||||
declare class PDFAcroButton extends PDFAcroTerminal {
|
||||
Opt(): PDFString | PDFHexString | PDFArray | undefined;
|
||||
setOpt(opt: PDFObject[]): void;
|
||||
getExportValues(): (PDFString | PDFHexString)[] | undefined;
|
||||
removeExportValue(idx: number): void;
|
||||
normalizeExportValues(): void;
|
||||
/**
|
||||
* Reuses existing opt if one exists with the same value (assuming
|
||||
* `useExistingIdx` is `true`). Returns index of existing (or new) opt.
|
||||
*/
|
||||
addOpt(opt: PDFHexString | PDFString, useExistingOptIdx: boolean): number;
|
||||
addWidgetWithOpt(widget: PDFRef, opt: PDFHexString | PDFString, useExistingOptIdx: boolean): PDFName;
|
||||
}
|
||||
export default PDFAcroButton;
|
||||
//# sourceMappingURL=PDFAcroButton.d.ts.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroButton.d.ts.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroButton.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFAcroButton.d.ts","sourceRoot":"","sources":["../../../src/core/acroform/PDFAcroButton.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,6BAAmC;AACnD,OAAO,SAAS,6BAAmC;AACnD,OAAO,YAAY,gCAAsC;AACzD,OAAO,QAAQ,4BAAkC;AACjD,OAAO,OAAO,2BAAiC;AAC/C,OAAO,MAAM,0BAAgC;AAC7C,OAAO,eAAe,0BAA0C;AAGhE,cAAM,aAAc,SAAQ,eAAe;IACzC,GAAG,IAAI,SAAS,GAAG,YAAY,GAAG,QAAQ,GAAG,SAAS;IAStD,MAAM,CAAC,GAAG,EAAE,SAAS,EAAE;IAIvB,eAAe,IAAI,CAAC,SAAS,GAAG,YAAY,CAAC,EAAE,GAAG,SAAS;IAoB3D,iBAAiB,CAAC,GAAG,EAAE,MAAM;IAiB7B,qBAAqB;IAiBrB;;;OAGG;IACH,MAAM,CAAC,GAAG,EAAE,YAAY,GAAG,SAAS,EAAE,iBAAiB,EAAE,OAAO,GAAG,MAAM;IAoBzE,gBAAgB,CACd,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,YAAY,GAAG,SAAS,EAC7B,iBAAiB,EAAE,OAAO;CAO7B;AAED,eAAe,aAAa,CAAC"}
|
||||
96
node_modules/pdf-lib/cjs/core/acroform/PDFAcroButton.js
generated
vendored
Normal file
96
node_modules/pdf-lib/cjs/core/acroform/PDFAcroButton.js
generated
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var PDFString_1 = tslib_1.__importDefault(require("../objects/PDFString"));
|
||||
var PDFHexString_1 = tslib_1.__importDefault(require("../objects/PDFHexString"));
|
||||
var PDFArray_1 = tslib_1.__importDefault(require("../objects/PDFArray"));
|
||||
var PDFName_1 = tslib_1.__importDefault(require("../objects/PDFName"));
|
||||
var PDFAcroTerminal_1 = tslib_1.__importDefault(require("./PDFAcroTerminal"));
|
||||
var errors_1 = require("../errors");
|
||||
var PDFAcroButton = /** @class */ (function (_super) {
|
||||
tslib_1.__extends(PDFAcroButton, _super);
|
||||
function PDFAcroButton() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
PDFAcroButton.prototype.Opt = function () {
|
||||
return this.dict.lookupMaybe(PDFName_1.default.of('Opt'), PDFString_1.default, PDFHexString_1.default, PDFArray_1.default);
|
||||
};
|
||||
PDFAcroButton.prototype.setOpt = function (opt) {
|
||||
this.dict.set(PDFName_1.default.of('Opt'), this.dict.context.obj(opt));
|
||||
};
|
||||
PDFAcroButton.prototype.getExportValues = function () {
|
||||
var opt = this.Opt();
|
||||
if (!opt)
|
||||
return undefined;
|
||||
if (opt instanceof PDFString_1.default || opt instanceof PDFHexString_1.default) {
|
||||
return [opt];
|
||||
}
|
||||
var values = [];
|
||||
for (var idx = 0, len = opt.size(); idx < len; idx++) {
|
||||
var value = opt.lookup(idx);
|
||||
if (value instanceof PDFString_1.default || value instanceof PDFHexString_1.default) {
|
||||
values.push(value);
|
||||
}
|
||||
}
|
||||
return values;
|
||||
};
|
||||
PDFAcroButton.prototype.removeExportValue = function (idx) {
|
||||
var opt = this.Opt();
|
||||
if (!opt)
|
||||
return;
|
||||
if (opt instanceof PDFString_1.default || opt instanceof PDFHexString_1.default) {
|
||||
if (idx !== 0)
|
||||
throw new errors_1.IndexOutOfBoundsError(idx, 0, 0);
|
||||
this.setOpt([]);
|
||||
}
|
||||
else {
|
||||
if (idx < 0 || idx > opt.size()) {
|
||||
throw new errors_1.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_1.default.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_1.default.of(String(optIdx));
|
||||
this.addWidget(widget);
|
||||
return apStateValue;
|
||||
};
|
||||
return PDFAcroButton;
|
||||
}(PDFAcroTerminal_1.default));
|
||||
exports.default = PDFAcroButton;
|
||||
//# sourceMappingURL=PDFAcroButton.js.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroButton.js.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroButton.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFAcroButton.js","sourceRoot":"","sources":["../../../src/core/acroform/PDFAcroButton.ts"],"names":[],"mappings":";;;AACA,2EAAmD;AACnD,iFAAyD;AACzD,yEAAiD;AACjD,uEAA+C;AAE/C,8EAAgE;AAChE,oCAAwD;AAExD;IAA4B,yCAAe;IAA3C;;IAsGA,CAAC;IArGC,2BAAG,GAAH;QACE,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAC1B,iBAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EACjB,mBAAS,EACT,sBAAY,EACZ,kBAAQ,CACT,CAAC;IACJ,CAAC;IAED,8BAAM,GAAN,UAAO,GAAgB;QACrB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;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,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAEd,OAAO,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACvC,CAAC;IAED,wCAAgB,GAAhB,UACE,MAAc,EACd,GAA6B,EAC7B,iBAA0B;QAE1B,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC;QACnD,IAAM,YAAY,GAAG,iBAAO,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;QAChD,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACvB,OAAO,YAAY,CAAC;IACtB,CAAC;IACH,oBAAC;AAAD,CAAC,AAtGD,CAA4B,yBAAe,GAsG1C;AAED,kBAAe,aAAa,CAAC"}
|
||||
14
node_modules/pdf-lib/cjs/core/acroform/PDFAcroCheckBox.d.ts
generated
vendored
Normal file
14
node_modules/pdf-lib/cjs/core/acroform/PDFAcroCheckBox.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import PDFContext from "../PDFContext";
|
||||
import PDFRef from "../objects/PDFRef";
|
||||
import PDFDict from "../objects/PDFDict";
|
||||
import PDFName from "../objects/PDFName";
|
||||
import PDFAcroButton from "./PDFAcroButton";
|
||||
declare class PDFAcroCheckBox extends PDFAcroButton {
|
||||
static fromDict: (dict: PDFDict, ref: PDFRef) => PDFAcroCheckBox;
|
||||
static create: (context: PDFContext) => PDFAcroCheckBox;
|
||||
setValue(value: PDFName): void;
|
||||
getValue(): PDFName;
|
||||
getOnValue(): PDFName | undefined;
|
||||
}
|
||||
export default PDFAcroCheckBox;
|
||||
//# sourceMappingURL=PDFAcroCheckBox.d.ts.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroCheckBox.d.ts.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroCheckBox.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFAcroCheckBox.d.ts","sourceRoot":"","sources":["../../../src/core/acroform/PDFAcroCheckBox.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,sBAA4B;AAC7C,OAAO,MAAM,0BAAgC;AAC7C,OAAO,OAAO,2BAAiC;AAC/C,OAAO,OAAO,2BAAiC;AAC/C,OAAO,aAAa,wBAAwC;AAG5D,cAAM,eAAgB,SAAQ,aAAa;IACzC,MAAM,CAAC,QAAQ,SAAU,OAAO,OAAO,MAAM,qBACZ;IAEjC,MAAM,CAAC,MAAM,YAAa,UAAU,qBAOlC;IAEF,QAAQ,CAAC,KAAK,EAAE,OAAO;IAgBvB,QAAQ,IAAI,OAAO;IAMnB,UAAU,IAAI,OAAO,GAAG,SAAS;CAIlC;AAED,eAAe,eAAe,CAAC"}
|
||||
50
node_modules/pdf-lib/cjs/core/acroform/PDFAcroCheckBox.js
generated
vendored
Normal file
50
node_modules/pdf-lib/cjs/core/acroform/PDFAcroCheckBox.js
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var PDFName_1 = tslib_1.__importDefault(require("../objects/PDFName"));
|
||||
var PDFAcroButton_1 = tslib_1.__importDefault(require("./PDFAcroButton"));
|
||||
var errors_1 = require("../errors");
|
||||
var PDFAcroCheckBox = /** @class */ (function (_super) {
|
||||
tslib_1.__extends(PDFAcroCheckBox, _super);
|
||||
function PDFAcroCheckBox() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
PDFAcroCheckBox.prototype.setValue = function (value) {
|
||||
var _a;
|
||||
var onValue = (_a = this.getOnValue()) !== null && _a !== void 0 ? _a : PDFName_1.default.of('Yes');
|
||||
if (value !== onValue && value !== PDFName_1.default.of('Off')) {
|
||||
throw new errors_1.InvalidAcroFieldValueError();
|
||||
}
|
||||
this.dict.set(PDFName_1.default.of('V'), value);
|
||||
var widgets = this.getWidgets();
|
||||
for (var idx = 0, len = widgets.length; idx < len; idx++) {
|
||||
var widget = widgets[idx];
|
||||
var state = widget.getOnValue() === value ? value : PDFName_1.default.of('Off');
|
||||
widget.setAppearanceState(state);
|
||||
}
|
||||
};
|
||||
PDFAcroCheckBox.prototype.getValue = function () {
|
||||
var v = this.V();
|
||||
if (v instanceof PDFName_1.default)
|
||||
return v;
|
||||
return PDFName_1.default.of('Off');
|
||||
};
|
||||
PDFAcroCheckBox.prototype.getOnValue = function () {
|
||||
var widget = this.getWidgets()[0];
|
||||
return widget === null || widget === void 0 ? void 0 : widget.getOnValue();
|
||||
};
|
||||
PDFAcroCheckBox.fromDict = function (dict, ref) {
|
||||
return new PDFAcroCheckBox(dict, ref);
|
||||
};
|
||||
PDFAcroCheckBox.create = function (context) {
|
||||
var dict = context.obj({
|
||||
FT: 'Btn',
|
||||
Kids: [],
|
||||
});
|
||||
var ref = context.register(dict);
|
||||
return new PDFAcroCheckBox(dict, ref);
|
||||
};
|
||||
return PDFAcroCheckBox;
|
||||
}(PDFAcroButton_1.default));
|
||||
exports.default = PDFAcroCheckBox;
|
||||
//# sourceMappingURL=PDFAcroCheckBox.js.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroCheckBox.js.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroCheckBox.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFAcroCheckBox.js","sourceRoot":"","sources":["../../../src/core/acroform/PDFAcroCheckBox.ts"],"names":[],"mappings":";;;AAGA,uEAA+C;AAC/C,0EAA4D;AAC5D,oCAA6D;AAE7D;IAA8B,2CAAa;IAA3C;;IAuCA,CAAC;IA1BC,kCAAQ,GAAR,UAAS,KAAc;;QACrB,IAAM,OAAO,SAAG,IAAI,CAAC,UAAU,EAAE,mCAAI,iBAAO,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;QACvD,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,EAAE,EAAE,KAAK;YACT,IAAI,EAAE,EAAE;SACT,CAAC,CAAC;QACH,IAAM,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACnC,OAAO,IAAI,eAAe,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACxC,CAAC,CAAC;IA4BJ,sBAAC;CAAA,AAvCD,CAA8B,uBAAa,GAuC1C;AAED,kBAAe,eAAe,CAAC"}
|
||||
21
node_modules/pdf-lib/cjs/core/acroform/PDFAcroChoice.d.ts
generated
vendored
Normal file
21
node_modules/pdf-lib/cjs/core/acroform/PDFAcroChoice.d.ts
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
import PDFAcroTerminal from "./PDFAcroTerminal";
|
||||
import PDFHexString from "../objects/PDFHexString";
|
||||
import PDFString from "../objects/PDFString";
|
||||
import PDFArray from "../objects/PDFArray";
|
||||
declare class PDFAcroChoice extends PDFAcroTerminal {
|
||||
setValues(values: (PDFString | PDFHexString)[]): void;
|
||||
valuesAreValid(values: (PDFString | PDFHexString)[]): boolean;
|
||||
updateSelectedIndices(values: (PDFString | PDFHexString)[]): void;
|
||||
getValues(): (PDFString | PDFHexString)[];
|
||||
Opt(): PDFArray | PDFString | PDFHexString | undefined;
|
||||
setOptions(options: {
|
||||
value: PDFString | PDFHexString;
|
||||
display?: PDFString | PDFHexString;
|
||||
}[]): void;
|
||||
getOptions(): {
|
||||
value: PDFString | PDFHexString;
|
||||
display: PDFString | PDFHexString;
|
||||
}[];
|
||||
}
|
||||
export default PDFAcroChoice;
|
||||
//# sourceMappingURL=PDFAcroChoice.d.ts.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroChoice.d.ts.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroChoice.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFAcroChoice.d.ts","sourceRoot":"","sources":["../../../src/core/acroform/PDFAcroChoice.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,0BAA0C;AAChE,OAAO,YAAY,gCAAsC;AACzD,OAAO,SAAS,6BAAmC;AACnD,OAAO,QAAQ,4BAAkC;AAQjD,cAAM,aAAc,SAAQ,eAAe;IACzC,SAAS,CAAC,MAAM,EAAE,CAAC,SAAS,GAAG,YAAY,CAAC,EAAE;IAyB9C,cAAc,CAAC,MAAM,EAAE,CAAC,SAAS,GAAG,YAAY,CAAC,EAAE,GAAG,OAAO;IAW7D,qBAAqB,CAAC,MAAM,EAAE,CAAC,SAAS,GAAG,YAAY,CAAC,EAAE;IAgB1D,SAAS,IAAI,CAAC,SAAS,GAAG,YAAY,CAAC,EAAE;IAqBzC,GAAG,IAAI,QAAQ,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS;IAStD,UAAU,CACR,OAAO,EAAE;QACP,KAAK,EAAE,SAAS,GAAG,YAAY,CAAC;QAChC,OAAO,CAAC,EAAE,SAAS,GAAG,YAAY,CAAC;KACpC,EAAE;IAUL,UAAU,IAAI;QACZ,KAAK,EAAE,SAAS,GAAG,YAAY,CAAC;QAChC,OAAO,EAAE,SAAS,GAAG,YAAY,CAAC;KACnC,EAAE;CAuCJ;AAED,eAAe,aAAa,CAAC"}
|
||||
127
node_modules/pdf-lib/cjs/core/acroform/PDFAcroChoice.js
generated
vendored
Normal file
127
node_modules/pdf-lib/cjs/core/acroform/PDFAcroChoice.js
generated
vendored
Normal file
@@ -0,0 +1,127 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var PDFAcroTerminal_1 = tslib_1.__importDefault(require("./PDFAcroTerminal"));
|
||||
var PDFHexString_1 = tslib_1.__importDefault(require("../objects/PDFHexString"));
|
||||
var PDFString_1 = tslib_1.__importDefault(require("../objects/PDFString"));
|
||||
var PDFArray_1 = tslib_1.__importDefault(require("../objects/PDFArray"));
|
||||
var PDFName_1 = tslib_1.__importDefault(require("../objects/PDFName"));
|
||||
var flags_1 = require("./flags");
|
||||
var errors_1 = require("../errors");
|
||||
var PDFAcroChoice = /** @class */ (function (_super) {
|
||||
tslib_1.__extends(PDFAcroChoice, _super);
|
||||
function PDFAcroChoice() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
PDFAcroChoice.prototype.setValues = function (values) {
|
||||
if (this.hasFlag(flags_1.AcroChoiceFlags.Combo) &&
|
||||
!this.hasFlag(flags_1.AcroChoiceFlags.Edit) &&
|
||||
!this.valuesAreValid(values)) {
|
||||
throw new errors_1.InvalidAcroFieldValueError();
|
||||
}
|
||||
if (values.length === 0) {
|
||||
this.dict.delete(PDFName_1.default.of('V'));
|
||||
}
|
||||
if (values.length === 1) {
|
||||
this.dict.set(PDFName_1.default.of('V'), values[0]);
|
||||
}
|
||||
if (values.length > 1) {
|
||||
if (!this.hasFlag(flags_1.AcroChoiceFlags.MultiSelect)) {
|
||||
throw new errors_1.MultiSelectValueError();
|
||||
}
|
||||
this.dict.set(PDFName_1.default.of('V'), this.dict.context.obj(values));
|
||||
}
|
||||
this.updateSelectedIndices(values);
|
||||
};
|
||||
PDFAcroChoice.prototype.valuesAreValid = function (values) {
|
||||
var options = this.getOptions();
|
||||
var _loop_1 = function (idx, len) {
|
||||
var val = values[idx].decodeText();
|
||||
if (!options.find(function (o) { return val === (o.display || o.value).decodeText(); })) {
|
||||
return { value: false };
|
||||
}
|
||||
};
|
||||
for (var idx = 0, len = values.length; idx < len; idx++) {
|
||||
var state_1 = _loop_1(idx, len);
|
||||
if (typeof state_1 === "object")
|
||||
return state_1.value;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
PDFAcroChoice.prototype.updateSelectedIndices = function (values) {
|
||||
if (values.length > 1) {
|
||||
var indices = new Array(values.length);
|
||||
var options = this.getOptions();
|
||||
var _loop_2 = function (idx, len) {
|
||||
var val = values[idx].decodeText();
|
||||
indices[idx] = options.findIndex(function (o) { return val === (o.display || o.value).decodeText(); });
|
||||
};
|
||||
for (var idx = 0, len = values.length; idx < len; idx++) {
|
||||
_loop_2(idx, len);
|
||||
}
|
||||
this.dict.set(PDFName_1.default.of('I'), this.dict.context.obj(indices.sort()));
|
||||
}
|
||||
else {
|
||||
this.dict.delete(PDFName_1.default.of('I'));
|
||||
}
|
||||
};
|
||||
PDFAcroChoice.prototype.getValues = function () {
|
||||
var v = this.V();
|
||||
if (v instanceof PDFString_1.default || v instanceof PDFHexString_1.default)
|
||||
return [v];
|
||||
if (v instanceof PDFArray_1.default) {
|
||||
var values = [];
|
||||
for (var idx = 0, len = v.size(); idx < len; idx++) {
|
||||
var value = v.lookup(idx);
|
||||
if (value instanceof PDFString_1.default || value instanceof PDFHexString_1.default) {
|
||||
values.push(value);
|
||||
}
|
||||
}
|
||||
return values;
|
||||
}
|
||||
return [];
|
||||
};
|
||||
PDFAcroChoice.prototype.Opt = function () {
|
||||
return this.dict.lookupMaybe(PDFName_1.default.of('Opt'), PDFString_1.default, PDFHexString_1.default, PDFArray_1.default);
|
||||
};
|
||||
PDFAcroChoice.prototype.setOptions = function (options) {
|
||||
var newOpt = new Array(options.length);
|
||||
for (var idx = 0, len = options.length; idx < len; idx++) {
|
||||
var _a = options[idx], value = _a.value, display = _a.display;
|
||||
newOpt[idx] = this.dict.context.obj([value, display || value]);
|
||||
}
|
||||
this.dict.set(PDFName_1.default.of('Opt'), this.dict.context.obj(newOpt));
|
||||
};
|
||||
PDFAcroChoice.prototype.getOptions = function () {
|
||||
var Opt = this.Opt();
|
||||
// Not supposed to happen - Opt _should_ always be `PDFArray | undefined`
|
||||
if (Opt instanceof PDFString_1.default || Opt instanceof PDFHexString_1.default) {
|
||||
return [{ value: Opt, display: Opt }];
|
||||
}
|
||||
if (Opt instanceof PDFArray_1.default) {
|
||||
var res = [];
|
||||
for (var idx = 0, len = Opt.size(); idx < len; idx++) {
|
||||
var item = Opt.lookup(idx);
|
||||
// If `item` is a string, use that as both the export and text value
|
||||
if (item instanceof PDFString_1.default || item instanceof PDFHexString_1.default) {
|
||||
res.push({ value: item, display: item });
|
||||
}
|
||||
// If `item` is an array of one, treat it the same as just a string,
|
||||
// if it's an array of two then `item[0]` is the export value and
|
||||
// `item[1]` is the text value
|
||||
if (item instanceof PDFArray_1.default) {
|
||||
if (item.size() > 0) {
|
||||
var first = item.lookup(0, PDFString_1.default, PDFHexString_1.default);
|
||||
var second = item.lookupMaybe(1, PDFString_1.default, PDFHexString_1.default);
|
||||
res.push({ value: first, display: second || first });
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
return [];
|
||||
};
|
||||
return PDFAcroChoice;
|
||||
}(PDFAcroTerminal_1.default));
|
||||
exports.default = PDFAcroChoice;
|
||||
//# sourceMappingURL=PDFAcroChoice.js.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroChoice.js.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroChoice.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFAcroChoice.js","sourceRoot":"","sources":["../../../src/core/acroform/PDFAcroChoice.ts"],"names":[],"mappings":";;;AAAA,8EAAgE;AAChE,iFAAyD;AACzD,2EAAmD;AACnD,yEAAiD;AACjD,uEAA+C;AAC/C,iCAA0D;AAC1D,oCAGyB;AAEzB;IAA4B,yCAAe;IAA3C;;IA2IA,CAAC;IA1IC,iCAAS,GAAT,UAAU,MAAoC;QAC5C,IACE,IAAI,CAAC,OAAO,CAAC,uBAAe,CAAC,KAAK,CAAC;YACnC,CAAC,IAAI,CAAC,OAAO,CAAC,uBAAe,CAAC,IAAI,CAAC;YACnC,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAC5B;YACA,MAAM,IAAI,mCAA0B,EAAE,CAAC;SACxC;QAED,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;YACvB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAO,CAAC,EAAE,CAAC,GAAG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Box.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import PDFDict from "../objects/PDFDict";
|
||||
import PDFAcroChoice from "./PDFAcroChoice";
|
||||
import PDFContext from "../PDFContext";
|
||||
import PDFRef from "../objects/PDFRef";
|
||||
declare class PDFAcroComboBox extends PDFAcroChoice {
|
||||
static fromDict: (dict: PDFDict, ref: PDFRef) => PDFAcroComboBox;
|
||||
static create: (context: PDFContext) => PDFAcroComboBox;
|
||||
}
|
||||
export default PDFAcroComboBox;
|
||||
//# sourceMappingURL=PDFAcroComboBox.d.ts.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroComboBox.d.ts.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroComboBox.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFAcroComboBox.d.ts","sourceRoot":"","sources":["../../../src/core/acroform/PDFAcroComboBox.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,2BAAiC;AAC/C,OAAO,aAAa,wBAAwC;AAC5D,OAAO,UAAU,sBAA4B;AAC7C,OAAO,MAAM,0BAAgC;AAG7C,cAAM,eAAgB,SAAQ,aAAa;IACzC,MAAM,CAAC,QAAQ,SAAU,OAAO,OAAO,MAAM,qBACZ;IAEjC,MAAM,CAAC,MAAM,YAAa,UAAU,qBAQlC;CACH;AAED,eAAe,eAAe,CAAC"}
|
||||
26
node_modules/pdf-lib/cjs/core/acroform/PDFAcroComboBox.js
generated
vendored
Normal file
26
node_modules/pdf-lib/cjs/core/acroform/PDFAcroComboBox.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var PDFAcroChoice_1 = tslib_1.__importDefault(require("./PDFAcroChoice"));
|
||||
var flags_1 = require("./flags");
|
||||
var PDFAcroComboBox = /** @class */ (function (_super) {
|
||||
tslib_1.__extends(PDFAcroComboBox, _super);
|
||||
function PDFAcroComboBox() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
PDFAcroComboBox.fromDict = function (dict, ref) {
|
||||
return new PDFAcroComboBox(dict, ref);
|
||||
};
|
||||
PDFAcroComboBox.create = function (context) {
|
||||
var dict = context.obj({
|
||||
FT: 'Ch',
|
||||
Ff: flags_1.AcroChoiceFlags.Combo,
|
||||
Kids: [],
|
||||
});
|
||||
var ref = context.register(dict);
|
||||
return new PDFAcroComboBox(dict, ref);
|
||||
};
|
||||
return PDFAcroComboBox;
|
||||
}(PDFAcroChoice_1.default));
|
||||
exports.default = PDFAcroComboBox;
|
||||
//# sourceMappingURL=PDFAcroComboBox.js.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroComboBox.js.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroComboBox.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFAcroComboBox.js","sourceRoot":"","sources":["../../../src/core/acroform/PDFAcroComboBox.ts"],"names":[],"mappings":";;;AACA,0EAA4D;AAG5D,iCAA0D;AAE1D;IAA8B,2CAAa;IAA3C;;IAaA,CAAC;IAZQ,wBAAQ,GAAG,UAAC,IAAa,EAAE,GAAW;QAC3C,OAAA,IAAI,eAAe,CAAC,IAAI,EAAE,GAAG,CAAC;IAA9B,CAA8B,CAAC;IAE1B,sBAAM,GAAG,UAAC,OAAmB;QAClC,IAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC;YACvB,EAAE,EAAE,IAAI;YACR,EAAE,EAAE,uBAAe,CAAC,KAAK;YACzB,IAAI,EAAE,EAAE;SACT,CAAC,CAAC;QACH,IAAM,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACnC,OAAO,IAAI,eAAe,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACxC,CAAC,CAAC;IACJ,sBAAC;CAAA,AAbD,CAA8B,uBAAa,GAa1C;AAED,kBAAe,eAAe,CAAC"}
|
||||
37
node_modules/pdf-lib/cjs/core/acroform/PDFAcroField.d.ts
generated
vendored
Normal file
37
node_modules/pdf-lib/cjs/core/acroform/PDFAcroField.d.ts
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
import PDFDict from "../objects/PDFDict";
|
||||
import PDFString from "../objects/PDFString";
|
||||
import PDFHexString from "../objects/PDFHexString";
|
||||
import PDFName from "../objects/PDFName";
|
||||
import PDFObject from "../objects/PDFObject";
|
||||
import PDFNumber from "../objects/PDFNumber";
|
||||
import PDFArray from "../objects/PDFArray";
|
||||
import PDFRef from "../objects/PDFRef";
|
||||
declare class PDFAcroField {
|
||||
readonly dict: PDFDict;
|
||||
readonly ref: PDFRef;
|
||||
protected constructor(dict: PDFDict, ref: PDFRef);
|
||||
T(): PDFString | PDFHexString | undefined;
|
||||
Ff(): PDFNumber | undefined;
|
||||
V(): PDFObject | undefined;
|
||||
Kids(): PDFArray | undefined;
|
||||
DA(): PDFString | PDFHexString | undefined;
|
||||
setKids(kids: PDFObject[]): void;
|
||||
getParent(): PDFAcroField | undefined;
|
||||
setParent(parent: PDFRef | undefined): void;
|
||||
getFullyQualifiedName(): string | undefined;
|
||||
getPartialName(): string | undefined;
|
||||
setPartialName(partialName: string | undefined): void;
|
||||
setDefaultAppearance(appearance: string): void;
|
||||
getDefaultAppearance(): string | undefined;
|
||||
setFontSize(fontSize: number): void;
|
||||
getFlags(): number;
|
||||
setFlags(flags: number): void;
|
||||
hasFlag(flag: number): boolean;
|
||||
setFlag(flag: number): void;
|
||||
clearFlag(flag: number): void;
|
||||
setFlagTo(flag: number, enable: boolean): void;
|
||||
getInheritableAttribute(name: PDFName): PDFObject | undefined;
|
||||
ascend(visitor: (node: PDFAcroField) => any): void;
|
||||
}
|
||||
export default PDFAcroField;
|
||||
//# sourceMappingURL=PDFAcroField.d.ts.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroField.d.ts.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroField.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFAcroField.d.ts","sourceRoot":"","sources":["../../../src/core/acroform/PDFAcroField.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,2BAAiC;AAC/C,OAAO,SAAS,6BAAmC;AACnD,OAAO,YAAY,gCAAsC;AACzD,OAAO,OAAO,2BAAiC;AAC/C,OAAO,SAAS,6BAAmC;AACnD,OAAO,SAAS,6BAAmC;AACnD,OAAO,QAAQ,4BAAkC;AACjD,OAAO,MAAM,0BAAgC;AAU7C,cAAM,YAAY;IAChB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB,SAAS,aAAa,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM;IAKhD,CAAC,IAAI,SAAS,GAAG,YAAY,GAAG,SAAS;IAIzC,EAAE,IAAI,SAAS,GAAG,SAAS;IAK3B,CAAC,IAAI,SAAS,GAAG,SAAS;IAK1B,IAAI,IAAI,QAAQ,GAAG,SAAS;IAQ5B,EAAE,IAAI,SAAS,GAAG,YAAY,GAAG,SAAS;IAM1C,OAAO,CAAC,IAAI,EAAE,SAAS,EAAE;IAIzB,SAAS,IAAI,YAAY,GAAG,SAAS;IAcrC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS;IAKpC,qBAAqB,IAAI,MAAM,GAAG,SAAS;IAM3C,cAAc,IAAI,MAAM,GAAG,SAAS;IAIpC,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS;IAK9C,oBAAoB,CAAC,UAAU,EAAE,MAAM;IAIvC,oBAAoB,IAAI,MAAM,GAAG,SAAS;IAU1C,WAAW,CAAC,QAAQ,EAAE,MAAM;IAiB5B,QAAQ,IAAI,MAAM;IAIlB,QAAQ,CAAC,KAAK,EAAE,MAAM;IAItB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAK9B,OAAO,CAAC,IAAI,EAAE,MAAM;IAKpB,SAAS,CAAC,IAAI,EAAE,MAAM;IAKtB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO;IAKvC,uBAAuB,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS;IAQ7D,MAAM,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,GAAG,GAAG,IAAI;CAKnD;AAED,eAAe,YAAY,CAAC"}
|
||||
149
node_modules/pdf-lib/cjs/core/acroform/PDFAcroField.js
generated
vendored
Normal file
149
node_modules/pdf-lib/cjs/core/acroform/PDFAcroField.js
generated
vendored
Normal file
@@ -0,0 +1,149 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var PDFDict_1 = tslib_1.__importDefault(require("../objects/PDFDict"));
|
||||
var PDFString_1 = tslib_1.__importDefault(require("../objects/PDFString"));
|
||||
var PDFHexString_1 = tslib_1.__importDefault(require("../objects/PDFHexString"));
|
||||
var PDFName_1 = tslib_1.__importDefault(require("../objects/PDFName"));
|
||||
var PDFNumber_1 = tslib_1.__importDefault(require("../objects/PDFNumber"));
|
||||
var PDFArray_1 = tslib_1.__importDefault(require("../objects/PDFArray"));
|
||||
var PDFRef_1 = tslib_1.__importDefault(require("../objects/PDFRef"));
|
||||
var utils_1 = require("../../utils");
|
||||
var errors_1 = require("../errors");
|
||||
// Examples:
|
||||
// `/Helv 12 Tf` -> ['Helv', '12']
|
||||
// `/HeBo 8.00 Tf` -> ['HeBo', '8.00']
|
||||
// `/HeBo Tf` -> ['HeBo', undefined]
|
||||
var tfRegex = /\/([^\0\t\n\f\r\ ]+)[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]+Tf/;
|
||||
var PDFAcroField = /** @class */ (function () {
|
||||
function PDFAcroField(dict, ref) {
|
||||
this.dict = dict;
|
||||
this.ref = ref;
|
||||
}
|
||||
PDFAcroField.prototype.T = function () {
|
||||
return this.dict.lookupMaybe(PDFName_1.default.of('T'), PDFString_1.default, PDFHexString_1.default);
|
||||
};
|
||||
PDFAcroField.prototype.Ff = function () {
|
||||
var numberOrRef = this.getInheritableAttribute(PDFName_1.default.of('Ff'));
|
||||
return this.dict.context.lookupMaybe(numberOrRef, PDFNumber_1.default);
|
||||
};
|
||||
PDFAcroField.prototype.V = function () {
|
||||
var valueOrRef = this.getInheritableAttribute(PDFName_1.default.of('V'));
|
||||
return this.dict.context.lookup(valueOrRef);
|
||||
};
|
||||
PDFAcroField.prototype.Kids = function () {
|
||||
return this.dict.lookupMaybe(PDFName_1.default.of('Kids'), PDFArray_1.default);
|
||||
};
|
||||
// Parent(): PDFDict | undefined {
|
||||
// return this.dict.lookupMaybe(PDFName.of('Parent'), PDFDict);
|
||||
// }
|
||||
PDFAcroField.prototype.DA = function () {
|
||||
var da = this.dict.lookup(PDFName_1.default.of('DA'));
|
||||
if (da instanceof PDFString_1.default || da instanceof PDFHexString_1.default)
|
||||
return da;
|
||||
return undefined;
|
||||
};
|
||||
PDFAcroField.prototype.setKids = function (kids) {
|
||||
this.dict.set(PDFName_1.default.of('Kids'), this.dict.context.obj(kids));
|
||||
};
|
||||
PDFAcroField.prototype.getParent = function () {
|
||||
// const parent = this.Parent();
|
||||
// if (!parent) return undefined;
|
||||
// return new PDFAcroField(parent);
|
||||
var parentRef = this.dict.get(PDFName_1.default.of('Parent'));
|
||||
if (parentRef instanceof PDFRef_1.default) {
|
||||
var parent_1 = this.dict.lookup(PDFName_1.default.of('Parent'), PDFDict_1.default);
|
||||
return new PDFAcroField(parent_1, parentRef);
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
PDFAcroField.prototype.setParent = function (parent) {
|
||||
if (!parent)
|
||||
this.dict.delete(PDFName_1.default.of('Parent'));
|
||||
else
|
||||
this.dict.set(PDFName_1.default.of('Parent'), parent);
|
||||
};
|
||||
PDFAcroField.prototype.getFullyQualifiedName = function () {
|
||||
var parent = this.getParent();
|
||||
if (!parent)
|
||||
return this.getPartialName();
|
||||
return parent.getFullyQualifiedName() + "." + this.getPartialName();
|
||||
};
|
||||
PDFAcroField.prototype.getPartialName = function () {
|
||||
var _a;
|
||||
return (_a = this.T()) === null || _a === void 0 ? void 0 : _a.decodeText();
|
||||
};
|
||||
PDFAcroField.prototype.setPartialName = function (partialName) {
|
||||
if (!partialName)
|
||||
this.dict.delete(PDFName_1.default.of('T'));
|
||||
else
|
||||
this.dict.set(PDFName_1.default.of('T'), PDFHexString_1.default.fromText(partialName));
|
||||
};
|
||||
PDFAcroField.prototype.setDefaultAppearance = function (appearance) {
|
||||
this.dict.set(PDFName_1.default.of('DA'), PDFString_1.default.of(appearance));
|
||||
};
|
||||
PDFAcroField.prototype.getDefaultAppearance = function () {
|
||||
var DA = this.DA();
|
||||
if (DA instanceof PDFHexString_1.default) {
|
||||
return DA.decodeText();
|
||||
}
|
||||
return DA === null || DA === void 0 ? void 0 : DA.asString();
|
||||
};
|
||||
PDFAcroField.prototype.setFontSize = function (fontSize) {
|
||||
var _a;
|
||||
var name = (_a = this.getFullyQualifiedName()) !== null && _a !== void 0 ? _a : '';
|
||||
var da = this.getDefaultAppearance();
|
||||
if (!da)
|
||||
throw new errors_1.MissingDAEntryError(name);
|
||||
var daMatch = utils_1.findLastMatch(da, tfRegex);
|
||||
if (!daMatch.match)
|
||||
throw new errors_1.MissingTfOperatorError(name);
|
||||
var daStart = da.slice(0, daMatch.pos - daMatch.match[0].length);
|
||||
var daEnd = daMatch.pos <= da.length ? da.slice(daMatch.pos) : '';
|
||||
var fontName = daMatch.match[1];
|
||||
var modifiedDa = daStart + " /" + fontName + " " + fontSize + " Tf " + daEnd;
|
||||
this.setDefaultAppearance(modifiedDa);
|
||||
};
|
||||
PDFAcroField.prototype.getFlags = function () {
|
||||
var _a, _b;
|
||||
return (_b = (_a = this.Ff()) === null || _a === void 0 ? void 0 : _a.asNumber()) !== null && _b !== void 0 ? _b : 0;
|
||||
};
|
||||
PDFAcroField.prototype.setFlags = function (flags) {
|
||||
this.dict.set(PDFName_1.default.of('Ff'), PDFNumber_1.default.of(flags));
|
||||
};
|
||||
PDFAcroField.prototype.hasFlag = function (flag) {
|
||||
var flags = this.getFlags();
|
||||
return (flags & flag) !== 0;
|
||||
};
|
||||
PDFAcroField.prototype.setFlag = function (flag) {
|
||||
var flags = this.getFlags();
|
||||
this.setFlags(flags | flag);
|
||||
};
|
||||
PDFAcroField.prototype.clearFlag = function (flag) {
|
||||
var flags = this.getFlags();
|
||||
this.setFlags(flags & ~flag);
|
||||
};
|
||||
PDFAcroField.prototype.setFlagTo = function (flag, enable) {
|
||||
if (enable)
|
||||
this.setFlag(flag);
|
||||
else
|
||||
this.clearFlag(flag);
|
||||
};
|
||||
PDFAcroField.prototype.getInheritableAttribute = function (name) {
|
||||
var attribute;
|
||||
this.ascend(function (node) {
|
||||
if (!attribute)
|
||||
attribute = node.dict.get(name);
|
||||
});
|
||||
return attribute;
|
||||
};
|
||||
PDFAcroField.prototype.ascend = function (visitor) {
|
||||
visitor(this);
|
||||
var parent = this.getParent();
|
||||
if (parent)
|
||||
parent.ascend(visitor);
|
||||
};
|
||||
return PDFAcroField;
|
||||
}());
|
||||
exports.default = PDFAcroField;
|
||||
//# sourceMappingURL=PDFAcroField.js.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroField.js.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroField.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFAcroField.js","sourceRoot":"","sources":["../../../src/core/acroform/PDFAcroField.ts"],"names":[],"mappings":";;;AAAA,uEAA+C;AAC/C,2EAAmD;AACnD,iFAAyD;AACzD,uEAA+C;AAE/C,2EAAmD;AACnD,yEAAiD;AACjD,qEAA6C;AAC7C,qCAA0C;A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AAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;;YAC1B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAED,8CAAuB,GAAvB,UAAwB,IAAa;QACnC,IAAI,SAAgC,CAAC;QACrC,IAAI,CAAC,MAAM,CAAC,UAAC,IAAI;YACf,IAAI,CAAC,SAAS;gBAAE,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;QACH,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,6BAAM,GAAN,UAAO,OAAoC;QACzC,OAAO,CAAC,IAAI,CAAC,CAAC;QACd,IAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAChC,IAAI,MAAM;YAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IACH,mBAAC;AAAD,CAAC,AAnJD,IAmJC;AAED,kBAAe,YAAY,CAAC"}
|
||||
21
node_modules/pdf-lib/cjs/core/acroform/PDFAcroForm.d.ts
generated
vendored
Normal file
21
node_modules/pdf-lib/cjs/core/acroform/PDFAcroForm.d.ts
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
import PDFContext from "../PDFContext";
|
||||
import PDFDict from "../objects/PDFDict";
|
||||
import PDFArray from "../objects/PDFArray";
|
||||
import PDFRef from "../objects/PDFRef";
|
||||
import PDFAcroField from "./PDFAcroField";
|
||||
declare class PDFAcroForm {
|
||||
readonly dict: PDFDict;
|
||||
static fromDict: (dict: PDFDict) => PDFAcroForm;
|
||||
static create: (context: PDFContext) => PDFAcroForm;
|
||||
private constructor();
|
||||
Fields(): PDFArray | undefined;
|
||||
getFields(): [PDFAcroField, PDFRef][];
|
||||
getAllFields(): [PDFAcroField, PDFRef][];
|
||||
addField(field: PDFRef): void;
|
||||
removeField(field: PDFAcroField): void;
|
||||
normalizedEntries(): {
|
||||
Fields: PDFArray;
|
||||
};
|
||||
}
|
||||
export default PDFAcroForm;
|
||||
//# sourceMappingURL=PDFAcroForm.d.ts.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroForm.d.ts.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroForm.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFAcroForm.d.ts","sourceRoot":"","sources":["../../../src/core/acroform/PDFAcroForm.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,sBAA4B;AAC7C,OAAO,OAAO,2BAAiC;AAC/C,OAAO,QAAQ,4BAAkC;AAEjD,OAAO,MAAM,0BAAgC;AAC7C,OAAO,YAAY,uBAAuC;AAO1D,cAAM,WAAW;IACf,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAEvB,MAAM,CAAC,QAAQ,SAAU,OAAO,iBAA2B;IAE3D,MAAM,CAAC,MAAM,YAAa,UAAU,iBAGlC;IAEF,OAAO;IAIP,MAAM,IAAI,QAAQ,GAAG,SAAS;IAM9B,SAAS,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,EAAE;IAarC,YAAY,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,EAAE;IAoBxC,QAAQ,CAAC,KAAK,EAAE,MAAM;IAKtB,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAmBtC,iBAAiB;;;CAUlB;AAED,eAAe,WAAW,CAAC"}
|
||||
78
node_modules/pdf-lib/cjs/core/acroform/PDFAcroForm.js
generated
vendored
Normal file
78
node_modules/pdf-lib/cjs/core/acroform/PDFAcroForm.js
generated
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var PDFDict_1 = tslib_1.__importDefault(require("../objects/PDFDict"));
|
||||
var PDFArray_1 = tslib_1.__importDefault(require("../objects/PDFArray"));
|
||||
var PDFName_1 = tslib_1.__importDefault(require("../objects/PDFName"));
|
||||
var PDFAcroNonTerminal_1 = tslib_1.__importDefault(require("./PDFAcroNonTerminal"));
|
||||
var utils_1 = require("./utils");
|
||||
var PDFAcroForm = /** @class */ (function () {
|
||||
function PDFAcroForm(dict) {
|
||||
this.dict = dict;
|
||||
}
|
||||
PDFAcroForm.prototype.Fields = function () {
|
||||
var fields = this.dict.lookup(PDFName_1.default.of('Fields'));
|
||||
if (fields instanceof PDFArray_1.default)
|
||||
return fields;
|
||||
return undefined;
|
||||
};
|
||||
PDFAcroForm.prototype.getFields = function () {
|
||||
var Fields = this.normalizedEntries().Fields;
|
||||
var fields = new Array(Fields.size());
|
||||
for (var idx = 0, len = Fields.size(); idx < len; idx++) {
|
||||
var ref = Fields.get(idx);
|
||||
var dict = Fields.lookup(idx, PDFDict_1.default);
|
||||
fields[idx] = [utils_1.createPDFAcroField(dict, ref), ref];
|
||||
}
|
||||
return fields;
|
||||
};
|
||||
PDFAcroForm.prototype.getAllFields = function () {
|
||||
var allFields = [];
|
||||
var pushFields = function (fields) {
|
||||
if (!fields)
|
||||
return;
|
||||
for (var idx = 0, len = fields.length; idx < len; idx++) {
|
||||
var field = fields[idx];
|
||||
allFields.push(field);
|
||||
var fieldModel = field[0];
|
||||
if (fieldModel instanceof PDFAcroNonTerminal_1.default) {
|
||||
pushFields(utils_1.createPDFAcroFields(fieldModel.Kids()));
|
||||
}
|
||||
}
|
||||
};
|
||||
pushFields(this.getFields());
|
||||
return allFields;
|
||||
};
|
||||
PDFAcroForm.prototype.addField = function (field) {
|
||||
var Fields = this.normalizedEntries().Fields;
|
||||
Fields === null || Fields === void 0 ? void 0 : Fields.push(field);
|
||||
};
|
||||
PDFAcroForm.prototype.removeField = function (field) {
|
||||
var parent = field.getParent();
|
||||
var fields = parent === undefined ? this.normalizedEntries().Fields : parent.Kids();
|
||||
var index = fields === null || fields === void 0 ? void 0 : fields.indexOf(field.ref);
|
||||
if (fields === undefined || index === undefined) {
|
||||
throw new Error("Tried to remove inexistent field " + field.getFullyQualifiedName());
|
||||
}
|
||||
fields.remove(index);
|
||||
if (parent !== undefined && fields.size() === 0) {
|
||||
this.removeField(parent);
|
||||
}
|
||||
};
|
||||
PDFAcroForm.prototype.normalizedEntries = function () {
|
||||
var Fields = this.Fields();
|
||||
if (!Fields) {
|
||||
Fields = this.dict.context.obj([]);
|
||||
this.dict.set(PDFName_1.default.of('Fields'), Fields);
|
||||
}
|
||||
return { Fields: Fields };
|
||||
};
|
||||
PDFAcroForm.fromDict = function (dict) { return new PDFAcroForm(dict); };
|
||||
PDFAcroForm.create = function (context) {
|
||||
var dict = context.obj({ Fields: [] });
|
||||
return new PDFAcroForm(dict);
|
||||
};
|
||||
return PDFAcroForm;
|
||||
}());
|
||||
exports.default = PDFAcroForm;
|
||||
//# sourceMappingURL=PDFAcroForm.js.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroForm.js.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroForm.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFAcroForm.js","sourceRoot":"","sources":["../../../src/core/acroform/PDFAcroForm.ts"],"names":[],"mappings":";;;AACA,uEAA+C;AAC/C,yEAAiD;AACjD,uEAA+C;AAG/C,oFAAsE;AACtE,iCAGiC;AAEjC;IAUE,qBAAoB,IAAa;QAC/B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,4BAAM,GAAN;QACE,IAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;QACtD,IAAI,MAAM,YAAY,kBAAQ;YAAE,OAAO,MAAM,CAAC;QAC9C,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,+BAAS,GAAT;QACU,IAAA,MAAM,GAAK,IAAI,CAAC,iBAAiB,EAAE,OAA7B,CAA8B;QAE5C,IAAM,M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AI,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;QACzC,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC,CAAC;IA+EJ,kBAAC;CAAA,AAvFD,IAuFC;AAED,kBAAe,WAAW,CAAC"}
|
||||
10
node_modules/pdf-lib/cjs/core/acroform/PDFAcroListBox.d.ts
generated
vendored
Normal file
10
node_modules/pdf-lib/cjs/core/acroform/PDFAcroListBox.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import PDFDict from "../objects/PDFDict";
|
||||
import PDFAcroChoice from "./PDFAcroChoice";
|
||||
import PDFContext from "../PDFContext";
|
||||
import PDFRef from "../objects/PDFRef";
|
||||
declare class PDFAcroListBox extends PDFAcroChoice {
|
||||
static fromDict: (dict: PDFDict, ref: PDFRef) => PDFAcroListBox;
|
||||
static create: (context: PDFContext) => PDFAcroListBox;
|
||||
}
|
||||
export default PDFAcroListBox;
|
||||
//# sourceMappingURL=PDFAcroListBox.d.ts.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroListBox.d.ts.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroListBox.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFAcroListBox.d.ts","sourceRoot":"","sources":["../../../src/core/acroform/PDFAcroListBox.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,2BAAiC;AAC/C,OAAO,aAAa,wBAAwC;AAC5D,OAAO,UAAU,sBAA4B;AAC7C,OAAO,MAAM,0BAAgC;AAE7C,cAAM,cAAe,SAAQ,aAAa;IACxC,MAAM,CAAC,QAAQ,SAAU,OAAO,OAAO,MAAM,oBACb;IAEhC,MAAM,CAAC,MAAM,YAAa,UAAU,oBAOlC;CACH;AAED,eAAe,cAAc,CAAC"}
|
||||
24
node_modules/pdf-lib/cjs/core/acroform/PDFAcroListBox.js
generated
vendored
Normal file
24
node_modules/pdf-lib/cjs/core/acroform/PDFAcroListBox.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var PDFAcroChoice_1 = tslib_1.__importDefault(require("./PDFAcroChoice"));
|
||||
var PDFAcroListBox = /** @class */ (function (_super) {
|
||||
tslib_1.__extends(PDFAcroListBox, _super);
|
||||
function PDFAcroListBox() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
PDFAcroListBox.fromDict = function (dict, ref) {
|
||||
return new PDFAcroListBox(dict, ref);
|
||||
};
|
||||
PDFAcroListBox.create = function (context) {
|
||||
var dict = context.obj({
|
||||
FT: 'Ch',
|
||||
Kids: [],
|
||||
});
|
||||
var ref = context.register(dict);
|
||||
return new PDFAcroListBox(dict, ref);
|
||||
};
|
||||
return PDFAcroListBox;
|
||||
}(PDFAcroChoice_1.default));
|
||||
exports.default = PDFAcroListBox;
|
||||
//# sourceMappingURL=PDFAcroListBox.js.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroListBox.js.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroListBox.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFAcroListBox.js","sourceRoot":"","sources":["../../../src/core/acroform/PDFAcroListBox.ts"],"names":[],"mappings":";;;AACA,0EAA4D;AAI5D;IAA6B,0CAAa;IAA1C;;IAYA,CAAC;IAXQ,uBAAQ,GAAG,UAAC,IAAa,EAAE,GAAW;QAC3C,OAAA,IAAI,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC;IAA7B,CAA6B,CAAC;IAEzB,qBAAM,GAAG,UAAC,OAAmB;QAClC,IAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC;YACvB,EAAE,EAAE,IAAI;YACR,IAAI,EAAE,EAAE;SACT,CAAC,CAAC;QACH,IAAM,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACnC,OAAO,IAAI,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACvC,CAAC,CAAC;IACJ,qBAAC;CAAA,AAZD,CAA6B,uBAAa,GAYzC;AAED,kBAAe,cAAc,CAAC"}
|
||||
14
node_modules/pdf-lib/cjs/core/acroform/PDFAcroNonTerminal.d.ts
generated
vendored
Normal file
14
node_modules/pdf-lib/cjs/core/acroform/PDFAcroNonTerminal.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import PDFDict from "../objects/PDFDict";
|
||||
import PDFRef from "../objects/PDFRef";
|
||||
import PDFContext from "../PDFContext";
|
||||
import PDFAcroField from "./PDFAcroField";
|
||||
declare class PDFAcroNonTerminal extends PDFAcroField {
|
||||
static fromDict: (dict: PDFDict, ref: PDFRef) => PDFAcroNonTerminal;
|
||||
static create: (context: PDFContext) => PDFAcroNonTerminal;
|
||||
addField(field: PDFRef): void;
|
||||
normalizedEntries(): {
|
||||
Kids: import("../objects/PDFArray").default;
|
||||
};
|
||||
}
|
||||
export default PDFAcroNonTerminal;
|
||||
//# sourceMappingURL=PDFAcroNonTerminal.d.ts.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroNonTerminal.d.ts.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroNonTerminal.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFAcroNonTerminal.d.ts","sourceRoot":"","sources":["../../../src/core/acroform/PDFAcroNonTerminal.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,2BAAiC;AAC/C,OAAO,MAAM,0BAAgC;AAE7C,OAAO,UAAU,sBAA4B;AAC7C,OAAO,YAAY,uBAAuC;AAE1D,cAAM,kBAAmB,SAAQ,YAAY;IAC3C,MAAM,CAAC,QAAQ,SAAU,OAAO,OAAO,MAAM,wBACT;IAEpC,MAAM,CAAC,MAAM,YAAa,UAAU,wBAIlC;IAEF,QAAQ,CAAC,KAAK,EAAE,MAAM;IAKtB,iBAAiB;;;CAUlB;AAED,eAAe,kBAAkB,CAAC"}
|
||||
34
node_modules/pdf-lib/cjs/core/acroform/PDFAcroNonTerminal.js
generated
vendored
Normal file
34
node_modules/pdf-lib/cjs/core/acroform/PDFAcroNonTerminal.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var PDFName_1 = tslib_1.__importDefault(require("../objects/PDFName"));
|
||||
var PDFAcroField_1 = tslib_1.__importDefault(require("./PDFAcroField"));
|
||||
var PDFAcroNonTerminal = /** @class */ (function (_super) {
|
||||
tslib_1.__extends(PDFAcroNonTerminal, _super);
|
||||
function PDFAcroNonTerminal() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
PDFAcroNonTerminal.prototype.addField = function (field) {
|
||||
var Kids = this.normalizedEntries().Kids;
|
||||
Kids === null || Kids === void 0 ? void 0 : Kids.push(field);
|
||||
};
|
||||
PDFAcroNonTerminal.prototype.normalizedEntries = function () {
|
||||
var Kids = this.Kids();
|
||||
if (!Kids) {
|
||||
Kids = this.dict.context.obj([]);
|
||||
this.dict.set(PDFName_1.default.of('Kids'), Kids);
|
||||
}
|
||||
return { Kids: Kids };
|
||||
};
|
||||
PDFAcroNonTerminal.fromDict = function (dict, ref) {
|
||||
return new PDFAcroNonTerminal(dict, ref);
|
||||
};
|
||||
PDFAcroNonTerminal.create = function (context) {
|
||||
var dict = context.obj({});
|
||||
var ref = context.register(dict);
|
||||
return new PDFAcroNonTerminal(dict, ref);
|
||||
};
|
||||
return PDFAcroNonTerminal;
|
||||
}(PDFAcroField_1.default));
|
||||
exports.default = PDFAcroNonTerminal;
|
||||
//# sourceMappingURL=PDFAcroNonTerminal.js.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroNonTerminal.js.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroNonTerminal.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFAcroNonTerminal.js","sourceRoot":"","sources":["../../../src/core/acroform/PDFAcroNonTerminal.ts"],"names":[],"mappings":";;;AAEA,uEAA+C;AAE/C,wEAA0D;AAE1D;IAAiC,8CAAY;IAA7C;;IAyBA,CAAC;IAfC,qCAAQ,GAAR,UAAS,KAAa;QACZ,IAAA,IAAI,GAAK,IAAI,CAAC,iBAAiB,EAAE,KAA7B,CAA8B;QAC1C,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,CAAC,KAAK,EAAE;IACpB,CAAC;IAED,8CAAiB,GAAjB;QACE,IAAI,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAEvB,IAAI,CAAC,IAAI,EAAE;YACT,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACjC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAO,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC;SACzC;QAED,OAAO,EAAE,IAAI,MAAA,EAAE,CAAC;IAClB,CAAC;IAvBM,2BAAQ,GAAG,UAAC,IAAa,EAAE,GAAW;QAC3C,OAAA,IAAI,kBAAkB,CAAC,IAAI,EAAE,GAAG,CAAC;IAAjC,CAAiC,CAAC;IAE7B,yBAAM,GAAG,UAAC,OAAmB;QAClC,IAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC7B,IAAM,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACnC,OAAO,IAAI,kBAAkB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC3C,CAAC,CAAC;IAiBJ,yBAAC;CAAA,AAzBD,CAAiC,sBAAY,GAyB5C;AAED,kBAAe,kBAAkB,CAAC"}
|
||||
10
node_modules/pdf-lib/cjs/core/acroform/PDFAcroPushButton.d.ts
generated
vendored
Normal file
10
node_modules/pdf-lib/cjs/core/acroform/PDFAcroPushButton.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import PDFDict from "../objects/PDFDict";
|
||||
import PDFAcroButton from "./PDFAcroButton";
|
||||
import PDFContext from "../PDFContext";
|
||||
import PDFRef from "../objects/PDFRef";
|
||||
declare class PDFAcroPushButton extends PDFAcroButton {
|
||||
static fromDict: (dict: PDFDict, ref: PDFRef) => PDFAcroPushButton;
|
||||
static create: (context: PDFContext) => PDFAcroPushButton;
|
||||
}
|
||||
export default PDFAcroPushButton;
|
||||
//# sourceMappingURL=PDFAcroPushButton.d.ts.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroPushButton.d.ts.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroPushButton.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFAcroPushButton.d.ts","sourceRoot":"","sources":["../../../src/core/acroform/PDFAcroPushButton.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,2BAAiC;AAC/C,OAAO,aAAa,wBAAwC;AAC5D,OAAO,UAAU,sBAA4B;AAC7C,OAAO,MAAM,0BAAgC;AAG7C,cAAM,iBAAkB,SAAQ,aAAa;IAC3C,MAAM,CAAC,QAAQ,SAAU,OAAO,OAAO,MAAM,uBACV;IAEnC,MAAM,CAAC,MAAM,YAAa,UAAU,uBAQlC;CACH;AAED,eAAe,iBAAiB,CAAC"}
|
||||
26
node_modules/pdf-lib/cjs/core/acroform/PDFAcroPushButton.js
generated
vendored
Normal file
26
node_modules/pdf-lib/cjs/core/acroform/PDFAcroPushButton.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var PDFAcroButton_1 = tslib_1.__importDefault(require("./PDFAcroButton"));
|
||||
var flags_1 = require("./flags");
|
||||
var PDFAcroPushButton = /** @class */ (function (_super) {
|
||||
tslib_1.__extends(PDFAcroPushButton, _super);
|
||||
function PDFAcroPushButton() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
PDFAcroPushButton.fromDict = function (dict, ref) {
|
||||
return new PDFAcroPushButton(dict, ref);
|
||||
};
|
||||
PDFAcroPushButton.create = function (context) {
|
||||
var dict = context.obj({
|
||||
FT: 'Btn',
|
||||
Ff: flags_1.AcroButtonFlags.PushButton,
|
||||
Kids: [],
|
||||
});
|
||||
var ref = context.register(dict);
|
||||
return new PDFAcroPushButton(dict, ref);
|
||||
};
|
||||
return PDFAcroPushButton;
|
||||
}(PDFAcroButton_1.default));
|
||||
exports.default = PDFAcroPushButton;
|
||||
//# sourceMappingURL=PDFAcroPushButton.js.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroPushButton.js.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroPushButton.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFAcroPushButton.js","sourceRoot":"","sources":["../../../src/core/acroform/PDFAcroPushButton.ts"],"names":[],"mappings":";;;AACA,0EAA4D;AAG5D,iCAA0D;AAE1D;IAAgC,6CAAa;IAA7C;;IAaA,CAAC;IAZQ,0BAAQ,GAAG,UAAC,IAAa,EAAE,GAAW;QAC3C,OAAA,IAAI,iBAAiB,CAAC,IAAI,EAAE,GAAG,CAAC;IAAhC,CAAgC,CAAC;IAE5B,wBAAM,GAAG,UAAC,OAAmB;QAClC,IAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC;YACvB,EAAE,EAAE,KAAK;YACT,EAAE,EAAE,uBAAe,CAAC,UAAU;YAC9B,IAAI,EAAE,EAAE;SACT,CAAC,CAAC;QACH,IAAM,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACnC,OAAO,IAAI,iBAAiB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC1C,CAAC,CAAC;IACJ,wBAAC;CAAA,AAbD,CAAgC,uBAAa,GAa5C;AAED,kBAAe,iBAAiB,CAAC"}
|
||||
14
node_modules/pdf-lib/cjs/core/acroform/PDFAcroRadioButton.d.ts
generated
vendored
Normal file
14
node_modules/pdf-lib/cjs/core/acroform/PDFAcroRadioButton.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import PDFRef from "../objects/PDFRef";
|
||||
import PDFDict from "../objects/PDFDict";
|
||||
import PDFName from "../objects/PDFName";
|
||||
import PDFAcroButton from "./PDFAcroButton";
|
||||
import PDFContext from "../PDFContext";
|
||||
declare class PDFAcroRadioButton extends PDFAcroButton {
|
||||
static fromDict: (dict: PDFDict, ref: PDFRef) => PDFAcroRadioButton;
|
||||
static create: (context: PDFContext) => PDFAcroRadioButton;
|
||||
setValue(value: PDFName): void;
|
||||
getValue(): PDFName;
|
||||
getOnValues(): PDFName[];
|
||||
}
|
||||
export default PDFAcroRadioButton;
|
||||
//# sourceMappingURL=PDFAcroRadioButton.d.ts.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroRadioButton.d.ts.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroRadioButton.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFAcroRadioButton.d.ts","sourceRoot":"","sources":["../../../src/core/acroform/PDFAcroRadioButton.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,0BAAgC;AAC7C,OAAO,OAAO,2BAAiC;AAC/C,OAAO,OAAO,2BAAiC;AAC/C,OAAO,aAAa,wBAAwC;AAC5D,OAAO,UAAU,sBAA4B;AAI7C,cAAM,kBAAmB,SAAQ,aAAa;IAC5C,MAAM,CAAC,QAAQ,SAAU,OAAO,OAAO,MAAM,wBACT;IAEpC,MAAM,CAAC,MAAM,YAAa,UAAU,wBAQlC;IAEF,QAAQ,CAAC,KAAK,EAAE,OAAO;IAgBvB,QAAQ,IAAI,OAAO;IAMnB,WAAW,IAAI,OAAO,EAAE;CAWzB;AAED,eAAe,kBAAkB,CAAC"}
|
||||
57
node_modules/pdf-lib/cjs/core/acroform/PDFAcroRadioButton.js
generated
vendored
Normal file
57
node_modules/pdf-lib/cjs/core/acroform/PDFAcroRadioButton.js
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var PDFName_1 = tslib_1.__importDefault(require("../objects/PDFName"));
|
||||
var PDFAcroButton_1 = tslib_1.__importDefault(require("./PDFAcroButton"));
|
||||
var flags_1 = require("./flags");
|
||||
var errors_1 = require("../errors");
|
||||
var PDFAcroRadioButton = /** @class */ (function (_super) {
|
||||
tslib_1.__extends(PDFAcroRadioButton, _super);
|
||||
function PDFAcroRadioButton() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
PDFAcroRadioButton.prototype.setValue = function (value) {
|
||||
var onValues = this.getOnValues();
|
||||
if (!onValues.includes(value) && value !== PDFName_1.default.of('Off')) {
|
||||
throw new errors_1.InvalidAcroFieldValueError();
|
||||
}
|
||||
this.dict.set(PDFName_1.default.of('V'), value);
|
||||
var widgets = this.getWidgets();
|
||||
for (var idx = 0, len = widgets.length; idx < len; idx++) {
|
||||
var widget = widgets[idx];
|
||||
var state = widget.getOnValue() === value ? value : PDFName_1.default.of('Off');
|
||||
widget.setAppearanceState(state);
|
||||
}
|
||||
};
|
||||
PDFAcroRadioButton.prototype.getValue = function () {
|
||||
var v = this.V();
|
||||
if (v instanceof PDFName_1.default)
|
||||
return v;
|
||||
return PDFName_1.default.of('Off');
|
||||
};
|
||||
PDFAcroRadioButton.prototype.getOnValues = function () {
|
||||
var widgets = this.getWidgets();
|
||||
var onValues = [];
|
||||
for (var idx = 0, len = widgets.length; idx < len; idx++) {
|
||||
var onValue = widgets[idx].getOnValue();
|
||||
if (onValue)
|
||||
onValues.push(onValue);
|
||||
}
|
||||
return onValues;
|
||||
};
|
||||
PDFAcroRadioButton.fromDict = function (dict, ref) {
|
||||
return new PDFAcroRadioButton(dict, ref);
|
||||
};
|
||||
PDFAcroRadioButton.create = function (context) {
|
||||
var dict = context.obj({
|
||||
FT: 'Btn',
|
||||
Ff: flags_1.AcroButtonFlags.Radio,
|
||||
Kids: [],
|
||||
});
|
||||
var ref = context.register(dict);
|
||||
return new PDFAcroRadioButton(dict, ref);
|
||||
};
|
||||
return PDFAcroRadioButton;
|
||||
}(PDFAcroButton_1.default));
|
||||
exports.default = PDFAcroRadioButton;
|
||||
//# sourceMappingURL=PDFAcroRadioButton.js.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroRadioButton.js.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroRadioButton.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFAcroRadioButton.js","sourceRoot":"","sources":["../../../src/core/acroform/PDFAcroRadioButton.ts"],"names":[],"mappings":";;;AAEA,uEAA+C;AAC/C,0EAA4D;AAE5D,iCAA0D;AAC1D,oCAA6D;AAE7D;IAAiC,8CAAa;IAA9C;;IA+CA,CAAC;IAjCC,qCAAQ,GAAR,UAAS,KAAc;QACrB,IAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACpC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,iBAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE;YAC5D,MAAM,IAAI,mCAA0B,EAAE,CAAC;SACxC;QAED,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAO,CAAC,EAAE,CAAC,GAAG,CAA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AAmB;QAClC,IAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC;YACvB,EAAE,EAAE,KAAK;YACT,EAAE,EAAE,uBAAe,CAAC,KAAK;YACzB,IAAI,EAAE,EAAE;SACT,CAAC,CAAC;QACH,IAAM,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACnC,OAAO,IAAI,kBAAkB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC3C,CAAC,CAAC;IAmCJ,yBAAC;CAAA,AA/CD,CAAiC,uBAAa,GA+C7C;AAED,kBAAe,kBAAkB,CAAC"}
|
||||
8
node_modules/pdf-lib/cjs/core/acroform/PDFAcroSignature.d.ts
generated
vendored
Normal file
8
node_modules/pdf-lib/cjs/core/acroform/PDFAcroSignature.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import PDFDict from "../objects/PDFDict";
|
||||
import PDFRef from "../objects/PDFRef";
|
||||
import PDFAcroTerminal from "./PDFAcroTerminal";
|
||||
declare class PDFAcroSignature extends PDFAcroTerminal {
|
||||
static fromDict: (dict: PDFDict, ref: PDFRef) => PDFAcroSignature;
|
||||
}
|
||||
export default PDFAcroSignature;
|
||||
//# sourceMappingURL=PDFAcroSignature.d.ts.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroSignature.d.ts.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroSignature.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFAcroSignature.d.ts","sourceRoot":"","sources":["../../../src/core/acroform/PDFAcroSignature.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,2BAAiC;AAC/C,OAAO,MAAM,0BAAgC;AAC7C,OAAO,eAAe,0BAA0C;AAEhE,cAAM,gBAAiB,SAAQ,eAAe;IAC5C,MAAM,CAAC,QAAQ,SAAU,OAAO,OAAO,MAAM,sBACX;CACnC;AAED,eAAe,gBAAgB,CAAC"}
|
||||
16
node_modules/pdf-lib/cjs/core/acroform/PDFAcroSignature.js
generated
vendored
Normal file
16
node_modules/pdf-lib/cjs/core/acroform/PDFAcroSignature.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var PDFAcroTerminal_1 = tslib_1.__importDefault(require("./PDFAcroTerminal"));
|
||||
var PDFAcroSignature = /** @class */ (function (_super) {
|
||||
tslib_1.__extends(PDFAcroSignature, _super);
|
||||
function PDFAcroSignature() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
PDFAcroSignature.fromDict = function (dict, ref) {
|
||||
return new PDFAcroSignature(dict, ref);
|
||||
};
|
||||
return PDFAcroSignature;
|
||||
}(PDFAcroTerminal_1.default));
|
||||
exports.default = PDFAcroSignature;
|
||||
//# sourceMappingURL=PDFAcroSignature.js.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroSignature.js.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroSignature.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFAcroSignature.js","sourceRoot":"","sources":["../../../src/core/acroform/PDFAcroSignature.ts"],"names":[],"mappings":";;;AAEA,8EAAgE;AAEhE;IAA+B,4CAAe;IAA9C;;IAGA,CAAC;IAFQ,yBAAQ,GAAG,UAAC,IAAa,EAAE,GAAW;QAC3C,OAAA,IAAI,gBAAgB,CAAC,IAAI,EAAE,GAAG,CAAC;IAA/B,CAA+B,CAAC;IACpC,uBAAC;CAAA,AAHD,CAA+B,yBAAe,GAG7C;AAED,kBAAe,gBAAgB,CAAC"}
|
||||
17
node_modules/pdf-lib/cjs/core/acroform/PDFAcroTerminal.d.ts
generated
vendored
Normal file
17
node_modules/pdf-lib/cjs/core/acroform/PDFAcroTerminal.d.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import PDFDict from "../objects/PDFDict";
|
||||
import PDFName from "../objects/PDFName";
|
||||
import PDFRef from "../objects/PDFRef";
|
||||
import PDFAcroField from "./PDFAcroField";
|
||||
import PDFWidgetAnnotation from "../annotation/PDFWidgetAnnotation";
|
||||
declare class PDFAcroTerminal extends PDFAcroField {
|
||||
static fromDict: (dict: PDFDict, ref: PDFRef) => PDFAcroTerminal;
|
||||
FT(): PDFName;
|
||||
getWidgets(): PDFWidgetAnnotation[];
|
||||
addWidget(ref: PDFRef): void;
|
||||
removeWidget(idx: number): void;
|
||||
normalizedEntries(): {
|
||||
Kids: import("../objects/PDFArray").default;
|
||||
};
|
||||
}
|
||||
export default PDFAcroTerminal;
|
||||
//# sourceMappingURL=PDFAcroTerminal.d.ts.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroTerminal.d.ts.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroTerminal.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFAcroTerminal.d.ts","sourceRoot":"","sources":["../../../src/core/acroform/PDFAcroTerminal.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,2BAAiC;AAC/C,OAAO,OAAO,2BAAiC;AAC/C,OAAO,MAAM,0BAAgC;AAC7C,OAAO,YAAY,uBAAuC;AAC1D,OAAO,mBAAmB,0CAAgD;AAG1E,cAAM,eAAgB,SAAQ,YAAY;IACxC,MAAM,CAAC,QAAQ,SAAU,OAAO,OAAO,MAAM,qBACZ;IAEjC,EAAE,IAAI,OAAO;IAKb,UAAU,IAAI,mBAAmB,EAAE;IAgBnC,SAAS,CAAC,GAAG,EAAE,MAAM;IAKrB,YAAY,CAAC,GAAG,EAAE,MAAM;IAgBxB,iBAAiB;;;CAelB;AAED,eAAe,eAAe,CAAC"}
|
||||
70
node_modules/pdf-lib/cjs/core/acroform/PDFAcroTerminal.js
generated
vendored
Normal file
70
node_modules/pdf-lib/cjs/core/acroform/PDFAcroTerminal.js
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var PDFDict_1 = tslib_1.__importDefault(require("../objects/PDFDict"));
|
||||
var PDFName_1 = tslib_1.__importDefault(require("../objects/PDFName"));
|
||||
var PDFAcroField_1 = tslib_1.__importDefault(require("./PDFAcroField"));
|
||||
var PDFWidgetAnnotation_1 = tslib_1.__importDefault(require("../annotation/PDFWidgetAnnotation"));
|
||||
var errors_1 = require("../errors");
|
||||
var PDFAcroTerminal = /** @class */ (function (_super) {
|
||||
tslib_1.__extends(PDFAcroTerminal, _super);
|
||||
function PDFAcroTerminal() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
PDFAcroTerminal.prototype.FT = function () {
|
||||
var nameOrRef = this.getInheritableAttribute(PDFName_1.default.of('FT'));
|
||||
return this.dict.context.lookup(nameOrRef, PDFName_1.default);
|
||||
};
|
||||
PDFAcroTerminal.prototype.getWidgets = function () {
|
||||
var kidDicts = this.Kids();
|
||||
// This field is itself a widget
|
||||
if (!kidDicts)
|
||||
return [PDFWidgetAnnotation_1.default.fromDict(this.dict)];
|
||||
// This field's kids are its widgets
|
||||
var widgets = new Array(kidDicts.size());
|
||||
for (var idx = 0, len = kidDicts.size(); idx < len; idx++) {
|
||||
var dict = kidDicts.lookup(idx, PDFDict_1.default);
|
||||
widgets[idx] = PDFWidgetAnnotation_1.default.fromDict(dict);
|
||||
}
|
||||
return widgets;
|
||||
};
|
||||
PDFAcroTerminal.prototype.addWidget = function (ref) {
|
||||
var Kids = this.normalizedEntries().Kids;
|
||||
Kids.push(ref);
|
||||
};
|
||||
PDFAcroTerminal.prototype.removeWidget = function (idx) {
|
||||
var kidDicts = this.Kids();
|
||||
if (!kidDicts) {
|
||||
// This field is itself a widget
|
||||
if (idx !== 0)
|
||||
throw new errors_1.IndexOutOfBoundsError(idx, 0, 0);
|
||||
this.setKids([]);
|
||||
}
|
||||
else {
|
||||
// This field's kids are its widgets
|
||||
if (idx < 0 || idx > kidDicts.size()) {
|
||||
throw new errors_1.IndexOutOfBoundsError(idx, 0, kidDicts.size());
|
||||
}
|
||||
kidDicts.remove(idx);
|
||||
}
|
||||
};
|
||||
PDFAcroTerminal.prototype.normalizedEntries = function () {
|
||||
var Kids = this.Kids();
|
||||
// If this field is itself a widget (because it was only rendered once in
|
||||
// the document, so the field and widget properties were merged) then we
|
||||
// add itself to the `Kids` array. The alternative would be to try
|
||||
// splitting apart the widget properties and creating a separate object
|
||||
// for them.
|
||||
if (!Kids) {
|
||||
Kids = this.dict.context.obj([this.ref]);
|
||||
this.dict.set(PDFName_1.default.of('Kids'), Kids);
|
||||
}
|
||||
return { Kids: Kids };
|
||||
};
|
||||
PDFAcroTerminal.fromDict = function (dict, ref) {
|
||||
return new PDFAcroTerminal(dict, ref);
|
||||
};
|
||||
return PDFAcroTerminal;
|
||||
}(PDFAcroField_1.default));
|
||||
exports.default = PDFAcroTerminal;
|
||||
//# sourceMappingURL=PDFAcroTerminal.js.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroTerminal.js.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroTerminal.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFAcroTerminal.js","sourceRoot":"","sources":["../../../src/core/acroform/PDFAcroTerminal.ts"],"names":[],"mappings":";;;AAAA,uEAA+C;AAC/C,uEAA+C;AAE/C,wEAA0D;AAC1D,kGAA0E;AAC1E,oCAAwD;AAExD;IAA8B,2CAAY;IAA1C;;IA6DA,CAAC;IAzDC,4BAAE,GAAF;QACE,IAAM,SAAS,GAAG,IAAI,CAAC,uBAAuB,CAAC,iBAAO,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;QACjE,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC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I,8BAAqB,CAAC,GAAG,EAAE,CAAC,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;aAC1D;YACD,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SACtB;IACH,CAAC;IAED,2CAAiB,GAAjB;QACE,IAAI,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAEvB,yEAAyE;QACzE,wEAAwE;QACxE,kEAAkE;QAClE,uEAAuE;QACvE,YAAY;QACZ,IAAI,CAAC,IAAI,EAAE;YACT,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;YACzC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAO,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC;SACzC;QAED,OAAO,EAAE,IAAI,MAAA,EAAE,CAAC;IAClB,CAAC;IA3DM,wBAAQ,GAAG,UAAC,IAAa,EAAE,GAAW;QAC3C,OAAA,IAAI,eAAe,CAAC,IAAI,EAAE,GAAG,CAAC;IAA9B,CAA8B,CAAC;IA2DnC,sBAAC;CAAA,AA7DD,CAA8B,sBAAY,GA6DzC;AAED,kBAAe,eAAe,CAAC"}
|
||||
23
node_modules/pdf-lib/cjs/core/acroform/PDFAcroText.d.ts
generated
vendored
Normal file
23
node_modules/pdf-lib/cjs/core/acroform/PDFAcroText.d.ts
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
import PDFContext from "../PDFContext";
|
||||
import PDFDict from "../objects/PDFDict";
|
||||
import PDFNumber from "../objects/PDFNumber";
|
||||
import PDFString from "../objects/PDFString";
|
||||
import PDFHexString from "../objects/PDFHexString";
|
||||
import PDFRef from "../objects/PDFRef";
|
||||
import PDFAcroTerminal from "./PDFAcroTerminal";
|
||||
declare class PDFAcroText extends PDFAcroTerminal {
|
||||
static fromDict: (dict: PDFDict, ref: PDFRef) => PDFAcroText;
|
||||
static create: (context: PDFContext) => PDFAcroText;
|
||||
MaxLen(): PDFNumber | undefined;
|
||||
Q(): PDFNumber | undefined;
|
||||
setMaxLength(maxLength: number): void;
|
||||
removeMaxLength(): void;
|
||||
getMaxLength(): number | undefined;
|
||||
setQuadding(quadding: 0 | 1 | 2): void;
|
||||
getQuadding(): number | undefined;
|
||||
setValue(value: PDFHexString | PDFString): void;
|
||||
removeValue(): void;
|
||||
getValue(): PDFString | PDFHexString | undefined;
|
||||
}
|
||||
export default PDFAcroText;
|
||||
//# sourceMappingURL=PDFAcroText.d.ts.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroText.d.ts.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroText.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFAcroText.d.ts","sourceRoot":"","sources":["../../../src/core/acroform/PDFAcroText.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,sBAA4B;AAC7C,OAAO,OAAO,2BAAiC;AAC/C,OAAO,SAAS,6BAAmC;AACnD,OAAO,SAAS,6BAAmC;AACnD,OAAO,YAAY,gCAAsC;AAEzD,OAAO,MAAM,0BAAgC;AAC7C,OAAO,eAAe,0BAA0C;AAEhE,cAAM,WAAY,SAAQ,eAAe;IACvC,MAAM,CAAC,QAAQ,SAAU,OAAO,OAAO,MAAM,iBAAgC;IAE7E,MAAM,CAAC,MAAM,YAAa,UAAU,iBAOlC;IAEF,MAAM,IAAI,SAAS,GAAG,SAAS;IAM/B,CAAC,IAAI,SAAS,GAAG,SAAS;IAM1B,YAAY,CAAC,SAAS,EAAE,MAAM;IAI9B,eAAe;IAIf,YAAY,IAAI,MAAM,GAAG,SAAS;IAIlC,WAAW,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC;IAI/B,WAAW,IAAI,MAAM,GAAG,SAAS;IAIjC,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS;IAWxC,WAAW;IAIX,QAAQ,IAAI,SAAS,GAAG,YAAY,GAAG,SAAS;CAKjD;AAED,eAAe,WAAW,CAAC"}
|
||||
73
node_modules/pdf-lib/cjs/core/acroform/PDFAcroText.js
generated
vendored
Normal file
73
node_modules/pdf-lib/cjs/core/acroform/PDFAcroText.js
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var PDFNumber_1 = tslib_1.__importDefault(require("../objects/PDFNumber"));
|
||||
var PDFString_1 = tslib_1.__importDefault(require("../objects/PDFString"));
|
||||
var PDFHexString_1 = tslib_1.__importDefault(require("../objects/PDFHexString"));
|
||||
var PDFName_1 = tslib_1.__importDefault(require("../objects/PDFName"));
|
||||
var PDFAcroTerminal_1 = tslib_1.__importDefault(require("./PDFAcroTerminal"));
|
||||
var PDFAcroText = /** @class */ (function (_super) {
|
||||
tslib_1.__extends(PDFAcroText, _super);
|
||||
function PDFAcroText() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
PDFAcroText.prototype.MaxLen = function () {
|
||||
var maxLen = this.dict.lookup(PDFName_1.default.of('MaxLen'));
|
||||
if (maxLen instanceof PDFNumber_1.default)
|
||||
return maxLen;
|
||||
return undefined;
|
||||
};
|
||||
PDFAcroText.prototype.Q = function () {
|
||||
var q = this.dict.lookup(PDFName_1.default.of('Q'));
|
||||
if (q instanceof PDFNumber_1.default)
|
||||
return q;
|
||||
return undefined;
|
||||
};
|
||||
PDFAcroText.prototype.setMaxLength = function (maxLength) {
|
||||
this.dict.set(PDFName_1.default.of('MaxLen'), PDFNumber_1.default.of(maxLength));
|
||||
};
|
||||
PDFAcroText.prototype.removeMaxLength = function () {
|
||||
this.dict.delete(PDFName_1.default.of('MaxLen'));
|
||||
};
|
||||
PDFAcroText.prototype.getMaxLength = function () {
|
||||
var _a;
|
||||
return (_a = this.MaxLen()) === null || _a === void 0 ? void 0 : _a.asNumber();
|
||||
};
|
||||
PDFAcroText.prototype.setQuadding = function (quadding) {
|
||||
this.dict.set(PDFName_1.default.of('Q'), PDFNumber_1.default.of(quadding));
|
||||
};
|
||||
PDFAcroText.prototype.getQuadding = function () {
|
||||
var _a;
|
||||
return (_a = this.Q()) === null || _a === void 0 ? void 0 : _a.asNumber();
|
||||
};
|
||||
PDFAcroText.prototype.setValue = function (value) {
|
||||
this.dict.set(PDFName_1.default.of('V'), value);
|
||||
// const widgets = this.getWidgets();
|
||||
// for (let idx = 0, len = widgets.length; idx < len; idx++) {
|
||||
// const widget = widgets[idx];
|
||||
// const state = widget.getOnValue() === value ? value : PDFName.of('Off');
|
||||
// widget.setAppearanceState(state);
|
||||
// }
|
||||
};
|
||||
PDFAcroText.prototype.removeValue = function () {
|
||||
this.dict.delete(PDFName_1.default.of('V'));
|
||||
};
|
||||
PDFAcroText.prototype.getValue = function () {
|
||||
var v = this.V();
|
||||
if (v instanceof PDFString_1.default || v instanceof PDFHexString_1.default)
|
||||
return v;
|
||||
return undefined;
|
||||
};
|
||||
PDFAcroText.fromDict = function (dict, ref) { return new PDFAcroText(dict, ref); };
|
||||
PDFAcroText.create = function (context) {
|
||||
var dict = context.obj({
|
||||
FT: 'Tx',
|
||||
Kids: [],
|
||||
});
|
||||
var ref = context.register(dict);
|
||||
return new PDFAcroText(dict, ref);
|
||||
};
|
||||
return PDFAcroText;
|
||||
}(PDFAcroTerminal_1.default));
|
||||
exports.default = PDFAcroText;
|
||||
//# sourceMappingURL=PDFAcroText.js.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroText.js.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/PDFAcroText.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFAcroText.js","sourceRoot":"","sources":["../../../src/core/acroform/PDFAcroText.ts"],"names":[],"mappings":";;;AAEA,2EAAmD;AACnD,2EAAmD;AACnD,iFAAyD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CAAC,GAAG,CAAC,iBAAO,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;QAEtC,qCAAqC;QACrC,8DAA8D;QAC9D,iCAAiC;QACjC,6EAA6E;QAC7E,sCAAsC;QACtC,IAAI;IACN,CAAC;IAED,iCAAW,GAAX;QACE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACpC,CAAC;IAED,8BAAQ,GAAR;QACE,IAAM,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC;QACnB,IAAI,CAAC,YAAY,mBAAS,IAAI,CAAC,YAAY,sBAAY;YAAE,OAAO,CAAC,CAAC;QAClE,OAAO,SAAS,CAAC;IACnB,CAAC;IA9DM,oBAAQ,GAAG,UAAC,IAAa,EAAE,GAAW,IAAK,OAAA,IAAI,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,EAA1B,CAA0B,CAAC;IAEtE,kBAAM,GAAG,UAAC,OAAmB;QAClC,IAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC;YACvB,EAAE,EAAE,IAAI;YACR,IAAI,EAAE,EAAE;SACT,CAAC,CAAC;QACH,IAAM,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACnC,OAAO,IAAI,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACpC,CAAC,CAAC;IAsDJ,kBAAC;CAAA,AAhED,CAA0B,yBAAe,GAgExC;AAED,kBAAe,WAAW,CAAC"}
|
||||
142
node_modules/pdf-lib/cjs/core/acroform/flags.d.ts
generated
vendored
Normal file
142
node_modules/pdf-lib/cjs/core/acroform/flags.d.ts
generated
vendored
Normal file
@@ -0,0 +1,142 @@
|
||||
/** From PDF spec table 221 */
|
||||
export declare enum AcroFieldFlags {
|
||||
/**
|
||||
* If set, the user may not change the value of the field. Any associated
|
||||
* widget annotations will not interact with the user; that is, they will not
|
||||
* respond to mouse clicks or change their appearance in response to mouse
|
||||
* motions. This flag is useful for fields whose values are computed or
|
||||
* imported from a database.
|
||||
*/
|
||||
ReadOnly,
|
||||
/**
|
||||
* If set, the field shall have a value at the time it is exported by a
|
||||
* submit-form action (see 12.7.5.2, "Submit-Form Action").
|
||||
*/
|
||||
Required,
|
||||
/**
|
||||
* If set, the field shall not be exported by a submit-form action
|
||||
* (see 12.7.5.2, "Submit-Form Action").
|
||||
*/
|
||||
NoExport
|
||||
}
|
||||
/** From PDF spec table 226 */
|
||||
export declare enum AcroButtonFlags {
|
||||
/**
|
||||
* (Radio buttons only) If set, exactly one radio button shall be selected at
|
||||
* all times; selecting the currently selected button has no effect. If clear,
|
||||
* clicking the selected button deselects it, leaving no button selected.
|
||||
*/
|
||||
NoToggleToOff,
|
||||
/**
|
||||
* If set, the field is a set of radio buttons; if clear, the field is a check
|
||||
* box. This flag may be set only if the Pushbutton flag is clear.
|
||||
*/
|
||||
Radio,
|
||||
/**
|
||||
* If set, the field is a pushbutton that does not retain a permanent value.
|
||||
*/
|
||||
PushButton,
|
||||
/**
|
||||
* If set, a group of radio buttons within a radio button field that use the
|
||||
* same value for the on state will turn on and off in unison; that is if one
|
||||
* is checked, they are all checked. If clear, the buttons are mutually
|
||||
* exclusive (the same behavior as HTML radio buttons).
|
||||
*/
|
||||
RadiosInUnison
|
||||
}
|
||||
/** From PDF spec table 228 */
|
||||
export declare enum AcroTextFlags {
|
||||
/**
|
||||
* If set, the field may contain multiple lines of text; if clear, the field's
|
||||
* text shall be restricted to a single line.
|
||||
*/
|
||||
Multiline,
|
||||
/**
|
||||
* If set, the field is intended for entering a secure password that should
|
||||
* not be echoed visibly to the screen. Characters typed from the keyboard
|
||||
* shall instead be echoed in some unreadable form, such as asterisks or
|
||||
* bullet characters.
|
||||
* > NOTE To protect password confidentiality, readers should never store
|
||||
* > the value of the text field in the PDF file if this flag is set.
|
||||
*/
|
||||
Password,
|
||||
/**
|
||||
* If set, the text entered in the field represents the pathname of a file
|
||||
* whose contents shall be submitted as the value of the field.
|
||||
*/
|
||||
FileSelect,
|
||||
/**
|
||||
* If set, text entered in the field shall not be spell-checked.
|
||||
*/
|
||||
DoNotSpellCheck,
|
||||
/**
|
||||
* If set, the field shall not scroll (horizontally for single-line fields,
|
||||
* vertically for multiple-line fields) to accommodate more text than fits
|
||||
* within its annotation rectangle. Once the field is full, no further text
|
||||
* shall be accepted for interactive form filling; for non-interactive form
|
||||
* filling, the filler should take care not to add more character than will
|
||||
* visibly fit in the defined area.
|
||||
*/
|
||||
DoNotScroll,
|
||||
/**
|
||||
* May be set only if the MaxLen entry is present in the text field dictionary
|
||||
* (see Table 229) and if the Multiline, Password, and FileSelect flags are
|
||||
* clear. If set, the field shall be automatically divided into as many
|
||||
* equally spaced positions, or combs, as the value of MaxLen, and the text
|
||||
* is laid out into those combs.
|
||||
*/
|
||||
Comb,
|
||||
/**
|
||||
* If set, the value of this field shall be a rich text string
|
||||
* (see 12.7.3.4, "Rich Text Strings"). If the field has a value, the RV
|
||||
* entry of the field dictionary (Table 222) shall specify the rich text
|
||||
* string.
|
||||
*/
|
||||
RichText
|
||||
}
|
||||
/** From PDF spec table 230 */
|
||||
export declare enum AcroChoiceFlags {
|
||||
/**
|
||||
* If set, the field is a combo box; if clear, the field is a list box.
|
||||
*/
|
||||
Combo,
|
||||
/**
|
||||
* If set, the combo box shall include an editable text box as well as a
|
||||
* drop-down list; if clear, it shall include only a drop-down list. This
|
||||
* flag shall be used only if the Combo flag is set.
|
||||
*/
|
||||
Edit,
|
||||
/**
|
||||
* If set, the field's option items shall be sorted alphabetically. This flag
|
||||
* is intended for use by writers, not by readers. Conforming readers shall
|
||||
* display the options in the order in which they occur in the Opt array
|
||||
* (see Table 231).
|
||||
*/
|
||||
Sort,
|
||||
/**
|
||||
* If set, more than one of the field's option items may be selected
|
||||
* simultaneously; if clear, at most one item shall be selected.
|
||||
*/
|
||||
MultiSelect,
|
||||
/**
|
||||
* If set, text entered in the field shall not be spell-checked. This flag
|
||||
* shall not be used unless the Combo and Edit flags are both set.
|
||||
*/
|
||||
DoNotSpellCheck,
|
||||
/**
|
||||
* If set, the new value shall be committed as soon as a selection is made
|
||||
* (commonly with the pointing device). In this case, supplying a value for
|
||||
* a field involves three actions: selecting the field for fill-in,
|
||||
* selecting a choice for the fill-in value, and leaving that field, which
|
||||
* finalizes or "commits" the data choice and triggers any actions associated
|
||||
* with the entry or changing of this data. If this flag is on, then
|
||||
* processing does not wait for leaving the field action to occur, but
|
||||
* immediately proceeds to the third step.
|
||||
*
|
||||
* This option enables applications to perform an action once a selection is
|
||||
* made, without requiring the user to exit the field. If clear, the new
|
||||
* value is not committed until the user exits the field.
|
||||
*/
|
||||
CommitOnSelChange
|
||||
}
|
||||
//# sourceMappingURL=flags.d.ts.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/flags.d.ts.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/flags.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"flags.d.ts","sourceRoot":"","sources":["../../../src/core/acroform/flags.ts"],"names":[],"mappings":"AAEA,8BAA8B;AAC9B,oBAAY,cAAc;IACxB;;;;;;OAMG;IACH,QAAsB;IAEtB;;;OAGG;IACH,QAAsB;IAEtB;;;OAGG;IACH,QAAsB;CACvB;AAED,8BAA8B;AAC9B,oBAAY,eAAe;IACzB;;;;OAIG;IACH,aAA4B;IAE5B;;;OAGG;IACH,KAAoB;IAEpB;;OAEG;IACH,UAAyB;IAEzB;;;;;OAKG;IACH,cAA6B;CAC9B;AAED,8BAA8B;AAC9B,oBAAY,aAAa;IACvB;;;OAGG;IACH,SAAwB;IAExB;;;;;;;OAOG;IACH,QAAuB;IAEvB;;;OAGG;IACH,UAAyB;IAEzB;;OAEG;IACH,eAA8B;IAE9B;;;;;;;OAOG;IACH,WAA0B;IAE1B;;;;;;OAMG;IACH,IAAmB;IAEnB;;;;;OAKG;IACH,QAAuB;CACxB;AAED,8BAA8B;AAC9B,oBAAY,eAAe;IACzB;;OAEG;IACH,KAAoB;IAEpB;;;;OAIG;IACH,IAAmB;IAEnB;;;;;OAKG;IACH,IAAmB;IAEnB;;;OAGG;IACH,WAA0B;IAE1B;;;OAGG;IACH,eAA8B;IAE9B;;;;;;;;;;;;;OAaG;IACH,iBAAgC;CACjC"}
|
||||
150
node_modules/pdf-lib/cjs/core/acroform/flags.js
generated
vendored
Normal file
150
node_modules/pdf-lib/cjs/core/acroform/flags.js
generated
vendored
Normal file
@@ -0,0 +1,150 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AcroChoiceFlags = exports.AcroTextFlags = exports.AcroButtonFlags = exports.AcroFieldFlags = void 0;
|
||||
var flag = function (bitIndex) { return 1 << bitIndex; };
|
||||
/** From PDF spec table 221 */
|
||||
var AcroFieldFlags;
|
||||
(function (AcroFieldFlags) {
|
||||
/**
|
||||
* If set, the user may not change the value of the field. Any associated
|
||||
* widget annotations will not interact with the user; that is, they will not
|
||||
* respond to mouse clicks or change their appearance in response to mouse
|
||||
* motions. This flag is useful for fields whose values are computed or
|
||||
* imported from a database.
|
||||
*/
|
||||
AcroFieldFlags[AcroFieldFlags["ReadOnly"] = flag(1 - 1)] = "ReadOnly";
|
||||
/**
|
||||
* If set, the field shall have a value at the time it is exported by a
|
||||
* submit-form action (see 12.7.5.2, "Submit-Form Action").
|
||||
*/
|
||||
AcroFieldFlags[AcroFieldFlags["Required"] = flag(2 - 1)] = "Required";
|
||||
/**
|
||||
* If set, the field shall not be exported by a submit-form action
|
||||
* (see 12.7.5.2, "Submit-Form Action").
|
||||
*/
|
||||
AcroFieldFlags[AcroFieldFlags["NoExport"] = flag(3 - 1)] = "NoExport";
|
||||
})(AcroFieldFlags = exports.AcroFieldFlags || (exports.AcroFieldFlags = {}));
|
||||
/** From PDF spec table 226 */
|
||||
var AcroButtonFlags;
|
||||
(function (AcroButtonFlags) {
|
||||
/**
|
||||
* (Radio buttons only) If set, exactly one radio button shall be selected at
|
||||
* all times; selecting the currently selected button has no effect. If clear,
|
||||
* clicking the selected button deselects it, leaving no button selected.
|
||||
*/
|
||||
AcroButtonFlags[AcroButtonFlags["NoToggleToOff"] = flag(15 - 1)] = "NoToggleToOff";
|
||||
/**
|
||||
* If set, the field is a set of radio buttons; if clear, the field is a check
|
||||
* box. This flag may be set only if the Pushbutton flag is clear.
|
||||
*/
|
||||
AcroButtonFlags[AcroButtonFlags["Radio"] = flag(16 - 1)] = "Radio";
|
||||
/**
|
||||
* If set, the field is a pushbutton that does not retain a permanent value.
|
||||
*/
|
||||
AcroButtonFlags[AcroButtonFlags["PushButton"] = flag(17 - 1)] = "PushButton";
|
||||
/**
|
||||
* If set, a group of radio buttons within a radio button field that use the
|
||||
* same value for the on state will turn on and off in unison; that is if one
|
||||
* is checked, they are all checked. If clear, the buttons are mutually
|
||||
* exclusive (the same behavior as HTML radio buttons).
|
||||
*/
|
||||
AcroButtonFlags[AcroButtonFlags["RadiosInUnison"] = flag(26 - 1)] = "RadiosInUnison";
|
||||
})(AcroButtonFlags = exports.AcroButtonFlags || (exports.AcroButtonFlags = {}));
|
||||
/** From PDF spec table 228 */
|
||||
var AcroTextFlags;
|
||||
(function (AcroTextFlags) {
|
||||
/**
|
||||
* If set, the field may contain multiple lines of text; if clear, the field's
|
||||
* text shall be restricted to a single line.
|
||||
*/
|
||||
AcroTextFlags[AcroTextFlags["Multiline"] = flag(13 - 1)] = "Multiline";
|
||||
/**
|
||||
* If set, the field is intended for entering a secure password that should
|
||||
* not be echoed visibly to the screen. Characters typed from the keyboard
|
||||
* shall instead be echoed in some unreadable form, such as asterisks or
|
||||
* bullet characters.
|
||||
* > NOTE To protect password confidentiality, readers should never store
|
||||
* > the value of the text field in the PDF file if this flag is set.
|
||||
*/
|
||||
AcroTextFlags[AcroTextFlags["Password"] = flag(14 - 1)] = "Password";
|
||||
/**
|
||||
* If set, the text entered in the field represents the pathname of a file
|
||||
* whose contents shall be submitted as the value of the field.
|
||||
*/
|
||||
AcroTextFlags[AcroTextFlags["FileSelect"] = flag(21 - 1)] = "FileSelect";
|
||||
/**
|
||||
* If set, text entered in the field shall not be spell-checked.
|
||||
*/
|
||||
AcroTextFlags[AcroTextFlags["DoNotSpellCheck"] = flag(23 - 1)] = "DoNotSpellCheck";
|
||||
/**
|
||||
* If set, the field shall not scroll (horizontally for single-line fields,
|
||||
* vertically for multiple-line fields) to accommodate more text than fits
|
||||
* within its annotation rectangle. Once the field is full, no further text
|
||||
* shall be accepted for interactive form filling; for non-interactive form
|
||||
* filling, the filler should take care not to add more character than will
|
||||
* visibly fit in the defined area.
|
||||
*/
|
||||
AcroTextFlags[AcroTextFlags["DoNotScroll"] = flag(24 - 1)] = "DoNotScroll";
|
||||
/**
|
||||
* May be set only if the MaxLen entry is present in the text field dictionary
|
||||
* (see Table 229) and if the Multiline, Password, and FileSelect flags are
|
||||
* clear. If set, the field shall be automatically divided into as many
|
||||
* equally spaced positions, or combs, as the value of MaxLen, and the text
|
||||
* is laid out into those combs.
|
||||
*/
|
||||
AcroTextFlags[AcroTextFlags["Comb"] = flag(25 - 1)] = "Comb";
|
||||
/**
|
||||
* If set, the value of this field shall be a rich text string
|
||||
* (see 12.7.3.4, "Rich Text Strings"). If the field has a value, the RV
|
||||
* entry of the field dictionary (Table 222) shall specify the rich text
|
||||
* string.
|
||||
*/
|
||||
AcroTextFlags[AcroTextFlags["RichText"] = flag(26 - 1)] = "RichText";
|
||||
})(AcroTextFlags = exports.AcroTextFlags || (exports.AcroTextFlags = {}));
|
||||
/** From PDF spec table 230 */
|
||||
var AcroChoiceFlags;
|
||||
(function (AcroChoiceFlags) {
|
||||
/**
|
||||
* If set, the field is a combo box; if clear, the field is a list box.
|
||||
*/
|
||||
AcroChoiceFlags[AcroChoiceFlags["Combo"] = flag(18 - 1)] = "Combo";
|
||||
/**
|
||||
* If set, the combo box shall include an editable text box as well as a
|
||||
* drop-down list; if clear, it shall include only a drop-down list. This
|
||||
* flag shall be used only if the Combo flag is set.
|
||||
*/
|
||||
AcroChoiceFlags[AcroChoiceFlags["Edit"] = flag(19 - 1)] = "Edit";
|
||||
/**
|
||||
* If set, the field's option items shall be sorted alphabetically. This flag
|
||||
* is intended for use by writers, not by readers. Conforming readers shall
|
||||
* display the options in the order in which they occur in the Opt array
|
||||
* (see Table 231).
|
||||
*/
|
||||
AcroChoiceFlags[AcroChoiceFlags["Sort"] = flag(20 - 1)] = "Sort";
|
||||
/**
|
||||
* If set, more than one of the field's option items may be selected
|
||||
* simultaneously; if clear, at most one item shall be selected.
|
||||
*/
|
||||
AcroChoiceFlags[AcroChoiceFlags["MultiSelect"] = flag(22 - 1)] = "MultiSelect";
|
||||
/**
|
||||
* If set, text entered in the field shall not be spell-checked. This flag
|
||||
* shall not be used unless the Combo and Edit flags are both set.
|
||||
*/
|
||||
AcroChoiceFlags[AcroChoiceFlags["DoNotSpellCheck"] = flag(23 - 1)] = "DoNotSpellCheck";
|
||||
/**
|
||||
* If set, the new value shall be committed as soon as a selection is made
|
||||
* (commonly with the pointing device). In this case, supplying a value for
|
||||
* a field involves three actions: selecting the field for fill-in,
|
||||
* selecting a choice for the fill-in value, and leaving that field, which
|
||||
* finalizes or "commits" the data choice and triggers any actions associated
|
||||
* with the entry or changing of this data. If this flag is on, then
|
||||
* processing does not wait for leaving the field action to occur, but
|
||||
* immediately proceeds to the third step.
|
||||
*
|
||||
* This option enables applications to perform an action once a selection is
|
||||
* made, without requiring the user to exit the field. If clear, the new
|
||||
* value is not committed until the user exits the field.
|
||||
*/
|
||||
AcroChoiceFlags[AcroChoiceFlags["CommitOnSelChange"] = flag(27 - 1)] = "CommitOnSelChange";
|
||||
})(AcroChoiceFlags = exports.AcroChoiceFlags || (exports.AcroChoiceFlags = {}));
|
||||
//# sourceMappingURL=flags.js.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/flags.js.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/flags.js.map
generated
vendored
Normal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AA;IAEzB;;OAEG;IACH,iDAAkB,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,qBAAA,CAAA;IAE9B;;;;;;;OAOG;IACH,6CAAc,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,iBAAA,CAAA;IAE1B;;;;;;OAMG;IACH,sCAAO,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,UAAA,CAAA;IAEnB;;;;;OAKG;IACH,0CAAW,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,cAAA,CAAA;AACzB,CAAC,EAtDW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAsDxB;AAED,8BAA8B;AAC9B,IAAY,eAgDX;AAhDD,WAAY,eAAe;IACzB;;OAEG;IACH,2CAAQ,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,WAAA,CAAA;IAEpB;;;;OAIG;IACH,0CAAO,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,UAAA,CAAA;IAEnB;;;;;OAKG;IACH,0CAAO,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,UAAA,CAAA;IAEnB;;;OAGG;IACH,iDAAc,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,iBAAA,CAAA;IAE1B;;;OAGG;IACH,qDAAkB,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,qBAAA,CAAA;IAE9B;;;;;;;;;;;;;OAaG;IACH,uDAAoB,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,uBAAA,CAAA;AAClC,CAAC,EAhDW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAgD1B"}
|
||||
16
node_modules/pdf-lib/cjs/core/acroform/index.d.ts
generated
vendored
Normal file
16
node_modules/pdf-lib/cjs/core/acroform/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
export { default as PDFAcroButton } from "./PDFAcroButton";
|
||||
export { default as PDFAcroCheckBox } from "./PDFAcroCheckBox";
|
||||
export { default as PDFAcroChoice } from "./PDFAcroChoice";
|
||||
export { default as PDFAcroComboBox } from "./PDFAcroComboBox";
|
||||
export { default as PDFAcroField } from "./PDFAcroField";
|
||||
export { default as PDFAcroForm } from "./PDFAcroForm";
|
||||
export { default as PDFAcroListBox } from "./PDFAcroListBox";
|
||||
export { default as PDFAcroNonTerminal } from "./PDFAcroNonTerminal";
|
||||
export { default as PDFAcroPushButton } from "./PDFAcroPushButton";
|
||||
export { default as PDFAcroRadioButton } from "./PDFAcroRadioButton";
|
||||
export { default as PDFAcroSignature } from "./PDFAcroSignature";
|
||||
export { default as PDFAcroTerminal } from "./PDFAcroTerminal";
|
||||
export { default as PDFAcroText } from "./PDFAcroText";
|
||||
export * from "./flags";
|
||||
export * from "./utils";
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/index.d.ts.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/acroform/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAe+N,iBAAiB,CAfxM;AAC3E,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAc8O,mBAAmB,CAdvN;AAC/E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAamQ,iBAAiB,CAb5O;AAC3E,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAYkR,mBAAmB,CAZ3P;AAC/E,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAWwS,gBAAgB,CAXjR;AACzE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAUyT,eAAe,CAVlS;AACvE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MASqU,kBAAkB,CAT9S;AAC7E,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAQmV,sBAAsB,CAR5T;AACrF,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAO0W,qBAAqB,CAPnV;AACnF,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAM8X,sBAAsB,CANvW;AACrF,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAKsZ,oBAAoB,CAL/X;AACjF,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAI2a,mBAAmB,CAJpZ;AAC/E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAGkc,eAAe,CAH3a;AACvE,cAEkf,SAAS,CAFnd;AACxC,cAC2f,SAAS,CAD5d"}
|
||||
32
node_modules/pdf-lib/cjs/core/acroform/index.js
generated
vendored
Normal file
32
node_modules/pdf-lib/cjs/core/acroform/index.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var PDFAcroButton_1 = require("./PDFAcroButton");
|
||||
Object.defineProperty(exports, "PDFAcroButton", { enumerable: true, get: function () { return PDFAcroButton_1.default; } });
|
||||
var PDFAcroCheckBox_1 = require("./PDFAcroCheckBox");
|
||||
Object.defineProperty(exports, "PDFAcroCheckBox", { enumerable: true, get: function () { return PDFAcroCheckBox_1.default; } });
|
||||
var PDFAcroChoice_1 = require("./PDFAcroChoice");
|
||||
Object.defineProperty(exports, "PDFAcroChoice", { enumerable: true, get: function () { return PDFAcroChoice_1.default; } });
|
||||
var PDFAcroComboBox_1 = require("./PDFAcroComboBox");
|
||||
Object.defineProperty(exports, "PDFAcroComboBox", { enumerable: true, get: function () { return PDFAcroComboBox_1.default; } });
|
||||
var PDFAcroField_1 = require("./PDFAcroField");
|
||||
Object.defineProperty(exports, "PDFAcroField", { enumerable: true, get: function () { return PDFAcroField_1.default; } });
|
||||
var PDFAcroForm_1 = require("./PDFAcroForm");
|
||||
Object.defineProperty(exports, "PDFAcroForm", { enumerable: true, get: function () { return PDFAcroForm_1.default; } });
|
||||
var PDFAcroListBox_1 = require("./PDFAcroListBox");
|
||||
Object.defineProperty(exports, "PDFAcroListBox", { enumerable: true, get: function () { return PDFAcroListBox_1.default; } });
|
||||
var PDFAcroNonTerminal_1 = require("./PDFAcroNonTerminal");
|
||||
Object.defineProperty(exports, "PDFAcroNonTerminal", { enumerable: true, get: function () { return PDFAcroNonTerminal_1.default; } });
|
||||
var PDFAcroPushButton_1 = require("./PDFAcroPushButton");
|
||||
Object.defineProperty(exports, "PDFAcroPushButton", { enumerable: true, get: function () { return PDFAcroPushButton_1.default; } });
|
||||
var PDFAcroRadioButton_1 = require("./PDFAcroRadioButton");
|
||||
Object.defineProperty(exports, "PDFAcroRadioButton", { enumerable: true, get: function () { return PDFAcroRadioButton_1.default; } });
|
||||
var PDFAcroSignature_1 = require("./PDFAcroSignature");
|
||||
Object.defineProperty(exports, "PDFAcroSignature", { enumerable: true, get: function () { return PDFAcroSignature_1.default; } });
|
||||
var PDFAcroTerminal_1 = require("./PDFAcroTerminal");
|
||||
Object.defineProperty(exports, "PDFAcroTerminal", { enumerable: true, get: function () { return PDFAcroTerminal_1.default; } });
|
||||
var PDFAcroText_1 = require("./PDFAcroText");
|
||||
Object.defineProperty(exports, "PDFAcroText", { enumerable: true, get: function () { return PDFAcroText_1.default; } });
|
||||
tslib_1.__exportStar(require("./flags"), exports);
|
||||
tslib_1.__exportStar(require("./utils"), exports);
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/index.js.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/acroform/index.ts"],"names":[],"mappings":";;;AAAA,iDAA2E;AAAlE,8GAAA,OAAO,OAAiB;AACjC,qDAA+E;AAAtE,kHAAA,OAAO,OAAmB;AACnC,iDAA2E;AAAlE,8GAAA,OAAO,OAAiB;AACjC,qDAA+E;AAAtE,kHAAA,OAAO,OAAmB;AACnC,+CAAyE;AAAhE,4GAAA,OAAO,OAAgB;AAChC,6CAAuE;AAA9D,0GAAA,OAAO,OAAe;AAC/B,mDAA6E;AAApE,gHAAA,OAAO,OAAkB;AAClC,2DAAqF;AAA5E,wHAAA,OAAO,OAAsB;AACtC,yDAAmF;AAA1E,sHAAA,OAAO,OAAqB;AACrC,2DAAqF;AAA5E,wHAAA,OAAO,OAAsB;AACtC,uDAAiF;AAAxE,oHAAA,OAAO,OAAoB;AACpC,qDAA+E;AAAtE,kHAAA,OAAO,OAAmB;AACnC,6CAAuE;AAA9D,0GAAA,OAAO,OAAe;AAC/B,kDAAwC;AACxC,kDAAwC"}
|
||||
7
node_modules/pdf-lib/cjs/core/acroform/utils.d.ts
generated
vendored
Normal file
7
node_modules/pdf-lib/cjs/core/acroform/utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import PDFDict from "../objects/PDFDict";
|
||||
import PDFArray from "../objects/PDFArray";
|
||||
import PDFRef from "../objects/PDFRef";
|
||||
import PDFAcroField from "./PDFAcroField";
|
||||
export declare const createPDFAcroFields: (kidDicts?: PDFArray | undefined) => [PDFAcroField, PDFRef][];
|
||||
export declare const createPDFAcroField: (dict: PDFDict, ref: PDFRef) => PDFAcroField;
|
||||
//# sourceMappingURL=utils.d.ts.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/utils.d.ts.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/utils.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/core/acroform/utils.ts"],"names":[],"mappings":"AAEA,OAAO,OAAO,2BAAiC;AAE/C,OAAO,QAAQ,4BAAkC;AACjD,OAAO,MAAM,0BAAgC;AAE7C,OAAO,YAAY,uBAAuC;AAc1D,eAAO,MAAM,mBAAmB,uCAE7B,CAAC,YAAY,EAAE,MAAM,CAAC,EAcxB,CAAC;AAEF,eAAO,MAAM,kBAAkB,SACvB,OAAO,OACR,MAAM,KACV,YAIF,CAAC"}
|
||||
127
node_modules/pdf-lib/cjs/core/acroform/utils.js
generated
vendored
Normal file
127
node_modules/pdf-lib/cjs/core/acroform/utils.js
generated
vendored
Normal file
@@ -0,0 +1,127 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createPDFAcroField = exports.createPDFAcroFields = void 0;
|
||||
var tslib_1 = require("tslib");
|
||||
var PDFNumber_1 = tslib_1.__importDefault(require("../objects/PDFNumber"));
|
||||
var PDFDict_1 = tslib_1.__importDefault(require("../objects/PDFDict"));
|
||||
var PDFName_1 = tslib_1.__importDefault(require("../objects/PDFName"));
|
||||
var PDFArray_1 = tslib_1.__importDefault(require("../objects/PDFArray"));
|
||||
var PDFRef_1 = tslib_1.__importDefault(require("../objects/PDFRef"));
|
||||
var PDFAcroTerminal_1 = tslib_1.__importDefault(require("./PDFAcroTerminal"));
|
||||
var PDFAcroNonTerminal_1 = tslib_1.__importDefault(require("./PDFAcroNonTerminal"));
|
||||
var PDFAcroSignature_1 = tslib_1.__importDefault(require("./PDFAcroSignature"));
|
||||
var PDFAcroText_1 = tslib_1.__importDefault(require("./PDFAcroText"));
|
||||
var PDFAcroPushButton_1 = tslib_1.__importDefault(require("./PDFAcroPushButton"));
|
||||
var PDFAcroRadioButton_1 = tslib_1.__importDefault(require("./PDFAcroRadioButton"));
|
||||
var PDFAcroCheckBox_1 = tslib_1.__importDefault(require("./PDFAcroCheckBox"));
|
||||
var PDFAcroComboBox_1 = tslib_1.__importDefault(require("./PDFAcroComboBox"));
|
||||
var PDFAcroListBox_1 = tslib_1.__importDefault(require("./PDFAcroListBox"));
|
||||
var flags_1 = require("./flags");
|
||||
exports.createPDFAcroFields = function (kidDicts) {
|
||||
if (!kidDicts)
|
||||
return [];
|
||||
var kids = [];
|
||||
for (var idx = 0, len = kidDicts.size(); idx < len; idx++) {
|
||||
var ref = kidDicts.get(idx);
|
||||
var dict = kidDicts.lookup(idx);
|
||||
// if (dict instanceof PDFDict) kids.push(PDFAcroField.fromDict(dict));
|
||||
if (ref instanceof PDFRef_1.default && dict instanceof PDFDict_1.default) {
|
||||
kids.push([exports.createPDFAcroField(dict, ref), ref]);
|
||||
}
|
||||
}
|
||||
return kids;
|
||||
};
|
||||
exports.createPDFAcroField = function (dict, ref) {
|
||||
var isNonTerminal = isNonTerminalAcroField(dict);
|
||||
if (isNonTerminal)
|
||||
return PDFAcroNonTerminal_1.default.fromDict(dict, ref);
|
||||
return createPDFAcroTerminal(dict, ref);
|
||||
};
|
||||
// TODO: Maybe just check if the dict is *not* a widget? That might be better.
|
||||
// According to the PDF spec:
|
||||
//
|
||||
// > A field's children in the hierarchy may also include widget annotations
|
||||
// > that define its appearance on the page. A field that has children that
|
||||
// > are fields is called a non-terminal field. A field that does not have
|
||||
// > children that are fields is called a terminal field.
|
||||
//
|
||||
// The spec is not entirely clear about how to determine whether a given
|
||||
// dictionary represents an acrofield or a widget annotation. So we will assume
|
||||
// that a dictionary is an acrofield if it is a member of the `/Kids` array
|
||||
// and it contains a `/T` entry (widgets do not have `/T` entries). This isn't
|
||||
// a bullet proof solution, because the `/T` entry is technically defined as
|
||||
// optional for acrofields by the PDF spec. But in practice all acrofields seem
|
||||
// to have a `/T` entry defined.
|
||||
var isNonTerminalAcroField = function (dict) {
|
||||
var kids = dict.lookup(PDFName_1.default.of('Kids'));
|
||||
if (kids instanceof PDFArray_1.default) {
|
||||
for (var idx = 0, len = kids.size(); idx < len; idx++) {
|
||||
var kid = kids.lookup(idx);
|
||||
var kidIsField = kid instanceof PDFDict_1.default && kid.has(PDFName_1.default.of('T'));
|
||||
if (kidIsField)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
var createPDFAcroTerminal = function (dict, ref) {
|
||||
var ftNameOrRef = getInheritableAttribute(dict, PDFName_1.default.of('FT'));
|
||||
var type = dict.context.lookup(ftNameOrRef, PDFName_1.default);
|
||||
if (type === PDFName_1.default.of('Btn'))
|
||||
return createPDFAcroButton(dict, ref);
|
||||
if (type === PDFName_1.default.of('Ch'))
|
||||
return createPDFAcroChoice(dict, ref);
|
||||
if (type === PDFName_1.default.of('Tx'))
|
||||
return PDFAcroText_1.default.fromDict(dict, ref);
|
||||
if (type === PDFName_1.default.of('Sig'))
|
||||
return PDFAcroSignature_1.default.fromDict(dict, ref);
|
||||
// We should never reach this line. But there are a lot of weird PDFs out
|
||||
// there. So, just to be safe, we'll try to handle things gracefully instead
|
||||
// of throwing an error.
|
||||
return PDFAcroTerminal_1.default.fromDict(dict, ref);
|
||||
};
|
||||
var createPDFAcroButton = function (dict, ref) {
|
||||
var _a;
|
||||
var ffNumberOrRef = getInheritableAttribute(dict, PDFName_1.default.of('Ff'));
|
||||
var ffNumber = dict.context.lookupMaybe(ffNumberOrRef, PDFNumber_1.default);
|
||||
var flags = (_a = ffNumber === null || ffNumber === void 0 ? void 0 : ffNumber.asNumber()) !== null && _a !== void 0 ? _a : 0;
|
||||
if (flagIsSet(flags, flags_1.AcroButtonFlags.PushButton)) {
|
||||
return PDFAcroPushButton_1.default.fromDict(dict, ref);
|
||||
}
|
||||
else if (flagIsSet(flags, flags_1.AcroButtonFlags.Radio)) {
|
||||
return PDFAcroRadioButton_1.default.fromDict(dict, ref);
|
||||
}
|
||||
else {
|
||||
return PDFAcroCheckBox_1.default.fromDict(dict, ref);
|
||||
}
|
||||
};
|
||||
var createPDFAcroChoice = function (dict, ref) {
|
||||
var _a;
|
||||
var ffNumberOrRef = getInheritableAttribute(dict, PDFName_1.default.of('Ff'));
|
||||
var ffNumber = dict.context.lookupMaybe(ffNumberOrRef, PDFNumber_1.default);
|
||||
var flags = (_a = ffNumber === null || ffNumber === void 0 ? void 0 : ffNumber.asNumber()) !== null && _a !== void 0 ? _a : 0;
|
||||
if (flagIsSet(flags, flags_1.AcroChoiceFlags.Combo)) {
|
||||
return PDFAcroComboBox_1.default.fromDict(dict, ref);
|
||||
}
|
||||
else {
|
||||
return PDFAcroListBox_1.default.fromDict(dict, ref);
|
||||
}
|
||||
};
|
||||
var flagIsSet = function (flags, flag) {
|
||||
return (flags & flag) !== 0;
|
||||
};
|
||||
var getInheritableAttribute = function (startNode, name) {
|
||||
var attribute;
|
||||
ascend(startNode, function (node) {
|
||||
if (!attribute)
|
||||
attribute = node.get(name);
|
||||
});
|
||||
return attribute;
|
||||
};
|
||||
var ascend = function (startNode, visitor) {
|
||||
visitor(startNode);
|
||||
var Parent = startNode.lookupMaybe(PDFName_1.default.of('Parent'), PDFDict_1.default);
|
||||
if (Parent)
|
||||
ascend(Parent, visitor);
|
||||
};
|
||||
//# sourceMappingURL=utils.js.map
|
||||
1
node_modules/pdf-lib/cjs/core/acroform/utils.js.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/acroform/utils.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/core/acroform/utils.ts"],"names":[],"mappings":";;;;AACA,2EAAmD;AACnD,uEAA+C;AAC/C,uEAA+C;AAC/C,yEAAiD;AACjD,qEAA6C;AAG7C,8EAAgE;AAChE,oFAAsE;AAEtE,gFAAkE;AAElE,sEAAwD;AACxD,kFAAoE;AACpE,oFAAsE;AACtE,8EAAgE;AAChE,8EAAgE;AAChE,4EAA8D;AAC9D,iCAA2E;AAE9D,QAAA,mBAAmB,GAAG,UACjC,QAAmB;IAEnB,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,CAAC;IAEzB,IAAM,IAAI,GAA6B,EAAE,CAAC;IAC1C,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,EAAE,GAAG,GAAG,GAAG,EAAE,GAAG,EAAE,EAAE;QACzD,IAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC9B,IAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CA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,MAAM,CAAC,SAAS,EAAE,UAAC,IAAI;QACrB,IAAI,CAAC,SAAS;YAAE,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IACH,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,IAAM,MAAM,GAAG,UAAC,SAAkB,EAAE,OAA+B;IACjE,OAAO,CAAC,SAAS,CAAC,CAAC;IACnB,IAAM,MAAM,GAAG,SAAS,CAAC,WAAW,CAAC,iBAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,iBAAO,CAAC,CAAC;IACpE,IAAI,MAAM;QAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACtC,CAAC,CAAC"}
|
||||
34
node_modules/pdf-lib/cjs/core/annotation/AppearanceCharacteristics.d.ts
generated
vendored
Normal file
34
node_modules/pdf-lib/cjs/core/annotation/AppearanceCharacteristics.d.ts
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
import PDFDict from "../objects/PDFDict";
|
||||
import PDFNumber from "../objects/PDFNumber";
|
||||
import PDFArray from "../objects/PDFArray";
|
||||
import PDFHexString from "../objects/PDFHexString";
|
||||
import PDFString from "../objects/PDFString";
|
||||
declare class AppearanceCharacteristics {
|
||||
readonly dict: PDFDict;
|
||||
static fromDict: (dict: PDFDict) => AppearanceCharacteristics;
|
||||
protected constructor(dict: PDFDict);
|
||||
R(): PDFNumber | undefined;
|
||||
BC(): PDFArray | undefined;
|
||||
BG(): PDFArray | undefined;
|
||||
CA(): PDFHexString | PDFString | undefined;
|
||||
RC(): PDFHexString | PDFString | undefined;
|
||||
AC(): PDFHexString | PDFString | undefined;
|
||||
getRotation(): number | undefined;
|
||||
getBorderColor(): number[] | undefined;
|
||||
getBackgroundColor(): number[] | undefined;
|
||||
getCaptions(): {
|
||||
normal?: string;
|
||||
rollover?: string;
|
||||
down?: string;
|
||||
};
|
||||
setRotation(rotation: number): void;
|
||||
setBorderColor(color: number[]): void;
|
||||
setBackgroundColor(color: number[]): void;
|
||||
setCaptions(captions: {
|
||||
normal: string;
|
||||
rollover?: string;
|
||||
down?: string;
|
||||
}): void;
|
||||
}
|
||||
export default AppearanceCharacteristics;
|
||||
//# sourceMappingURL=AppearanceCharacteristics.d.ts.map
|
||||
1
node_modules/pdf-lib/cjs/core/annotation/AppearanceCharacteristics.d.ts.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/annotation/AppearanceCharacteristics.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"AppearanceCharacteristics.d.ts","sourceRoot":"","sources":["../../../src/core/annotation/AppearanceCharacteristics.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,2BAAiC;AAE/C,OAAO,SAAS,6BAAmC;AACnD,OAAO,QAAQ,4BAAkC;AACjD,OAAO,YAAY,gCAAsC;AACzD,OAAO,SAAS,6BAAmC;AAEnD,cAAM,yBAAyB;IAC7B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAEvB,MAAM,CAAC,QAAQ,SAAU,OAAO,KAAG,yBAAyB,CACtB;IAEtC,SAAS,aAAa,IAAI,EAAE,OAAO;IAInC,CAAC,IAAI,SAAS,GAAG,SAAS;IAM1B,EAAE,IAAI,QAAQ,GAAG,SAAS;IAM1B,EAAE,IAAI,QAAQ,GAAG,SAAS;IAM1B,EAAE,IAAI,YAAY,GAAG,SAAS,GAAG,SAAS;IAM1C,EAAE,IAAI,YAAY,GAAG,SAAS,GAAG,SAAS;IAM1C,EAAE,IAAI,YAAY,GAAG,SAAS,GAAG,SAAS;IAM1C,WAAW,IAAI,MAAM,GAAG,SAAS;IAIjC,cAAc,IAAI,MAAM,EAAE,GAAG,SAAS;IActC,kBAAkB,IAAI,MAAM,EAAE,GAAG,SAAS;IAc1C,WAAW,IAAI;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE;IAYpE,WAAW,CAAC,QAAQ,EAAE,MAAM;IAK5B,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE;IAK9B,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE;IAKlC,WAAW,CAAC,QAAQ,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE;CAkB3E;AAED,eAAe,yBAAyB,CAAC"}
|
||||
123
node_modules/pdf-lib/cjs/core/annotation/AppearanceCharacteristics.js
generated
vendored
Normal file
123
node_modules/pdf-lib/cjs/core/annotation/AppearanceCharacteristics.js
generated
vendored
Normal file
@@ -0,0 +1,123 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var PDFName_1 = tslib_1.__importDefault(require("../objects/PDFName"));
|
||||
var PDFNumber_1 = tslib_1.__importDefault(require("../objects/PDFNumber"));
|
||||
var PDFArray_1 = tslib_1.__importDefault(require("../objects/PDFArray"));
|
||||
var PDFHexString_1 = tslib_1.__importDefault(require("../objects/PDFHexString"));
|
||||
var PDFString_1 = tslib_1.__importDefault(require("../objects/PDFString"));
|
||||
var AppearanceCharacteristics = /** @class */ (function () {
|
||||
function AppearanceCharacteristics(dict) {
|
||||
this.dict = dict;
|
||||
}
|
||||
AppearanceCharacteristics.prototype.R = function () {
|
||||
var R = this.dict.lookup(PDFName_1.default.of('R'));
|
||||
if (R instanceof PDFNumber_1.default)
|
||||
return R;
|
||||
return undefined;
|
||||
};
|
||||
AppearanceCharacteristics.prototype.BC = function () {
|
||||
var BC = this.dict.lookup(PDFName_1.default.of('BC'));
|
||||
if (BC instanceof PDFArray_1.default)
|
||||
return BC;
|
||||
return undefined;
|
||||
};
|
||||
AppearanceCharacteristics.prototype.BG = function () {
|
||||
var BG = this.dict.lookup(PDFName_1.default.of('BG'));
|
||||
if (BG instanceof PDFArray_1.default)
|
||||
return BG;
|
||||
return undefined;
|
||||
};
|
||||
AppearanceCharacteristics.prototype.CA = function () {
|
||||
var CA = this.dict.lookup(PDFName_1.default.of('CA'));
|
||||
if (CA instanceof PDFHexString_1.default || CA instanceof PDFString_1.default)
|
||||
return CA;
|
||||
return undefined;
|
||||
};
|
||||
AppearanceCharacteristics.prototype.RC = function () {
|
||||
var RC = this.dict.lookup(PDFName_1.default.of('RC'));
|
||||
if (RC instanceof PDFHexString_1.default || RC instanceof PDFString_1.default)
|
||||
return RC;
|
||||
return undefined;
|
||||
};
|
||||
AppearanceCharacteristics.prototype.AC = function () {
|
||||
var AC = this.dict.lookup(PDFName_1.default.of('AC'));
|
||||
if (AC instanceof PDFHexString_1.default || AC instanceof PDFString_1.default)
|
||||
return AC;
|
||||
return undefined;
|
||||
};
|
||||
AppearanceCharacteristics.prototype.getRotation = function () {
|
||||
var _a;
|
||||
return (_a = this.R()) === null || _a === void 0 ? void 0 : _a.asNumber();
|
||||
};
|
||||
AppearanceCharacteristics.prototype.getBorderColor = function () {
|
||||
var BC = this.BC();
|
||||
if (!BC)
|
||||
return undefined;
|
||||
var components = [];
|
||||
for (var idx = 0, len = BC === null || BC === void 0 ? void 0 : BC.size(); idx < len; idx++) {
|
||||
var component = BC.get(idx);
|
||||
if (component instanceof PDFNumber_1.default)
|
||||
components.push(component.asNumber());
|
||||
}
|
||||
return components;
|
||||
};
|
||||
AppearanceCharacteristics.prototype.getBackgroundColor = function () {
|
||||
var BG = this.BG();
|
||||
if (!BG)
|
||||
return undefined;
|
||||
var components = [];
|
||||
for (var idx = 0, len = BG === null || BG === void 0 ? void 0 : BG.size(); idx < len; idx++) {
|
||||
var component = BG.get(idx);
|
||||
if (component instanceof PDFNumber_1.default)
|
||||
components.push(component.asNumber());
|
||||
}
|
||||
return components;
|
||||
};
|
||||
AppearanceCharacteristics.prototype.getCaptions = function () {
|
||||
var CA = this.CA();
|
||||
var RC = this.RC();
|
||||
var AC = this.AC();
|
||||
return {
|
||||
normal: CA === null || CA === void 0 ? void 0 : CA.decodeText(),
|
||||
rollover: RC === null || RC === void 0 ? void 0 : RC.decodeText(),
|
||||
down: AC === null || AC === void 0 ? void 0 : AC.decodeText(),
|
||||
};
|
||||
};
|
||||
AppearanceCharacteristics.prototype.setRotation = function (rotation) {
|
||||
var R = this.dict.context.obj(rotation);
|
||||
this.dict.set(PDFName_1.default.of('R'), R);
|
||||
};
|
||||
AppearanceCharacteristics.prototype.setBorderColor = function (color) {
|
||||
var BC = this.dict.context.obj(color);
|
||||
this.dict.set(PDFName_1.default.of('BC'), BC);
|
||||
};
|
||||
AppearanceCharacteristics.prototype.setBackgroundColor = function (color) {
|
||||
var BG = this.dict.context.obj(color);
|
||||
this.dict.set(PDFName_1.default.of('BG'), BG);
|
||||
};
|
||||
AppearanceCharacteristics.prototype.setCaptions = function (captions) {
|
||||
var CA = PDFHexString_1.default.fromText(captions.normal);
|
||||
this.dict.set(PDFName_1.default.of('CA'), CA);
|
||||
if (captions.rollover) {
|
||||
var RC = PDFHexString_1.default.fromText(captions.rollover);
|
||||
this.dict.set(PDFName_1.default.of('RC'), RC);
|
||||
}
|
||||
else {
|
||||
this.dict.delete(PDFName_1.default.of('RC'));
|
||||
}
|
||||
if (captions.down) {
|
||||
var AC = PDFHexString_1.default.fromText(captions.down);
|
||||
this.dict.set(PDFName_1.default.of('AC'), AC);
|
||||
}
|
||||
else {
|
||||
this.dict.delete(PDFName_1.default.of('AC'));
|
||||
}
|
||||
};
|
||||
AppearanceCharacteristics.fromDict = function (dict) {
|
||||
return new AppearanceCharacteristics(dict);
|
||||
};
|
||||
return AppearanceCharacteristics;
|
||||
}());
|
||||
exports.default = AppearanceCharacteristics;
|
||||
//# sourceMappingURL=AppearanceCharacteristics.js.map
|
||||
1
node_modules/pdf-lib/cjs/core/annotation/AppearanceCharacteristics.js.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/annotation/AppearanceCharacteristics.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"AppearanceCharacteristics.js","sourceRoot":"","sources":["../../../src/core/annotation/AppearanceCharacteristics.ts"],"names":[],"mappings":";;;AACA,uEAA+C;AAC/C,2EAAmD;AACnD,yEAAiD;AACjD,iFAAyD;AACzD,2EAAmD;AAEnD;IAME,mCAAsB,IAAa;QACjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,qCAAC,GAAD;QACE,IAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAC5C,IAAI,CAAC,YAAY,mBAAS;YAAE,OAAO,CAAC,CAAC;QACrC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,sCAAE,GAAF;QACE,IAAM,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAO,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9C,IAAI,EAAE,YAAY,kBAAQ;YAAE,OAAO,EAAE,CAAC;QACtC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,sCAAE,GAAF;QACE,IAAM,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAO,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9C,IAAI,EAAE,YAAY,kBAAQ;YAAE,OAAO,EAAE,CAAC;QACtC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,sCAAE,GAAF;QACE,IAAM,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAO,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9C,IAAI,EAAE,YAAY,sBAAY,IAAI,EAAE,YAAY,mBAAS;YAAE,OAAO,EAAE,CAAC;QACrE,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,sCAAE,GAAF;QACE,IAAM,EAAE,GAAG,IAA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IAuHxC,gCAAC;CAAA,AA3HD,IA2HC;AAED,kBAAe,yBAAyB,CAAC"}
|
||||
12
node_modules/pdf-lib/cjs/core/annotation/BorderStyle.d.ts
generated
vendored
Normal file
12
node_modules/pdf-lib/cjs/core/annotation/BorderStyle.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import PDFDict from "../objects/PDFDict";
|
||||
import PDFNumber from "../objects/PDFNumber";
|
||||
declare class BorderStyle {
|
||||
readonly dict: PDFDict;
|
||||
static fromDict: (dict: PDFDict) => BorderStyle;
|
||||
protected constructor(dict: PDFDict);
|
||||
W(): PDFNumber | undefined;
|
||||
getWidth(): number | undefined;
|
||||
setWidth(width: number): void;
|
||||
}
|
||||
export default BorderStyle;
|
||||
//# sourceMappingURL=BorderStyle.d.ts.map
|
||||
1
node_modules/pdf-lib/cjs/core/annotation/BorderStyle.d.ts.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/annotation/BorderStyle.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"BorderStyle.d.ts","sourceRoot":"","sources":["../../../src/core/annotation/BorderStyle.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,2BAAiC;AAE/C,OAAO,SAAS,6BAAmC;AAGnD,cAAM,WAAW;IACf,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAEvB,MAAM,CAAC,QAAQ,SAAU,OAAO,KAAG,WAAW,CAA0B;IAExE,SAAS,aAAa,IAAI,EAAE,OAAO;IAInC,CAAC,IAAI,SAAS,GAAG,SAAS;IAM1B,QAAQ,IAAI,MAAM,GAAG,SAAS;IAI9B,QAAQ,CAAC,KAAK,EAAE,MAAM;CAIvB;AAED,eAAe,WAAW,CAAC"}
|
||||
29
node_modules/pdf-lib/cjs/core/annotation/BorderStyle.js
generated
vendored
Normal file
29
node_modules/pdf-lib/cjs/core/annotation/BorderStyle.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var PDFName_1 = tslib_1.__importDefault(require("../objects/PDFName"));
|
||||
var PDFNumber_1 = tslib_1.__importDefault(require("../objects/PDFNumber"));
|
||||
// TODO: Also handle the `/S` and `/D` entries
|
||||
var BorderStyle = /** @class */ (function () {
|
||||
function BorderStyle(dict) {
|
||||
this.dict = dict;
|
||||
}
|
||||
BorderStyle.prototype.W = function () {
|
||||
var W = this.dict.lookup(PDFName_1.default.of('W'));
|
||||
if (W instanceof PDFNumber_1.default)
|
||||
return W;
|
||||
return undefined;
|
||||
};
|
||||
BorderStyle.prototype.getWidth = function () {
|
||||
var _a, _b;
|
||||
return (_b = (_a = this.W()) === null || _a === void 0 ? void 0 : _a.asNumber()) !== null && _b !== void 0 ? _b : 1;
|
||||
};
|
||||
BorderStyle.prototype.setWidth = function (width) {
|
||||
var W = this.dict.context.obj(width);
|
||||
this.dict.set(PDFName_1.default.of('W'), W);
|
||||
};
|
||||
BorderStyle.fromDict = function (dict) { return new BorderStyle(dict); };
|
||||
return BorderStyle;
|
||||
}());
|
||||
exports.default = BorderStyle;
|
||||
//# sourceMappingURL=BorderStyle.js.map
|
||||
1
node_modules/pdf-lib/cjs/core/annotation/BorderStyle.js.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/annotation/BorderStyle.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"BorderStyle.js","sourceRoot":"","sources":["../../../src/core/annotation/BorderStyle.ts"],"names":[],"mappings":";;;AACA,uEAA+C;AAC/C,2EAAmD;AAEnD,8CAA8C;AAC9C;IAKE,qBAAsB,IAAa;QACjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,uBAAC,GAAD;QACE,IAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAC5C,IAAI,CAAC,YAAY,mBAAS;YAAE,OAAO,CAAC,CAAC;QACrC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,8BAAQ,GAAR;;QACE,mBAAO,IAAI,CAAC,CAAC,EAAE,0CAAE,QAAQ,qCAAM,CAAC,CAAC;IACnC,CAAC;IAED,8BAAQ,GAAR,UAAS,KAAa;QACpB,IAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACvC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAO,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IACpC,CAAC;IAnBM,oBAAQ,GAAG,UAAC,IAAa,IAAkB,OAAA,IAAI,WAAW,CAAC,IAAI,CAAC,EAArB,CAAqB,CAAC;IAoB1E,kBAAC;CAAA,AAvBD,IAuBC;AAED,kBAAe,WAAW,CAAC"}
|
||||
52
node_modules/pdf-lib/cjs/core/annotation/PDFAnnotation.d.ts
generated
vendored
Normal file
52
node_modules/pdf-lib/cjs/core/annotation/PDFAnnotation.d.ts
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
import PDFDict from "../objects/PDFDict";
|
||||
import PDFName from "../objects/PDFName";
|
||||
import PDFStream from "../objects/PDFStream";
|
||||
import PDFArray from "../objects/PDFArray";
|
||||
import PDFRef from "../objects/PDFRef";
|
||||
import PDFNumber from "../objects/PDFNumber";
|
||||
declare class PDFAnnotation {
|
||||
readonly dict: PDFDict;
|
||||
static fromDict: (dict: PDFDict) => PDFAnnotation;
|
||||
protected constructor(dict: PDFDict);
|
||||
Rect(): PDFArray | undefined;
|
||||
AP(): PDFDict | undefined;
|
||||
F(): PDFNumber | undefined;
|
||||
getRectangle(): {
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
};
|
||||
setRectangle(rect: {
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
}): void;
|
||||
getAppearanceState(): PDFName | undefined;
|
||||
setAppearanceState(state: PDFName): void;
|
||||
setAppearances(appearances: PDFDict): void;
|
||||
ensureAP(): PDFDict;
|
||||
getNormalAppearance(): PDFRef | PDFDict;
|
||||
/** @param appearance A PDFDict or PDFStream (direct or ref) */
|
||||
setNormalAppearance(appearance: PDFRef | PDFDict): void;
|
||||
/** @param appearance A PDFDict or PDFStream (direct or ref) */
|
||||
setRolloverAppearance(appearance: PDFRef | PDFDict): void;
|
||||
/** @param appearance A PDFDict or PDFStream (direct or ref) */
|
||||
setDownAppearance(appearance: PDFRef | PDFDict): void;
|
||||
removeRolloverAppearance(): void;
|
||||
removeDownAppearance(): void;
|
||||
getAppearances(): {
|
||||
normal: PDFStream | PDFDict;
|
||||
rollover?: PDFStream | PDFDict;
|
||||
down?: PDFStream | PDFDict;
|
||||
} | undefined;
|
||||
getFlags(): number;
|
||||
setFlags(flags: number): void;
|
||||
hasFlag(flag: number): boolean;
|
||||
setFlag(flag: number): void;
|
||||
clearFlag(flag: number): void;
|
||||
setFlagTo(flag: number, enable: boolean): void;
|
||||
}
|
||||
export default PDFAnnotation;
|
||||
//# sourceMappingURL=PDFAnnotation.d.ts.map
|
||||
1
node_modules/pdf-lib/cjs/core/annotation/PDFAnnotation.d.ts.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/annotation/PDFAnnotation.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFAnnotation.d.ts","sourceRoot":"","sources":["../../../src/core/annotation/PDFAnnotation.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,2BAAiC;AAC/C,OAAO,OAAO,2BAAiC;AAC/C,OAAO,SAAS,6BAAmC;AACnD,OAAO,QAAQ,4BAAkC;AACjD,OAAO,MAAM,0BAAgC;AAC7C,OAAO,SAAS,6BAAmC;AAEnD,cAAM,aAAa;IACjB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAEvB,MAAM,CAAC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;IAKpB,SAAS,CAAC,IAAI,EAAE,MAAM;IAKtB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO;CAIxC;AAED,eAAe,aAAa,CAAC"}
|
||||
123
node_modules/pdf-lib/cjs/core/annotation/PDFAnnotation.js
generated
vendored
Normal file
123
node_modules/pdf-lib/cjs/core/annotation/PDFAnnotation.js
generated
vendored
Normal file
@@ -0,0 +1,123 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var PDFDict_1 = tslib_1.__importDefault(require("../objects/PDFDict"));
|
||||
var PDFName_1 = tslib_1.__importDefault(require("../objects/PDFName"));
|
||||
var PDFStream_1 = tslib_1.__importDefault(require("../objects/PDFStream"));
|
||||
var PDFArray_1 = tslib_1.__importDefault(require("../objects/PDFArray"));
|
||||
var PDFRef_1 = tslib_1.__importDefault(require("../objects/PDFRef"));
|
||||
var PDFNumber_1 = tslib_1.__importDefault(require("../objects/PDFNumber"));
|
||||
var PDFAnnotation = /** @class */ (function () {
|
||||
function PDFAnnotation(dict) {
|
||||
this.dict = dict;
|
||||
}
|
||||
// This is technically required by the PDF spec
|
||||
PDFAnnotation.prototype.Rect = function () {
|
||||
return this.dict.lookup(PDFName_1.default.of('Rect'), PDFArray_1.default);
|
||||
};
|
||||
PDFAnnotation.prototype.AP = function () {
|
||||
return this.dict.lookupMaybe(PDFName_1.default.of('AP'), PDFDict_1.default);
|
||||
};
|
||||
PDFAnnotation.prototype.F = function () {
|
||||
var numberOrRef = this.dict.lookup(PDFName_1.default.of('F'));
|
||||
return this.dict.context.lookupMaybe(numberOrRef, PDFNumber_1.default);
|
||||
};
|
||||
PDFAnnotation.prototype.getRectangle = function () {
|
||||
var _a;
|
||||
var Rect = this.Rect();
|
||||
return (_a = Rect === null || Rect === void 0 ? void 0 : Rect.asRectangle()) !== null && _a !== void 0 ? _a : { x: 0, y: 0, width: 0, height: 0 };
|
||||
};
|
||||
PDFAnnotation.prototype.setRectangle = function (rect) {
|
||||
var x = rect.x, y = rect.y, width = rect.width, height = rect.height;
|
||||
var Rect = this.dict.context.obj([x, y, x + width, y + height]);
|
||||
this.dict.set(PDFName_1.default.of('Rect'), Rect);
|
||||
};
|
||||
PDFAnnotation.prototype.getAppearanceState = function () {
|
||||
var AS = this.dict.lookup(PDFName_1.default.of('AS'));
|
||||
if (AS instanceof PDFName_1.default)
|
||||
return AS;
|
||||
return undefined;
|
||||
};
|
||||
PDFAnnotation.prototype.setAppearanceState = function (state) {
|
||||
this.dict.set(PDFName_1.default.of('AS'), state);
|
||||
};
|
||||
PDFAnnotation.prototype.setAppearances = function (appearances) {
|
||||
this.dict.set(PDFName_1.default.of('AP'), appearances);
|
||||
};
|
||||
PDFAnnotation.prototype.ensureAP = function () {
|
||||
var AP = this.AP();
|
||||
if (!AP) {
|
||||
AP = this.dict.context.obj({});
|
||||
this.dict.set(PDFName_1.default.of('AP'), AP);
|
||||
}
|
||||
return AP;
|
||||
};
|
||||
PDFAnnotation.prototype.getNormalAppearance = function () {
|
||||
var AP = this.ensureAP();
|
||||
var N = AP.get(PDFName_1.default.of('N'));
|
||||
if (N instanceof PDFRef_1.default || N instanceof PDFDict_1.default)
|
||||
return N;
|
||||
throw new Error("Unexpected N type: " + (N === null || N === void 0 ? void 0 : N.constructor.name));
|
||||
};
|
||||
/** @param appearance A PDFDict or PDFStream (direct or ref) */
|
||||
PDFAnnotation.prototype.setNormalAppearance = function (appearance) {
|
||||
var AP = this.ensureAP();
|
||||
AP.set(PDFName_1.default.of('N'), appearance);
|
||||
};
|
||||
/** @param appearance A PDFDict or PDFStream (direct or ref) */
|
||||
PDFAnnotation.prototype.setRolloverAppearance = function (appearance) {
|
||||
var AP = this.ensureAP();
|
||||
AP.set(PDFName_1.default.of('R'), appearance);
|
||||
};
|
||||
/** @param appearance A PDFDict or PDFStream (direct or ref) */
|
||||
PDFAnnotation.prototype.setDownAppearance = function (appearance) {
|
||||
var AP = this.ensureAP();
|
||||
AP.set(PDFName_1.default.of('D'), appearance);
|
||||
};
|
||||
PDFAnnotation.prototype.removeRolloverAppearance = function () {
|
||||
var AP = this.AP();
|
||||
AP === null || AP === void 0 ? void 0 : AP.delete(PDFName_1.default.of('R'));
|
||||
};
|
||||
PDFAnnotation.prototype.removeDownAppearance = function () {
|
||||
var AP = this.AP();
|
||||
AP === null || AP === void 0 ? void 0 : AP.delete(PDFName_1.default.of('D'));
|
||||
};
|
||||
PDFAnnotation.prototype.getAppearances = function () {
|
||||
var AP = this.AP();
|
||||
if (!AP)
|
||||
return undefined;
|
||||
var N = AP.lookup(PDFName_1.default.of('N'), PDFDict_1.default, PDFStream_1.default);
|
||||
var R = AP.lookupMaybe(PDFName_1.default.of('R'), PDFDict_1.default, PDFStream_1.default);
|
||||
var D = AP.lookupMaybe(PDFName_1.default.of('D'), PDFDict_1.default, PDFStream_1.default);
|
||||
return { normal: N, rollover: R, down: D };
|
||||
};
|
||||
PDFAnnotation.prototype.getFlags = function () {
|
||||
var _a, _b;
|
||||
return (_b = (_a = this.F()) === null || _a === void 0 ? void 0 : _a.asNumber()) !== null && _b !== void 0 ? _b : 0;
|
||||
};
|
||||
PDFAnnotation.prototype.setFlags = function (flags) {
|
||||
this.dict.set(PDFName_1.default.of('F'), PDFNumber_1.default.of(flags));
|
||||
};
|
||||
PDFAnnotation.prototype.hasFlag = function (flag) {
|
||||
var flags = this.getFlags();
|
||||
return (flags & flag) !== 0;
|
||||
};
|
||||
PDFAnnotation.prototype.setFlag = function (flag) {
|
||||
var flags = this.getFlags();
|
||||
this.setFlags(flags | flag);
|
||||
};
|
||||
PDFAnnotation.prototype.clearFlag = function (flag) {
|
||||
var flags = this.getFlags();
|
||||
this.setFlags(flags & ~flag);
|
||||
};
|
||||
PDFAnnotation.prototype.setFlagTo = function (flag, enable) {
|
||||
if (enable)
|
||||
this.setFlag(flag);
|
||||
else
|
||||
this.clearFlag(flag);
|
||||
};
|
||||
PDFAnnotation.fromDict = function (dict) { return new PDFAnnotation(dict); };
|
||||
return PDFAnnotation;
|
||||
}());
|
||||
exports.default = PDFAnnotation;
|
||||
//# sourceMappingURL=PDFAnnotation.js.map
|
||||
1
node_modules/pdf-lib/cjs/core/annotation/PDFAnnotation.js.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/annotation/PDFAnnotation.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFAnnotation.js","sourceRoot":"","sources":["../../../src/core/annotation/PDFAnnotation.ts"],"names":[],"mappings":";;;AAAA,uEAA+C;AAC/C,uEAA+C;AAC/C,2EAAmD;AACnD,yEAAiD;AACjD,qEAA6C;AAC7C,2EAAmD;AAEnD;IAKE,uBAAsB,IAAa;QACjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,+CAA+C;IAC/C,4BAAI,GAAJ;QACE,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAO,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,kBAAQ,CAAC,CAAC;IACxD,CAAC;IAED,0BAAE,GAAF;QACE,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,iBAAO,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,iBAAO,CAAC,CAAC;IAC1D,CAAC;IAED,yBAAC,GAAD;QACE,IAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACtD,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,WAAW,EAAE,mBAAS,CAAC,CAAC;IAC/D,CAAC;IAED,oCAAY,GAAZ;;QACE,IAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QACzB,aAAO,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,qCAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAA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AG,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC9B,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,+BAAO,GAAP,UAAQ,IAAY;QAClB,IAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC9B,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,iCAAS,GAAT,UAAU,IAAY;QACpB,IAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC9B,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED,iCAAS,GAAT,UAAU,IAAY,EAAE,MAAe;QACrC,IAAI,MAAM;YAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;;YAC1B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAtIM,sBAAQ,GAAG,UAAC,IAAa,IAAoB,OAAA,IAAI,aAAa,CAAC,IAAI,CAAC,EAAvB,CAAuB,CAAC;IAuI9E,oBAAC;CAAA,AA1ID,IA0IC;AAED,kBAAe,aAAa,CAAC"}
|
||||
27
node_modules/pdf-lib/cjs/core/annotation/PDFWidgetAnnotation.d.ts
generated
vendored
Normal file
27
node_modules/pdf-lib/cjs/core/annotation/PDFWidgetAnnotation.d.ts
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
import PDFDict from "../objects/PDFDict";
|
||||
import PDFName from "../objects/PDFName";
|
||||
import PDFRef from "../objects/PDFRef";
|
||||
import PDFString from "../objects/PDFString";
|
||||
import PDFHexString from "../objects/PDFHexString";
|
||||
import PDFContext from "../PDFContext";
|
||||
import BorderStyle from "./BorderStyle";
|
||||
import PDFAnnotation from "./PDFAnnotation";
|
||||
import AppearanceCharacteristics from "./AppearanceCharacteristics";
|
||||
declare class PDFWidgetAnnotation extends PDFAnnotation {
|
||||
static fromDict: (dict: PDFDict) => PDFWidgetAnnotation;
|
||||
static create: (context: PDFContext, parent: PDFRef) => PDFWidgetAnnotation;
|
||||
MK(): PDFDict | undefined;
|
||||
BS(): PDFDict | undefined;
|
||||
DA(): PDFString | PDFHexString | undefined;
|
||||
P(): PDFRef | undefined;
|
||||
setP(page: PDFRef): void;
|
||||
setDefaultAppearance(appearance: string): void;
|
||||
getDefaultAppearance(): string | undefined;
|
||||
getAppearanceCharacteristics(): AppearanceCharacteristics | undefined;
|
||||
getOrCreateAppearanceCharacteristics(): AppearanceCharacteristics;
|
||||
getBorderStyle(): BorderStyle | undefined;
|
||||
getOrCreateBorderStyle(): BorderStyle;
|
||||
getOnValue(): PDFName | undefined;
|
||||
}
|
||||
export default PDFWidgetAnnotation;
|
||||
//# sourceMappingURL=PDFWidgetAnnotation.d.ts.map
|
||||
1
node_modules/pdf-lib/cjs/core/annotation/PDFWidgetAnnotation.d.ts.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/annotation/PDFWidgetAnnotation.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFWidgetAnnotation.d.ts","sourceRoot":"","sources":["../../../src/core/annotation/PDFWidgetAnnotation.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,2BAAiC;AAC/C,OAAO,OAAO,2BAAiC;AAC/C,OAAO,MAAM,0BAAgC;AAC7C,OAAO,SAAS,6BAAmC;AACnD,OAAO,YAAY,gCAAsC;AACzD,OAAO,UAAU,sBAA4B;AAC7C,OAAO,WAAW,sBAAwC;AAC1D,OAAO,aAAa,wBAA0C;AAC9D,OAAO,yBAAyB,oCAAsD;AAEtF,cAAM,mBAAoB,SAAQ,aAAa;IAC7C,MAAM,CAAC,QAAQ,SAAU,OAAO,KAAG,mBAAmB,CACtB;IAEhC,MAAM,CAAC,MAAM,YAAa,UAAU,UAAU,MAAM,yBAQlD;IAEF,EAAE,IAAI,OAAO,GAAG,SAAS;IAMzB,EAAE,IAAI,OAAO,GAAG,SAAS;IAMzB,EAAE,IAAI,SAAS,GAAG,YAAY,GAAG,SAAS;IAM1C,CAAC,IAAI,MAAM,GAAG,SAAS;IAMvB,IAAI,CAAC,IAAI,EAAE,MAAM;IAIjB,oBAAoB,CAAC,UAAU,EAAE,MAAM;IAIvC,oBAAoB,IAAI,MAAM,GAAG,SAAS;IAU1C,4BAA4B,IAAI,yBAAyB,GAAG,SAAS;IAMrE,oCAAoC,IAAI,yBAAyB;IASjE,cAAc,IAAI,WAAW,GAAG,SAAS;IAMzC,sBAAsB,IAAI,WAAW;IASrC,UAAU,IAAI,OAAO,GAAG,SAAS;CAalC;AAED,eAAe,mBAAmB,CAAC"}
|
||||
110
node_modules/pdf-lib/cjs/core/annotation/PDFWidgetAnnotation.js
generated
vendored
Normal file
110
node_modules/pdf-lib/cjs/core/annotation/PDFWidgetAnnotation.js
generated
vendored
Normal file
@@ -0,0 +1,110 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var PDFDict_1 = tslib_1.__importDefault(require("../objects/PDFDict"));
|
||||
var PDFName_1 = tslib_1.__importDefault(require("../objects/PDFName"));
|
||||
var PDFRef_1 = tslib_1.__importDefault(require("../objects/PDFRef"));
|
||||
var PDFString_1 = tslib_1.__importDefault(require("../objects/PDFString"));
|
||||
var PDFHexString_1 = tslib_1.__importDefault(require("../objects/PDFHexString"));
|
||||
var BorderStyle_1 = tslib_1.__importDefault(require("./BorderStyle"));
|
||||
var PDFAnnotation_1 = tslib_1.__importDefault(require("./PDFAnnotation"));
|
||||
var AppearanceCharacteristics_1 = tslib_1.__importDefault(require("./AppearanceCharacteristics"));
|
||||
var PDFWidgetAnnotation = /** @class */ (function (_super) {
|
||||
tslib_1.__extends(PDFWidgetAnnotation, _super);
|
||||
function PDFWidgetAnnotation() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
PDFWidgetAnnotation.prototype.MK = function () {
|
||||
var MK = this.dict.lookup(PDFName_1.default.of('MK'));
|
||||
if (MK instanceof PDFDict_1.default)
|
||||
return MK;
|
||||
return undefined;
|
||||
};
|
||||
PDFWidgetAnnotation.prototype.BS = function () {
|
||||
var BS = this.dict.lookup(PDFName_1.default.of('BS'));
|
||||
if (BS instanceof PDFDict_1.default)
|
||||
return BS;
|
||||
return undefined;
|
||||
};
|
||||
PDFWidgetAnnotation.prototype.DA = function () {
|
||||
var da = this.dict.lookup(PDFName_1.default.of('DA'));
|
||||
if (da instanceof PDFString_1.default || da instanceof PDFHexString_1.default)
|
||||
return da;
|
||||
return undefined;
|
||||
};
|
||||
PDFWidgetAnnotation.prototype.P = function () {
|
||||
var P = this.dict.get(PDFName_1.default.of('P'));
|
||||
if (P instanceof PDFRef_1.default)
|
||||
return P;
|
||||
return undefined;
|
||||
};
|
||||
PDFWidgetAnnotation.prototype.setP = function (page) {
|
||||
this.dict.set(PDFName_1.default.of('P'), page);
|
||||
};
|
||||
PDFWidgetAnnotation.prototype.setDefaultAppearance = function (appearance) {
|
||||
this.dict.set(PDFName_1.default.of('DA'), PDFString_1.default.of(appearance));
|
||||
};
|
||||
PDFWidgetAnnotation.prototype.getDefaultAppearance = function () {
|
||||
var DA = this.DA();
|
||||
if (DA instanceof PDFHexString_1.default) {
|
||||
return DA.decodeText();
|
||||
}
|
||||
return DA === null || DA === void 0 ? void 0 : DA.asString();
|
||||
};
|
||||
PDFWidgetAnnotation.prototype.getAppearanceCharacteristics = function () {
|
||||
var MK = this.MK();
|
||||
if (MK)
|
||||
return AppearanceCharacteristics_1.default.fromDict(MK);
|
||||
return undefined;
|
||||
};
|
||||
PDFWidgetAnnotation.prototype.getOrCreateAppearanceCharacteristics = function () {
|
||||
var MK = this.MK();
|
||||
if (MK)
|
||||
return AppearanceCharacteristics_1.default.fromDict(MK);
|
||||
var ac = AppearanceCharacteristics_1.default.fromDict(this.dict.context.obj({}));
|
||||
this.dict.set(PDFName_1.default.of('MK'), ac.dict);
|
||||
return ac;
|
||||
};
|
||||
PDFWidgetAnnotation.prototype.getBorderStyle = function () {
|
||||
var BS = this.BS();
|
||||
if (BS)
|
||||
return BorderStyle_1.default.fromDict(BS);
|
||||
return undefined;
|
||||
};
|
||||
PDFWidgetAnnotation.prototype.getOrCreateBorderStyle = function () {
|
||||
var BS = this.BS();
|
||||
if (BS)
|
||||
return BorderStyle_1.default.fromDict(BS);
|
||||
var bs = BorderStyle_1.default.fromDict(this.dict.context.obj({}));
|
||||
this.dict.set(PDFName_1.default.of('BS'), bs.dict);
|
||||
return bs;
|
||||
};
|
||||
PDFWidgetAnnotation.prototype.getOnValue = function () {
|
||||
var _a;
|
||||
var normal = (_a = this.getAppearances()) === null || _a === void 0 ? void 0 : _a.normal;
|
||||
if (normal instanceof PDFDict_1.default) {
|
||||
var keys = normal.keys();
|
||||
for (var idx = 0, len = keys.length; idx < len; idx++) {
|
||||
var key = keys[idx];
|
||||
if (key !== PDFName_1.default.of('Off'))
|
||||
return key;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
PDFWidgetAnnotation.fromDict = function (dict) {
|
||||
return new PDFWidgetAnnotation(dict);
|
||||
};
|
||||
PDFWidgetAnnotation.create = function (context, parent) {
|
||||
var dict = context.obj({
|
||||
Type: 'Annot',
|
||||
Subtype: 'Widget',
|
||||
Rect: [0, 0, 0, 0],
|
||||
Parent: parent,
|
||||
});
|
||||
return new PDFWidgetAnnotation(dict);
|
||||
};
|
||||
return PDFWidgetAnnotation;
|
||||
}(PDFAnnotation_1.default));
|
||||
exports.default = PDFWidgetAnnotation;
|
||||
//# sourceMappingURL=PDFWidgetAnnotation.js.map
|
||||
1
node_modules/pdf-lib/cjs/core/annotation/PDFWidgetAnnotation.js.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/annotation/PDFWidgetAnnotation.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFWidgetAnnotation.js","sourceRoot":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,CAAC;YAClB,MAAM,EAAE,MAAM;SACf,CAAC,CAAC;QACH,OAAO,IAAI,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC,CAAC;IAuFJ,0BAAC;CAAA,AAnGD,CAAkC,uBAAa,GAmG9C;AAED,kBAAe,mBAAmB,CAAC"}
|
||||
80
node_modules/pdf-lib/cjs/core/annotation/flags.d.ts
generated
vendored
Normal file
80
node_modules/pdf-lib/cjs/core/annotation/flags.d.ts
generated
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
/** From PDF spec table 165 */
|
||||
export declare enum AnnotationFlags {
|
||||
/**
|
||||
* If set, do not display the annotation if it does not belong to one of the
|
||||
* standard annotation types and no annotation handler is available. If clear,
|
||||
* display such an unknown annotation using an appearance stream specified by
|
||||
* its appearance dictionary, if any.
|
||||
*/
|
||||
Invisible,
|
||||
/**
|
||||
* If set, do not display or print the annotation or allow it to interact with
|
||||
* the user, regardless of its annotation type or whether an annotation
|
||||
* handler is available.
|
||||
*
|
||||
* In cases where screen space is limited, the ability to hide and show
|
||||
* annotations selectively can be used in combination with appearance streams
|
||||
* to display auxiliary pop-up information similar in function to online help
|
||||
* systems.
|
||||
*/
|
||||
Hidden,
|
||||
/**
|
||||
* If set, print the annotation when the page is printed. If clear, never
|
||||
* print the annotation, regardless of whether it is displayed on the screen.
|
||||
*
|
||||
* This can be useful for annotations representing interactive pushbuttons,
|
||||
* which would serve no meaningful purpose on the printed page.
|
||||
*/
|
||||
Print,
|
||||
/**
|
||||
* If set, do not scale the annotation’s appearance to match the magnification
|
||||
* of the page. The location of the annotation on the page (defined by the
|
||||
* upper-left corner of its annotation rectangle) shall remain fixed,
|
||||
* regardless of the page magnification.
|
||||
*/
|
||||
NoZoom,
|
||||
/**
|
||||
* If set, do not rotate the annotation’s appearance to match the rotation of
|
||||
* the page. The upper-left corner of the annotation rectangle shall remain in
|
||||
* a fixed location on the page, regardless of the page rotation.
|
||||
*/
|
||||
NoRotate,
|
||||
/**
|
||||
* If set, do not display the annotation on the screen or allow it to interact
|
||||
* with the user. The annotation may be printed (depending on the setting of
|
||||
* the Print flag) but should be considered hidden for purposes of on-screen
|
||||
* display and user interaction.
|
||||
*/
|
||||
NoView,
|
||||
/**
|
||||
* If set, do not allow the annotation to interact with the user. The
|
||||
* annotation may be displayed or printed (depending on the settings of the
|
||||
* NoView and Print flags) but should not respond to mouse clicks or change
|
||||
* its appearance in response to mouse motions.
|
||||
*
|
||||
* This flag shall be ignored for widget annotations; its function is
|
||||
* subsumed by the ReadOnly flag of the associated form field.
|
||||
*/
|
||||
ReadOnly,
|
||||
/**
|
||||
* If set, do not allow the annotation to be deleted or its properties
|
||||
* (including position and size) to be modified by the user. However, this
|
||||
* flag does not restrict changes to the annotation’s contents, such as the
|
||||
* value of a form field.
|
||||
*/
|
||||
Locked,
|
||||
/**
|
||||
* If set, invert the interpretation of the NoView flag for certain events.
|
||||
*
|
||||
* A typical use is to have an annotation that appears only when a mouse
|
||||
* cursor is held over it.
|
||||
*/
|
||||
ToggleNoView,
|
||||
/**
|
||||
* If set, do not allow the contents of the annotation to be modified by the
|
||||
* user. This flag does not restrict deletion of the annotation or changes to
|
||||
* other annotation properties, such as position and size.
|
||||
*/
|
||||
LockedContents
|
||||
}
|
||||
//# sourceMappingURL=flags.d.ts.map
|
||||
1
node_modules/pdf-lib/cjs/core/annotation/flags.d.ts.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/annotation/flags.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"flags.d.ts","sourceRoot":"","sources":["../../../src/core/annotation/flags.ts"],"names":[],"mappings":"AAEA,8BAA8B;AAC9B,oBAAY,eAAe;IACzB;;;;;OAKG;IACH,SAAuB;IAEvB;;;;;;;;;OASG;IACH,MAAoB;IAEpB;;;;;;OAMG;IACH,KAAmB;IAEnB;;;;;OAKG;IACH,MAAoB;IAEpB;;;;OAIG;IACH,QAAsB;IAEtB;;;;;OAKG;IACH,MAAoB;IAEpB;;;;;;;;OAQG;IACH,QAAsB;IAEtB;;;;;OAKG;IACH,MAAoB;IAEpB;;;;;OAKG;IACH,YAA0B;IAE1B;;;;OAIG;IACH,cAA6B;CAC9B"}
|
||||
85
node_modules/pdf-lib/cjs/core/annotation/flags.js
generated
vendored
Normal file
85
node_modules/pdf-lib/cjs/core/annotation/flags.js
generated
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AnnotationFlags = void 0;
|
||||
var flag = function (bitIndex) { return 1 << bitIndex; };
|
||||
/** From PDF spec table 165 */
|
||||
var AnnotationFlags;
|
||||
(function (AnnotationFlags) {
|
||||
/**
|
||||
* If set, do not display the annotation if it does not belong to one of the
|
||||
* standard annotation types and no annotation handler is available. If clear,
|
||||
* display such an unknown annotation using an appearance stream specified by
|
||||
* its appearance dictionary, if any.
|
||||
*/
|
||||
AnnotationFlags[AnnotationFlags["Invisible"] = flag(1 - 1)] = "Invisible";
|
||||
/**
|
||||
* If set, do not display or print the annotation or allow it to interact with
|
||||
* the user, regardless of its annotation type or whether an annotation
|
||||
* handler is available.
|
||||
*
|
||||
* In cases where screen space is limited, the ability to hide and show
|
||||
* annotations selectively can be used in combination with appearance streams
|
||||
* to display auxiliary pop-up information similar in function to online help
|
||||
* systems.
|
||||
*/
|
||||
AnnotationFlags[AnnotationFlags["Hidden"] = flag(2 - 1)] = "Hidden";
|
||||
/**
|
||||
* If set, print the annotation when the page is printed. If clear, never
|
||||
* print the annotation, regardless of whether it is displayed on the screen.
|
||||
*
|
||||
* This can be useful for annotations representing interactive pushbuttons,
|
||||
* which would serve no meaningful purpose on the printed page.
|
||||
*/
|
||||
AnnotationFlags[AnnotationFlags["Print"] = flag(3 - 1)] = "Print";
|
||||
/**
|
||||
* If set, do not scale the annotation’s appearance to match the magnification
|
||||
* of the page. The location of the annotation on the page (defined by the
|
||||
* upper-left corner of its annotation rectangle) shall remain fixed,
|
||||
* regardless of the page magnification.
|
||||
*/
|
||||
AnnotationFlags[AnnotationFlags["NoZoom"] = flag(4 - 1)] = "NoZoom";
|
||||
/**
|
||||
* If set, do not rotate the annotation’s appearance to match the rotation of
|
||||
* the page. The upper-left corner of the annotation rectangle shall remain in
|
||||
* a fixed location on the page, regardless of the page rotation.
|
||||
*/
|
||||
AnnotationFlags[AnnotationFlags["NoRotate"] = flag(5 - 1)] = "NoRotate";
|
||||
/**
|
||||
* If set, do not display the annotation on the screen or allow it to interact
|
||||
* with the user. The annotation may be printed (depending on the setting of
|
||||
* the Print flag) but should be considered hidden for purposes of on-screen
|
||||
* display and user interaction.
|
||||
*/
|
||||
AnnotationFlags[AnnotationFlags["NoView"] = flag(6 - 1)] = "NoView";
|
||||
/**
|
||||
* If set, do not allow the annotation to interact with the user. The
|
||||
* annotation may be displayed or printed (depending on the settings of the
|
||||
* NoView and Print flags) but should not respond to mouse clicks or change
|
||||
* its appearance in response to mouse motions.
|
||||
*
|
||||
* This flag shall be ignored for widget annotations; its function is
|
||||
* subsumed by the ReadOnly flag of the associated form field.
|
||||
*/
|
||||
AnnotationFlags[AnnotationFlags["ReadOnly"] = flag(7 - 1)] = "ReadOnly";
|
||||
/**
|
||||
* If set, do not allow the annotation to be deleted or its properties
|
||||
* (including position and size) to be modified by the user. However, this
|
||||
* flag does not restrict changes to the annotation’s contents, such as the
|
||||
* value of a form field.
|
||||
*/
|
||||
AnnotationFlags[AnnotationFlags["Locked"] = flag(8 - 1)] = "Locked";
|
||||
/**
|
||||
* If set, invert the interpretation of the NoView flag for certain events.
|
||||
*
|
||||
* A typical use is to have an annotation that appears only when a mouse
|
||||
* cursor is held over it.
|
||||
*/
|
||||
AnnotationFlags[AnnotationFlags["ToggleNoView"] = flag(9 - 1)] = "ToggleNoView";
|
||||
/**
|
||||
* If set, do not allow the contents of the annotation to be modified by the
|
||||
* user. This flag does not restrict deletion of the annotation or changes to
|
||||
* other annotation properties, such as position and size.
|
||||
*/
|
||||
AnnotationFlags[AnnotationFlags["LockedContents"] = flag(10 - 1)] = "LockedContents";
|
||||
})(AnnotationFlags = exports.AnnotationFlags || (exports.AnnotationFlags = {}));
|
||||
//# sourceMappingURL=flags.js.map
|
||||
1
node_modules/pdf-lib/cjs/core/annotation/flags.js.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/annotation/flags.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../../../src/core/annotation/flags.ts"],"names":[],"mappings":";;;AAAA,IAAM,IAAI,GAAG,UAAC,QAAgB,IAAK,OAAA,CAAC,IAAI,QAAQ,EAAb,CAAa,CAAC;AAEjD,8BAA8B;AAC9B,IAAY,eAsFX;AAtFD,WAAY,eAAe;IACzB;;;;;OAKG;IACH,+CAAY,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,eAAA,CAAA;IAEvB;;;;;;;;;OASG;IACH,4CAAS,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,YAAA,CAAA;IAEpB;;;;;;OAMG;IACH,2CAAQ,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,WAAA,CAAA;IAEnB;;;;;OAKG;IACH,4CAAS,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,YAAA,CAAA;IAEpB;;;;OAIG;IACH,8CAAW,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,cAAA,CAAA;IAEtB;;;;;OAKG;IACH,4CAAS,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,YAAA,CAAA;IAEpB;;;;;;;;OAQG;IACH,8CAAW,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,cAAA,CAAA;IAEtB;;;;;OAKG;IACH,4CAAS,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,YAAA,CAAA;IAEpB;;;;;OAKG;IACH,kDAAe,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,kBAAA,CAAA;IAE1B;;;;OAIG;IACH,oDAAiB,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,oBAAA,CAAA;AAC/B,CAAC,EAtFW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAsF1B"}
|
||||
5
node_modules/pdf-lib/cjs/core/annotation/index.d.ts
generated
vendored
Normal file
5
node_modules/pdf-lib/cjs/core/annotation/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export { default as PDFAnnotation } from "./PDFAnnotation";
|
||||
export { default as PDFWidgetAnnotation } from "./PDFWidgetAnnotation";
|
||||
export { default as AppearanceCharacteristics } from "./AppearanceCharacteristics";
|
||||
export * from "./flags";
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/pdf-lib/cjs/core/annotation/index.d.ts.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/annotation/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/annotation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAI2C,iBAAiB,CAJlB;AAC7E,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAGsD,uBAAuB,CAH7B;AACzF,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAEuE,6BAA6B,CAF9C;AACrG,cACmJ,SAAS,CADlH"}
|
||||
11
node_modules/pdf-lib/cjs/core/annotation/index.js
generated
vendored
Normal file
11
node_modules/pdf-lib/cjs/core/annotation/index.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var PDFAnnotation_1 = require("./PDFAnnotation");
|
||||
Object.defineProperty(exports, "PDFAnnotation", { enumerable: true, get: function () { return PDFAnnotation_1.default; } });
|
||||
var PDFWidgetAnnotation_1 = require("./PDFWidgetAnnotation");
|
||||
Object.defineProperty(exports, "PDFWidgetAnnotation", { enumerable: true, get: function () { return PDFWidgetAnnotation_1.default; } });
|
||||
var AppearanceCharacteristics_1 = require("./AppearanceCharacteristics");
|
||||
Object.defineProperty(exports, "AppearanceCharacteristics", { enumerable: true, get: function () { return AppearanceCharacteristics_1.default; } });
|
||||
tslib_1.__exportStar(require("./flags"), exports);
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/pdf-lib/cjs/core/annotation/index.js.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/annotation/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/annotation/index.ts"],"names":[],"mappings":";;;AAAA,iDAA6E;AAApE,8GAAA,OAAO,OAAiB;AACjC,6DAAyF;AAAhF,0HAAA,OAAO,OAAuB;AACvC,yEAAqG;AAA5F,sIAAA,OAAO,OAA6B;AAC7C,kDAA0C"}
|
||||
28
node_modules/pdf-lib/cjs/core/document/PDFCrossRefSection.d.ts
generated
vendored
Normal file
28
node_modules/pdf-lib/cjs/core/document/PDFCrossRefSection.d.ts
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
import PDFRef from "../objects/PDFRef";
|
||||
export interface Entry {
|
||||
ref: PDFRef;
|
||||
offset: number;
|
||||
deleted: boolean;
|
||||
}
|
||||
/**
|
||||
* Entries should be added using the [[addEntry]] and [[addDeletedEntry]]
|
||||
* methods **in order of ascending object number**.
|
||||
*/
|
||||
declare class PDFCrossRefSection {
|
||||
static create: () => PDFCrossRefSection;
|
||||
static createEmpty: () => PDFCrossRefSection;
|
||||
private subsections;
|
||||
private chunkIdx;
|
||||
private chunkLength;
|
||||
private constructor();
|
||||
addEntry(ref: PDFRef, offset: number): void;
|
||||
addDeletedEntry(ref: PDFRef, nextFreeObjectNumber: number): void;
|
||||
toString(): string;
|
||||
sizeInBytes(): number;
|
||||
copyBytesInto(buffer: Uint8Array, offset: number): number;
|
||||
private copySubsectionsIntoBuffer;
|
||||
private copyEntriesIntoBuffer;
|
||||
private append;
|
||||
}
|
||||
export default PDFCrossRefSection;
|
||||
//# sourceMappingURL=PDFCrossRefSection.d.ts.map
|
||||
1
node_modules/pdf-lib/cjs/core/document/PDFCrossRefSection.d.ts.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/document/PDFCrossRefSection.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PDFCrossRefSection.d.ts","sourceRoot":"","sources":["../../../src/core/document/PDFCrossRefSection.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,0BAAgC;AAI7C,MAAM,WAAW,KAAK;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;GAGG;AACH,cAAM,kBAAkB;IACtB,MAAM,CAAC,MAAM,2BAKR;IAEL,MAAM,CAAC,WAAW,2BAAkC;IAEpD,OAAO,CAAC,WAAW,CAAY;IAC/B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,WAAW,CAAS;IAE5B,OAAO;IAMP,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAI3C,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,GAAG,IAAI;IAIhE,QAAQ,IAAI,MAAM;IA4BlB,WAAW,IAAI,MAAM;IAcrB,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IAczD,OAAO,CAAC,yBAAyB;IAyBjC,OAAO,CAAC,qBAAqB;IA2B7B,OAAO,CAAC,MAAM;CAoBf;AAED,eAAe,kBAAkB,CAAC"}
|
||||
124
node_modules/pdf-lib/cjs/core/document/PDFCrossRefSection.js
generated
vendored
Normal file
124
node_modules/pdf-lib/cjs/core/document/PDFCrossRefSection.js
generated
vendored
Normal file
@@ -0,0 +1,124 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var PDFRef_1 = tslib_1.__importDefault(require("../objects/PDFRef"));
|
||||
var CharCodes_1 = tslib_1.__importDefault(require("../syntax/CharCodes"));
|
||||
var utils_1 = require("../../utils");
|
||||
/**
|
||||
* Entries should be added using the [[addEntry]] and [[addDeletedEntry]]
|
||||
* methods **in order of ascending object number**.
|
||||
*/
|
||||
var PDFCrossRefSection = /** @class */ (function () {
|
||||
function PDFCrossRefSection(firstEntry) {
|
||||
this.subsections = firstEntry ? [[firstEntry]] : [];
|
||||
this.chunkIdx = 0;
|
||||
this.chunkLength = firstEntry ? 1 : 0;
|
||||
}
|
||||
PDFCrossRefSection.prototype.addEntry = function (ref, offset) {
|
||||
this.append({ ref: ref, offset: offset, deleted: false });
|
||||
};
|
||||
PDFCrossRefSection.prototype.addDeletedEntry = function (ref, nextFreeObjectNumber) {
|
||||
this.append({ ref: ref, offset: nextFreeObjectNumber, deleted: true });
|
||||
};
|
||||
PDFCrossRefSection.prototype.toString = function () {
|
||||
var section = "xref\n";
|
||||
for (var rangeIdx = 0, rangeLen = this.subsections.length; rangeIdx < rangeLen; rangeIdx++) {
|
||||
var range = this.subsections[rangeIdx];
|
||||
section += range[0].ref.objectNumber + " " + range.length + "\n";
|
||||
for (var entryIdx = 0, entryLen = range.length; entryIdx < entryLen; entryIdx++) {
|
||||
var entry = range[entryIdx];
|
||||
section += utils_1.padStart(String(entry.offset), 10, '0');
|
||||
section += ' ';
|
||||
section += utils_1.padStart(String(entry.ref.generationNumber), 5, '0');
|
||||
section += ' ';
|
||||
section += entry.deleted ? 'f' : 'n';
|
||||
section += ' \n';
|
||||
}
|
||||
}
|
||||
return section;
|
||||
};
|
||||
PDFCrossRefSection.prototype.sizeInBytes = function () {
|
||||
var size = 5;
|
||||
for (var idx = 0, len = this.subsections.length; idx < len; idx++) {
|
||||
var subsection = this.subsections[idx];
|
||||
var subsectionLength = subsection.length;
|
||||
var firstEntry = subsection[0];
|
||||
size += 2;
|
||||
size += String(firstEntry.ref.objectNumber).length;
|
||||
size += String(subsectionLength).length;
|
||||
size += 20 * subsectionLength;
|
||||
}
|
||||
return size;
|
||||
};
|
||||
PDFCrossRefSection.prototype.copyBytesInto = function (buffer, offset) {
|
||||
var initialOffset = offset;
|
||||
buffer[offset++] = CharCodes_1.default.x;
|
||||
buffer[offset++] = CharCodes_1.default.r;
|
||||
buffer[offset++] = CharCodes_1.default.e;
|
||||
buffer[offset++] = CharCodes_1.default.f;
|
||||
buffer[offset++] = CharCodes_1.default.Newline;
|
||||
offset += this.copySubsectionsIntoBuffer(this.subsections, buffer, offset);
|
||||
return offset - initialOffset;
|
||||
};
|
||||
PDFCrossRefSection.prototype.copySubsectionsIntoBuffer = function (subsections, buffer, offset) {
|
||||
var initialOffset = offset;
|
||||
var length = subsections.length;
|
||||
for (var idx = 0; idx < length; idx++) {
|
||||
var subsection = this.subsections[idx];
|
||||
var firstObjectNumber = String(subsection[0].ref.objectNumber);
|
||||
offset += utils_1.copyStringIntoBuffer(firstObjectNumber, buffer, offset);
|
||||
buffer[offset++] = CharCodes_1.default.Space;
|
||||
var rangeLength = String(subsection.length);
|
||||
offset += utils_1.copyStringIntoBuffer(rangeLength, buffer, offset);
|
||||
buffer[offset++] = CharCodes_1.default.Newline;
|
||||
offset += this.copyEntriesIntoBuffer(subsection, buffer, offset);
|
||||
}
|
||||
return offset - initialOffset;
|
||||
};
|
||||
PDFCrossRefSection.prototype.copyEntriesIntoBuffer = function (entries, buffer, offset) {
|
||||
var length = entries.length;
|
||||
for (var idx = 0; idx < length; idx++) {
|
||||
var entry = entries[idx];
|
||||
var entryOffset = utils_1.padStart(String(entry.offset), 10, '0');
|
||||
offset += utils_1.copyStringIntoBuffer(entryOffset, buffer, offset);
|
||||
buffer[offset++] = CharCodes_1.default.Space;
|
||||
var entryGen = utils_1.padStart(String(entry.ref.generationNumber), 5, '0');
|
||||
offset += utils_1.copyStringIntoBuffer(entryGen, buffer, offset);
|
||||
buffer[offset++] = CharCodes_1.default.Space;
|
||||
buffer[offset++] = entry.deleted ? CharCodes_1.default.f : CharCodes_1.default.n;
|
||||
buffer[offset++] = CharCodes_1.default.Space;
|
||||
buffer[offset++] = CharCodes_1.default.Newline;
|
||||
}
|
||||
return 20 * length;
|
||||
};
|
||||
PDFCrossRefSection.prototype.append = function (currEntry) {
|
||||
if (this.chunkLength === 0) {
|
||||
this.subsections.push([currEntry]);
|
||||
this.chunkIdx = 0;
|
||||
this.chunkLength = 1;
|
||||
return;
|
||||
}
|
||||
var chunk = this.subsections[this.chunkIdx];
|
||||
var prevEntry = chunk[this.chunkLength - 1];
|
||||
if (currEntry.ref.objectNumber - prevEntry.ref.objectNumber > 1) {
|
||||
this.subsections.push([currEntry]);
|
||||
this.chunkIdx += 1;
|
||||
this.chunkLength = 1;
|
||||
}
|
||||
else {
|
||||
chunk.push(currEntry);
|
||||
this.chunkLength += 1;
|
||||
}
|
||||
};
|
||||
PDFCrossRefSection.create = function () {
|
||||
return new PDFCrossRefSection({
|
||||
ref: PDFRef_1.default.of(0, 65535),
|
||||
offset: 0,
|
||||
deleted: true,
|
||||
});
|
||||
};
|
||||
PDFCrossRefSection.createEmpty = function () { return new PDFCrossRefSection(); };
|
||||
return PDFCrossRefSection;
|
||||
}());
|
||||
exports.default = PDFCrossRefSection;
|
||||
//# sourceMappingURL=PDFCrossRefSection.js.map
|
||||
1
node_modules/pdf-lib/cjs/core/document/PDFCrossRefSection.js.map
generated
vendored
Normal file
1
node_modules/pdf-lib/cjs/core/document/PDFCrossRefSection.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user