Category : knp-snappy

I have a code which use to work to generate PDF with the KNP Snappy bundlde with Symfony2. This is what it looks like: $this->container->get(‘knp_snappy.pdf’)->generateFromHtml( $this->templating->render( $twigInclude, array( , ‘htmlFiles’ => $htmlFiles, ‘headlines’ => $headlines, ) ), $folderHistory . ‘/reports/’ . $filename . ‘.pdf’ ); My issue is that, I want to set margins and ..

Read more

So i made 1 controller and 1 method. It is for show data and download pdf data with snappy. Sometimes i can download it, but sometimes i can’t download it and throws unable to handle this request HTTP ERROR 500 Here is it my controller public function index(){ $data = []; $download = Input::get(‘download’, null); ..

Read more

I can’t seem to get external images to work, and local images only work if I use the full path in the docker php container. Is there any way around having to input the path manually? Controller return new Response($this->snappy->getOutputFromHtml($html, [ ‘page-width’ => 297, ‘page-height’ => 210, ‘images’ => true, ‘lowquality’ => false, ‘enable-external-links’ => ..

Read more