PHP code example of kduma / pdf-imposition

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

    

kduma / pdf-imposition example snippets


use Kduma\PdfImposition\LayoutGenerators\AutoGridPageLayoutGenerator;
use Kduma\PdfImposition\LayoutGenerators\Markers\PrinterBoxCutMarkings;
use Kduma\PdfImposition\PdfImposer;
use Kduma\PdfImposition\PdfSource;
use Kduma\PdfImposition\DTO\Size;

$cardSize = Size::make(90, 50);

$layoutGenerator = new AutoGridPageLayoutGenerator($cardSize);
$layoutGenerator->center();

$layoutGenerator = new PrinterBoxCutMarkings($layoutGenerator);

$PdfImposer = new PdfImposer($layoutGenerator);

$cards = (new PdfSource)->read('input.pdf');
$PdfImposer->export($cards, 'output.pdf');