addBackgroundImage

addBackgroundImage

ADVANCED / PREMIUM BASIC

Inserts a watermark into a PDF document.

Description
public addBackgroundImage (string $source, string $img, [array $options])

Inserts a background image into a PDF document.

Parameters

source

Path to the PDF document.

target

Path to the output PDF.

image

Image path.

options

The possible keys and values are:

key Type Description
annotations bool Import annotations (links, comments and others). False as default.
height mixed Height value (0 as default, set the size automatically). Set 'auto' to use the height from the PDF.
width mixed Width value (0 as default, set the size automatically). Set 'auto' to use the width from the PDF.
opacity float Decimal number between 0 and 1 (optional), if not set defaults to 0.5.
Code samples

Example #1