PHP code example of devraeph / laravel-web-to-pdf

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

    

devraeph / laravel-web-to-pdf example snippets


use DevRaeph\WebToPdf\Facades\WebToPDF;

$myPDF = WebToPDF::setUrl(/* URL */)
        ->setFileName(/* Custom FileName */)//OPTIONAL
        ->setDelay(/* Default 50 */)//OPTIONAL
        ->setFullPage(/* Default false */)//OPTIONAL
        ->generate();      
        
return $myPDF->toFile(); //Stream Download
return $myPDF->toUrl();  //Return Download URL
shell
php artisan vendor:publish --provider="DevRaeph\WebToPdf\WebToPDFServiceProvider" --tag="config"