mirror of
https://github.com/documenso/documenso.git
synced 2025-11-16 01:32:06 +10:00
24 lines
700 B
JavaScript
24 lines
700 B
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getPagesDictionaryRef;
|
|
|
|
var _SignPdfError = _interopRequireDefault(require("../../SignPdfError"));
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
/**
|
|
* @param {Object} info As extracted from readRef()
|
|
*/
|
|
function getPagesDictionaryRef(info) {
|
|
const pagesRefRegex = /\/Pages\s+(\d+\s+\d+\s+R)/g;
|
|
const match = pagesRefRegex.exec(info.root);
|
|
|
|
if (match === null) {
|
|
throw new _SignPdfError.default('Failed to find the pages descriptor. This is probably a problem in node-signpdf.', _SignPdfError.default.TYPE_PARSE);
|
|
}
|
|
|
|
return match[1];
|
|
} |