@signpdf/placeholder-plain
Version:
Try to add a signature placeholder to a PDF using plain string modifications.
21 lines (20 loc) • 544 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _utils = require("@signpdf/utils");
/**
* @param {object} refTable
* @param {string} ref
* @returns {number}
*/
const getIndexFromRef = (refTable, ref) => {
let [index] = ref.split(' ');
index = parseInt(index);
if (!refTable.offsets.has(index)) {
throw new _utils.SignPdfError(`Failed to locate object "${ref}".`, _utils.SignPdfError.TYPE_PARSE);
}
return index;
};
var _default = exports.default = getIndexFromRef;