PHP code example of printgraph / php-sdk

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

    

printgraph / php-sdk example snippets




use Printgraph\PhpSdk\Api\Pdf\Generator\GenerateRequest;
use Printgraph\PhpSdk\Client\ClientFactory;
use Printgraph\PhpSdk\Printgraph;

'message' => 'Hello, World']
);

$response = $pringraph->pdf()->generate($request)->expect(
    new \RuntimeException('Failed to generate PDF')
);

file_put_contents('test.pdf', $response->getContents());

$ composer req printgraph/php-sdk