PHP code example of springworks / pdf-maker

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

    

springworks / pdf-maker example snippets




return [
    'options' => [
        'pdf' => [
            "landscape" => false, // Set to `true` for landscape PDFs
            "width" => "8.27in", // width of the page in inches
            "height" => "11.69in", // height of the page in inches
            "marginTop" => ".4in", // top margin of the page in inches
            "marginBottom" => ".4in", // bottom margin of the page in inches
            "marginLeft" => ".4in", // left margin of the page in inches
            "marginRight" => ".4in", // right margin of the page in inches
        ],
        'image' => [
            "fullPage" => true,
            "viewPortOptions" => [
                "width" => 1920, // Viewport width in pixels 
                "height" => 1080 // Viewport height in pixels
            ]
        ]
    ]
];