OrderOfTheBee / alfresco-pdf-toolkit

67 stars 58 forks source link

Add page number checks including ability to specify negative number #18

Closed jpotts closed 8 years ago

jpotts commented 8 years ago

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.