dealfonso / sapp

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

Clue for signature appearance #6

Closed herzhy closed 3 years ago

herzhy commented 3 years ago

Hello again mr alfonso, Now i'm trying to sign pdf doc with signature with image (pdfsigni.php). In this case I want to put image signatures based on my needs, mostly in bottom of page, it could be left, middle or right bottom. would you give some clues or something to put the image dinamically? what parameters range values for that i can throw into set_signature_appearance function?

Thanks before

dealfonso commented 3 years ago

Hi,

I use to get the size of the page, get the size of the image to use as the signature, and then calculate the position. The example code pdfsigni.php does exactly this procedure. In the example, it tries to put the image in the center of the page with a size of 1/3 (i.e. 1/3 empty, 1/3 for the image, 1/3 empty, both horizontal and vertical)... you can follow the same steps to place it wherever you need, using the size you need

herzhy commented 3 years ago

thank you for your explanation