mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-08-22 15:42:31 +02:00
initial commit
This commit is contained in:
@@ -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];
|
||||
}
|
||||
Reference in New Issue
Block a user