你好我想用pdf显示地图,但每次pdf显示空结果。谁能帮我。如果可能的话我该怎么办呢 到目前为止我在这里尝试过: -
public function savepdf(Request $request){
PDF::loadView('map-pdf')->save('images/map.pdf' );
echo "saved"; die;
}
在map-pdf中,我只是用标记显示地图,它在浏览器中成功显示,但不是pdf。请提前帮助谢谢。
答案 0 :(得分:1)
为什么不首先使用地图和标记生成图像,然后在PDF中使用该图像?我想您知道如何在地图上获取区域图像,如果没有,请在此处阅读:https://developers.google.com/maps/documentation/static-maps/?csw=1
以下代码可以帮助您,因为它在许多项目中对我有用:
$options = new Options();
$options->set('isRemoteEnabled', true);
$dompdf = new Dompdf($options);