🚚 ➕ add node-signpdf copy to signing packgage until npm includes fix
This commit is contained in:
24
packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/getPagesDictionaryRef.js
vendored
Normal file
24
packages/signing/node-signpdf/dist/helpers/plainAddPlaceholder/getPagesDictionaryRef.js
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
"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];
|
||||
}
|
||||
Reference in New Issue
Block a user