initial commit

This commit is contained in:
nxglabs
2023-10-22 01:37:25 +05:30
parent 80327652c3
commit 97fd28697a
182 changed files with 55033 additions and 122 deletions
@@ -0,0 +1,18 @@
import SignPdfError from './SignPdfError.js';
/**
* @param {Object} info As extracted from readRef()
*/
export default 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(
'Failed to find the pages descriptor. This is probably a problem in node-signpdf.',
SignPdfError.TYPE_PARSE,
);
}
return match[1];
}