Error with FOSJsRoutingBundle and KnpSnappyBundle

1

I am using version 2.3 of Symfony and KnpSnappyBudle to generate Twig templates from html to pdf. I had a problem adding images, but I saw the solution online that using request in the url was solved.

Example: src= ” {{ app.request.scheme ~’://’ ~ app.request.httpHost ~ asset(‘img/logo.png’) }} ”.

Now I have a problem that I can not solve. I am using FOSJsRoutingBundle to generate routes and in the template that I convert to pdf with KnpSnappyBundle I have the following:

<script type="text/javascript" src="{{ path('fos_js_routing_js', {"callback": "fos.Router.setData"}) }}"></script>

With this line when generating the pdf it gives me the following error (the same error that it gave me with the images before using request in the routes):

The exit status code '1' says something went wrong:
stderr: "Loading pages (1/6)
[> ] 0%
[======> ] 10%
QSslSocket: cannot resolve SSLv3_client_method
QSslSocket: cannot resolve SSLv3_server_method
[=======> ] 13%
[==========> ] 18%
[==========================> ] 44%
[============================> ] 47%
[==============================> ] 50%
[==============================> ] 50%
[===========================================> ] 73%
[==============================================> ] 78%
[============================================================] 100%
Counting pages (2/6)
[============================================================] Object 1 of 1
Resolving links (4/6)
[============================================================] Object 1 of 1
Loading headers and footers (5/6)
Printing pages (6/6)
[> ] Preparing
[============================================================] Page 1 of 1
Done
Exit with code 1 due to network error: ContentNotFoundError
"stdout: ""
command: /opt/lampp/htdocs/Symfony/app/../vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64 --lowquality --page-size 'A4' --viewport-size '‘1024x768’' '/tmp/knp_snappy576ad837d24a82.40556276.html' '/tmp/knp_snappy576ad837d25009.94614572.pdf'.

Would there be any way to change that to make it work? I'm starting on this, so I'd appreciate your help.

    
asked by Joseph 22.06.2016 в 20:58
source

0 answers