PDF Stamp
Table of Contents
Introduction
The PDF stamp class allows you to use a page of an existing PDF document as a stamp appearance.
It's only the pages content stream that will be transformed into a reusable structure. By doing this, content types like links, form fields or other kind of page annotations will loose their relation and will not be available in the final stamp appearance.
Create an Instance
An instance could be created by passing a filename or a document instance, a page number and a boundary box to its constructor:
$stamp = new \SetaPDF_Stamper_Stamp_Pdf( 'path/to/stamp.pdf', 1, \SetaPDF_Core_PageBoundaries::CROP_BOX ); // or $document = \SetaPDF_Core_Document::loadByFilename('path/to/stamp.pdf'); $stamp = new \SetaPDF_Stamper_Stamp_Pdf( $document, 1, \SetaPDF_Core_PageBoundaries::CROP_BOX );
Configure Properties
Beside the general stamp properties the PDF stamp class offers following stamp properties:
Source Document Specific
Following methods are available to control which page and boundary box should be used from the initial document instance:
getBoundaryBox()
Get the current boundary box name.
getPageNumber()
Get the page number of the page that should be used for the stamp appearance.
setBoundaryBox()
Set the boundary box of the imported page.
setPageNumber()
Set the page number for the page which should be used for the stamp appearance.
Dimensions
getHeight()
Get the height of the pdf page stamp.
getWidth()
Get the width of the pdf page stamp.
setHeight()
Set the individual height if the pdf page stamp.
setWidth()
Set the individual width of the pdf page stamp.
Example
The example simply uses the first page of this document as the stamp appearance: