### Run SetaPDF Demos with PHP Webserver Source: https://github.com/setasign/setapdf-demos/blob/master/README.md Navigate to the public directory and start the PHP built-in webserver. Access the demos via http://localhost:8080. ```bash cd public php -S localhost:8080 ``` -------------------------------- ### Read PFX/P12 File with openssl_pkcs12_read Source: https://github.com/setasign/setapdf-demos/blob/master/public/demos/5-Signer/1-standard-signatures/3-use-a-pfx-or-p12-file/description.html Use this function to read a PFX/P12 file and extract the certificate and private key. Requires the file path, a password, and output variables for the certificate and private key. ```php ``` -------------------------------- ### Add Stamp to All Pages Source: https://github.com/setasign/setapdf-demos/blob/master/public/demos/6-Stamper/2-adding-stamps/3-show-on-page/description.html To apply a stamp to every page in the document, set $showOnPage to 'all'. ```php $pdf->addStamp("path/to/stamp.pdf", ["showOnPage" => "all"]); ``` -------------------------------- ### Add Stamp to Page Range Source: https://github.com/setasign/setapdf-demos/blob/master/public/demos/6-Stamper/2-adding-stamps/3-show-on-page/description.html Specify a range of pages for the stamp by providing an array of page numbers to $showOnPage. The range is inclusive. ```php $pdf->addStamp("path/to/stamp.pdf", ["showOnPage" => [2, 5]]); ``` -------------------------------- ### Add Stamp to Even Pages Source: https://github.com/setasign/setapdf-demos/blob/master/public/demos/6-Stamper/2-adding-stamps/3-show-on-page/description.html To apply a stamp only to even-numbered pages, set $showOnPage to 'even'. ```php $pdf->addStamp("path/to/stamp.pdf", ["showOnPage" => "even"]); ``` -------------------------------- ### Add Stamp to Specific Page Source: https://github.com/setasign/setapdf-demos/blob/master/public/demos/6-Stamper/2-adding-stamps/3-show-on-page/description.html Use the $showOnPage parameter to display a stamp on a particular page. Ensure the page number is valid. ```php $pdf->addStamp("path/to/stamp.pdf", ["showOnPage" => 1]); ``` -------------------------------- ### Add Stamp to Odd Pages Source: https://github.com/setasign/setapdf-demos/blob/master/public/demos/6-Stamper/2-adding-stamps/3-show-on-page/description.html Use the string 'odd' to apply the stamp exclusively to odd-numbered pages. ```php $pdf->addStamp("path/to/stamp.pdf", ["showOnPage" => "odd"]); ``` -------------------------------- ### Set Stamp Tag Name to Null Source: https://github.com/setasign/setapdf-demos/blob/master/public/demos/6-Stamper/3-various/5-tagged-stamp/description.html Set the tag name to null if the resolved parent tag should be used instead of creating an individual tag. This limits the stamp to a single page. ```php $stamp->setTagName(null); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.