dealfonso / sapp

Simple and Agnostic PDF Document Parser in PHP - sign PDF docs using PHP
GNU Lesser General Public License v3.0
110 stars 29 forks source link

Get signatures count method #29

Closed erikn69 closed 1 year ago

erikn69 commented 1 year ago

I'm trying to add multiple signature images incrementally, there is a way to count previous signatures (for avoid overlapping images recalculating position on base of signature count) Like https://github.com/dealfonso/sapp/blob/01acefd42ce5dfb4d572b76db2b1871270991abe/src/PDFDoc.php#L89-L91

For example

public function get_signature_count() { 
     return count($this->_signatures); 
} 
dealfonso commented 1 year ago

Currently, there is no way to calculate the number of signatures.

Assuming that a signature makes a new document version, there would be a mechanism that would consist of counting the number of xref tables (i.e. the depth of the document). The current version of sapp takes into account such depth in functions get_xref_* but does not store the depth of the document. Maybe you can try to store it and see if that meets your requirements. If so, please create a pull request.