PHP code example of erlangparasu / pdfbox-php-wrapper
1. Go to this page and download the library: Download erlangparasu/pdfbox-php-wrapper 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/ */
erlangparasu / pdfbox-php-wrapper example snippets
$pdfbox = new Pdfbox();
// Use PDFBox v3
$pdfbox->useVersion3();
// All subsequent calls will use the v3 engine
$pdfbox->addSourcePath(...)
->merge();
// Switch back to v2 if needed
$pdfbox->useVersion2();
$pdfbox = new Pdfbox();
// Example for Linux/macOS
$pdfbox->setJavaPath('/usr/bin/java');
// Example for Windows
// $pdfbox->setJavaPath('C:\\Program Files\\Java\\jdk-11\\bin\\java.exe');
$pdfbox->addSourcePath(...)
->merge();