PHP code example of ctbuh / wkhtmltopdf-api-php-client

1. Go to this page and download the library: Download ctbuh/wkhtmltopdf-api-php-client 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/ */

    

ctbuh / wkhtmltopdf-api-php-client example snippets


use ctbuh\PdfApi\PdfApi;

$pdf = new Pdf();
$pdf->inline("<h1>hello world</h1>");
// script stops

$html = view('admin.membership-certificates.document', $data)->render();

$pdf = new PdfApi();
$pdf->inline($html, [
    'orientation' => 'Landscape',
    'page-size' => 'letter',
    'no-outline' => true
]);