Adds image watermarks to PDF files
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
pdfwatermarker Changed version to reconcile with… Jun 4, 2016
tests Various fixes May 23, 2016
.gitignore Merge branch 'master' of git:// into … Jun 4, 2016
.travis.yml bootstrap.php for phpunit was created May 21, 2016 Various fixes May 23, 2016 -Updated Travis configuration Apr 18, 2015
composer.json Merge branch 'master' of git:// into … Jun 4, 2016
createphpdocs.bat -Added ability to specify a page range for watermarking Feb 28, 2015
createphpdocsmarkdown.bat -Added ability to specify a page range for watermarking Feb 28, 2015

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