Forum


Replies: 1   Views: 1897
Watermark in pdf not covering hole page
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 dadinos2  · 27-03-2020 - 20:39

I have a A4 PDF and I want to cover the hole background with a image ( like a company letterpaper)

I have this code:

require_once '../App/phpdoc/classes/PdfUtilities.php';
$docx = new PdfUtilities();
 $docx->watermarkPdf($source, $target, 'image', array('image' => 'images/briefpapier.png', 'remove_previous_watermarks' => true, 'opacity'=> 1,  'decolorate'=> false, 'positionX' => 0, 'positionY' => 0));

But i does not cover the hole page. I can shift the position a little bit with positionX an positionY.

No scaling possible. I tried different image resolutions but no go.

I have the latest 9.5 version installed.

The name 'watermark' suggest its loaded in the back of the current PDF content but it's placed above it. So I use a tranparent PNG to reach the goal of a backgound watermark. But it always is covering about 80% of the page and not the hole 100%.

Is there a solution to cover the hole page?

Thanks in advance!

Aren