Bonjour,

Lorsque je génère mon pdf avec KnpSnappyBundle. Les certains caractères ne s'affiche pas correctement. Exemple : démarré

J'ai tout de suite pensé à un problème d'encodage.

J'ai essayé :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
 
$html = $this->renderView('xxxBundle:xxx:mavue.html.twig', array(
    'data' => $data,
));
 
return new Response(
    $this->get('knp_snappy.pdf')->getOutputFromHtml($html),
    200,
    array(
        'Content-Type'          => 'application/pdf',
        'Content-Disposition'   => 'attachment; filename="file.pdf"',
        'encoding'   => 'UTF-8',
    )
);
Mais sa ne marche pas. Lorsque j'affiche ma vue avec :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
 
return $this->render('xxxBundle:xxx:mavue.html.twig, array(
            'data' => $data,
            ));
Je n'ai pas de problème d'encodage.

Merci d'avance