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

Added `get_signature_count` method #31

Closed erikn69 closed 1 year ago

erikn69 commented 1 year ago

Closes #29

The current version of sapp takes into account such depth in functions getxref* 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.

@dealfonso i don't know if I understood the idea correctly but it seems to be working, I tried signing one, two and three times and it always returns the correct number of signatures

dealfonso commented 1 year ago

Your method counts the number of signature fields in the document... I suppose that it is fine, but let me think about it.

erikn69 commented 1 year ago

@dealfonso new idea, how about get subject and issuer data as info, example

/* 
  @returns array [
    0 => [ 'issuer' => $array_issuer1, 'subject' => $array_subject1],
    1 => [ 'issuer' => $array_issuer2, 'subject' => $array_subject2],
    ...
  ]
*/
public function get_signatures {
    return $this->_signatures; 
}
dealfonso commented 1 year ago

I like this solution. Nice work!