0
Dans une application symfony, j'utilise knp_snappy pour générer PDF:symfony + knp_snappy: gtk-AVERTISSEMENT ne peut pas afficher ouvert
return new Response(
$this->get('knp_snappy.pdf')->getOutput($url),
200,
array(
'Content-Type' => 'application/pdf',
'Content-Disposition' => 'attachment; filename="file.pdf"'
)
);
mais je reçois cette erreur:
The exit status code '1' says something went wrong:
stderr: "Loading pages (1/6)java version "1.7.0_79"
[more here ... cut for clarity]
OpenJDK Runtime Environment (IcedTea 2.5.6) (7u79-2.5.6-0ubuntu1.14.04.1)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)
(wkhtmltopdf:12934): Gtk-WARNING **: cannot open display:
"
stdout: ""
command: wkhtmltopdf --lowquality 'http://symfony.dev/app_dev.php/application/reporter/674/inventory' '/tmp/knp_snappy5643248854b563.21161953.pdf'.
S'il vous plaît noter que :
- le donné
$url
fonctionne et est une URL absolue (car il contient un lien vers CSS). - si j'utilise
$this->get('knp_snappy.pdf')->getOutputFromHtml($html)
au lieu de$this->get('knp_snappy.pdf')->getOutput($url)
tout fin de travail, mais je ne peux pas charger le css (et c'est le comportement normal)