Watermark or stamp PDF documents

1.1.2 2016-06-04 09:54 UTC

This package is auto-updated.

Last update: 2022-11-26 02:01:27 UTC


Build Status

PDF Watermarker

PDFWatermarker enables you to add an image as a watermark to existing PDF files. It uses FPDF that allows you to write PDF files and FPDI that allows you to import existing PDF documents into FPDF.

Using it, you can:

  • Use jpg and png ( with alpha channels ) files with a 96 DPI resolution
  • Easily position the watermark on the pages of the PDF file


  1. Place composer.phar in the folder you extracted the files to.

  2. Run php composer.phar install

  3. Include the files in your project.




//Specify path to image. The image must have a 96 DPI resolution.
$watermark = new PDFWatermark('C:\myimage.png'); 

//Set the position

//Place watermark behind original PDF content. Default behavior places it over the content.

//Specify the path to the existing pdf, the path to the new pdf file, and the watermark object
$watermarker = new PDFWatermarker('C:\test.pdf','C:\output.pdf',$watermark); 

//Set page range. Use 1-based index.
//Save the new PDF to its specified location

Five positions can be used. 'center' is the default.

  • center
  • topleft
  • topright
  • bottomright
  • bottomleft

See the API Documentation for more details.


Report bugs at