使用Google Map从树枝页面生成PDF

Here, I use knpsnappybundle to generate pdfs. I want to generate a pdf of one of my pages HTML.twig. Everything goes well except GoogleMap. My pdf is created well as it should, all my data is provided without any problem except my googlemap. (of course my map appears well on HTML.twig)

I use ivory-google-map to generate my maps.

side Controller

$html = $this->renderView('TriangleClientBundle:Pdf:fiche_technique_acteur_pdf.html.twig',
            array(
     'map' => $map
                  ));
    //return new Response($html);

    return new Response(
    $this->get('knp_snappy.pdf')->getOutputFromHtml($html),
    200,
    array(
    'Content-Type'          => 'application/pdf',
    'Content-Disposition'   => 'attachment; filename="fiche_technique '.$nom.'.pdf"'
    )
    );`

Side html.twig

{{ google_map(map) }}

Snappy pdf is grabbing html then renders it in pdf, but it doesn't interpret javascript.

You will have to use a phantom.js or something like this to compute javascript, then render the resutling html in pdf.