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 admin  · 28-03-2020 - 11:11

Hello,

UPDATE: phpdocx 11 added the addBackgroundImage method to PDFUtilities.

The current version of phpdocx doesn't include an option to cover the whole page with a watermark when working with PDF. For example, working with DOCX documents, you can't cover the whole page with an image using watermarkDOCX, you need to use addBackgroundImage
We move the request to the dev team to add support; some margins should be removed/changed to get a whole image background and the image should be added to the header instead of the main content (https://tcpdf.org/examples/example_051/). As it's a task that can't be accomplished using the current version of phpdocx, if you open a support ticket (https://www.phpdocx.com/support) and attach the PDF and the image you are using, the dev team will check them and generate a custom class to accomplish that task.

About the opacity question, your script is using:

'opacity'=> 1

You don't need to use a transparent PNG, the default opacity value is 0.5, but setting it to 1 you remove the applied transparency, you should use a lower value:

'opacity'=> 0.3 //  0.5 is the default one if no value is set

Regards.