If the page number is incorrectly parsed it is set to 0 which means the digital signature overlay will not get added. Further, it is possible to specify a page number greater than the number of pages in the PDF.
This commit adds checks to guard against those conditions. It also makes it possible to specify a negative number for the page number which means the signature will be applied to the page counting backward instead of forward. This allows you to specify -1 as the page number, for example, and the signature will always be applied to the last page in the PDF.
If the page number is incorrectly parsed it is set to 0 which means the digital signature overlay will not get added. Further, it is possible to specify a page number greater than the number of pages in the PDF.
This commit adds checks to guard against those conditions. It also makes it possible to specify a negative number for the page number which means the signature will be applied to the page counting backward instead of forward. This allows you to specify -1 as the page number, for example, and the signature will always be applied to the last page in the PDF.