PHP code example of juicyfx / juicy

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

    

juicyfx / juicy example snippets


use JuicyFx\Juicy\JuicyFx;

$client = JuicyFx::createPdf();
$client = JuicyFx::createPdf(['base_uri' => 'your-pdfx.now.sh']);

$response = $client->pdf()->url('https://f3l1x.io');

$response = $client->pdf()->raw('raw string');

$response = $client->pdf()->json([);
    'body' => 'post body'
]);

$response = $client->pdf()->json([
    'body' => 'post data',
    'headerTemplate' => '<div style="font-size: 30px;">HEADER</div>',
    'footerTemplate' => '<div style="font-size: 30px;">FOOTER</div>',
], [
    'displayHeaderFooter' => 1,
    'marginTop' => 100,
    'marginBottom' => 100,
]);