PHP code example of yassin / ypdf

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

    

yassin / ypdf example snippets


use YPdf;

// Render a Blade view straight to disk
YPdf::renderFromViewToFile('pdfs.invoice', ['order' => $order], storage_path('app/pdfs/order.pdf'));

// Grab the binary and stream it to the browser
return response(
    YPdf::renderFromHtml($html),
    200,
    ['Content-Type' => 'application/pdf']
);

packages/
└── imar/
    └── ypdf/
        ├── composer.json
        ├── config/ypdf.php
        ├── src/
        │   ├── Contracts/
        │   ├── Drivers/
        │   ├── Facades/
        │   ├── YPdfManager.php
        │   └── YPdfServiceProvider.php
        └── README.md