1<?php
2
3//Specify path to image. The image must have a 96 DPI resolution.
4$watermark = new PDFWatermark('C:\myimage.png');
5
6//Set the position
7$watermark->setPosition('bottomleft');
8
9//Place watermark behind original PDF content. Default behavior places it over the content.
10$watermark->setAsBackground();
11
12//Specify the path to the existing pdf, the path to the new pdf file, and the watermark object
13$watermarker = new PDFWatermarker('C:\test.pdf','C:\output.pdf',$watermark);
14
15//Set page range. Use 1-based index.
16$watermarker->setPageRange(1,5);
17
18//Save the new PDF to its specified location
19$watermarker->savePdf();
20?>