Google地图导出为pdf

时间:2018-04-04 06:48:09

标签: php google-maps

我想在pdf文件上生成谷歌地图,但它不显示在这里是我的代码,当我下载pdf它需要帮助导出谷歌地图在pdf谢谢这是我的代码

 <?php

    include 'conn.php';

    ob_start();  ?>             
    <style>
    body
    {
        background-color:white !important;
        color:black;
    }
    </style>

     <h1>This is a test.</h1>
            <p>We are located here:</p>
            <img width="200" height="200" src="http://maps.googleapis.com/maps/api/staticmap?center=-15.800513,-47.91378&zoom=11&size=200x200&sensor=false">



                        <?php

            $body = ob_get_clean();

            $body = iconv("UTF-8","UTF-8//IGNORE",$body);

            include("mpdf/mpdf.php");
            $mpdf=new \mPDF('c','A4-L','','' , 15, 15, 16, 16, 9, 9,'L'); 

            //write html to PDF
            $mpdf->WriteHTML($body);

            //output pdf
            $mpdf->Output('demo.pdf','D');


            //open in browser
            //$mpdf->Output();

            //save to server
            //$mpdf->Output("mydata.pdf",'F');

                    ?>

0 个答案:

没有答案