PHP code example of dgarden / gotenberg-bundle

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

    

dgarden / gotenberg-bundle example snippets


  
    // ...
    $file = $this->pdfFileGenerator->html('<html><body><h1>Hello</h1></body></html>', 'test.pdf');
  

  
    // ...
    $file = $this->pdfFileGenerator->htmlFile('index.html', 'test.pdf');
  

  
    // ...
    $file = $this->pdfFileGenerator->merge('file1.pdf', 'file2.pdf', 'file3.pdf', 'result.pdf');
  

  
    // ...
    $file = $this->pdfFileGenerator->mergeWithOptions([PdfFileGeneratorOptions::OPTION_ASYNC => true], 'file1.pdf', 'file2.pdf', 'file3.pdf', 'result.pdf');
  

  
    // ...
    $file = $this->pdfFileGenerator->template('test.html.twig', 'test.pdf', ['name' => 'John']);
  

  
    // ...
    $file = $this->pdfFileGenerator->url('https://www.digitalgarden.fr', 'output.pdf');