1. Go to this page and download the library: Download shoaib3375/php-doc-exporter 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/ */
shoaib3375 / php-doc-exporter example snippets
use Shoaib3375\PhpDocExporter\DocumentExporter;
$data = [
['name' => 'Shoaib', 'age' => 25, 'city' => 'Dhaka'],
['name' => 'মাইনুল', 'age' => 30, 'city' => 'Sylhet']
];
$exporter = new DocumentExporter();
$content = $exporter->export('pdf', $data);
// Save to file
file_put_contents('report.pdf', $content);
$exporter = new DocumentExporter();
// Export with token validation
$content = $exporter->export('pdf', $data, [], $apiToken);
// Throws InvalidArgumentException if token is invalid
use Shoaib3375\PhpDocExporter\Config;
$config = new Config();
// Validate tokens
if ($config->canAccessFullApi($token)) {
// Full access: create, edit, update
}
if ($config->canAccessSafeApi($token)) {
// Safe access: export only
}