PHP code example of uiii / processwire-fieldtypepdf
1. Go to this page and download the library: Download uiii/processwire-fieldtypepdf library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$options = array(
'suffix' => array('suffix1', 'suffix2'), // suffixes used in filename
'forceNew' => false, // if TRUE the image is regenerated if already exists
'format' => 'JPEG', // image format
'extension' => 'jpg', // image file extension
'background' => '#FFFFFF', // background color used when the PDF has transparent background
'resolution' => '300x300', // resolution used when reading the PDF
'colorspace' => Imagick::COLORSPACE_RGB, // colorspace used when reading the PDF
'imagickOptions' => array( // ImageMagick options
'pdf:use-cropbox=true'
)
)