-
Notifications
You must be signed in to change notification settings - Fork 62
PDFWatermarker
BinaryStash edited this page May 24, 2016
·
8 revisions
pdfwatermarker.php
This class applies PDFWatermark to the file
- Class name: PDFWatermarker
- Namespace:
private mixed $_originalPdf
- Visibility: private
private mixed $_newPdf
- Visibility: private
private mixed $_tempPdf
- Visibility: private
private mixed $_watermark
- Visibility: private
private mixed $_specificPages
- Visibility: private
void PDFWatermarker::\PDFWatermarker::__construct()($originalPdf, $newPdf, mixed $watermark)
Creates an instance of the watermarker
- Visibility: public
- $originalPdf mixed
- $newPdf mixed
- $watermark mixed - Watermark - watermark object
void PDFWatermarker::\PDFWatermarker::_validateAssets()()
Ensures that the watermark and the PDF file are valid
- Visibility: private
void PDFWatermarker::\PDFWatermarker::_updatePDF()()
Loop through the pages while applying the watermark
- Visibility: private
mixed PDFWatermarker::\PDFWatermarker::_getTotalPages()()
- Visibility: private
void PDFWatermarker::\PDFWatermarker::_importPage()(integer $page_number)
Import page
- Visibility: private
- $page_number integer - page number
void PDFWatermarker::\PDFWatermarker::_watermarkPage()(integer $page_number, boolean $watermark_visible)
Apply the watermark to a specific page
- Visibility: private
- $page_number integer - page number
- $watermark_visible boolean - (optional) Make the watermark visible. True by default.
array PDFWatermarker::\PDFWatermarker::_calculateWatermarkCoordinates()(integer $wWidth, integer $wHeight, integer $tWidth, $tHeight)
Calculate the coordinates of the watermark's position
- Visibility: private
- $wWidth integer - watermark's width
- $wHeight integer - watermark's height
- $tWidth integer - page width
- $tHeight integer - page height
void PDFWatermarker::\PDFWatermarker::setPageRange()(integer $startPage, integer $endPage)
Set page range
- Visibility: public
- $startPage integer - the first page to be watermarked
- $endPage integer - (optional) the last page to be watermarked
void PDFWatermarker::\PDFWatermarker::savePdf()()
Save the PDF to the specified location
- Visibility: public