PHP code example of divineomega / uxdm-pdf-destination

1. Go to this page and download the library: Download divineomega/uxdm-pdf-destination 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/ */

    

divineomega / uxdm-pdf-destination example snippets


$pdfFile = __DIR__.'/users.pdf';
$pdfDestination = new PDFDestination($pdfFile);

$destination->setPaperSize('A5');
$destination->setPaperOrientation('landscape');

$htmlPrefix = '<h1>My Report</h1>
            <style>
                table { width: 100% }
                h1 { text-align: center; }
                th { text-transform: capitalize; text-align: center; } 
                th, td { margin: 0; border: 1px solid #000; }
            </style>';
$htmlSuffix = '<p>Created by UXDM</p>';

$destination->setHtmlPrefix($htmlPrefix);
$destination->setHtmlSuffix($htmlSuffix);

$migrator = new Migrator;
$migrator->setDestination($pdfDestination);

$migrator = new Migrator;
$migrator->addDestination($pdfDestination, ['field1', 'field2']);
$migrator->addDestination($otherDestination, ['field3', 'field2']);