Forum


Replies: 1   Views: 496
Adding image when signing pdf
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by admin  · 10-05-2023 - 17:59

Hello,

PDF files don't use px but pt/mm units. Please use a lower value, px units are not transformed.

Regarding your question, if you are adding a signature in the same position than the image, then the signature link information has greater importance than the image link.
You can test it adding the signature and the image using distinct positions:

$optionsSignature = array(
    'x' => 100,
    'y' => 200,
    'w' => 50,
    'h' => 50,
    'page' => 1,
);

$optionsImage = array(
    'src' => 'image.png',
    'link' => 'https://www.phpdocx.com',
    'x' => 0,
    'y' => 200,
    'w' => 50,
    'h' => 50,
);

$sign->sign('output.pdf', $optionsSignature, $optionsImage);

We also recommend you use Adobe Reader, Foxit Reader or another PDF reader that includes support for signatures. The internal PDF reader of Google Chrome has many limitations.

We have tested a transparent PNG and it's added correctly. Maybe the image uses a transparency format not supported by PHP?

Regards.