1. Go to this page and download the library: Download sensiolabs/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/ */
namespace App\Controller;
use Sensiolabs\GotenbergBundle\GotenbergPdfInterface;
class YourController
{
public function yourControllerMethod(GotenbergPdfInterface $gotenberg): Response
{
return $gotenberg->url()
->url('https://sensiolabs.com/fr/')
->generate()
->stream() // will return directly a stream response
;
}
}
namespace App\Controller;
use Sensiolabs\GotenbergBundle\GotenbergPdfInterface;
class YourController
{
public function yourControllerMethod(GotenbergPdfInterface $gotenberg): Response
{
return $gotenberg->html()
->content('twig_simple_pdf.html.twig', [
'my_var' => 'value'
])
->generate()
->stream() // will return directly a stream response
;
}
}
namespace App\Controller;
use Sensiolabs\GotenbergBundle\GotenbergScreenshotInterface;
class YourController
{
public function yourControllerMethod(GotenbergScreenshotInterface $gotenberg): Response
{
return $gotenberg->url()
->url('https://sensiolabs.com/fr/')
->generate()
->stream()
;
}
}
namespace App\Controller;
use Sensiolabs\GotenbergBundle\GotenbergScreenshotInterface;
class YourController
{
public function yourControllerMethod(GotenbergScreenshotInterface $gotenberg): Response
{
return $gotenberg->html()
->content('twig_simple_pdf.html.twig', [
'my_var' => 'value'
])
->generate()
->stream()
;
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.