以下是我在tcpdf
中使用的静态网址:
http://maps.google.com/maps/api/staticmap?zoom=14&size=800x800&maptype=roadmap&markers=color:green|label:A|52.3693824,4.8871682&markers=color:green|label:B|52.369369,4.901235&markers=color:red|label:C|52.3585252,4.8808168&path=color:66ACF2|weight:3|enc:uks~Haoy \ iDOCp @鸭@ pGVV?@ö@ B_DB @ MXSCsDrBaDN [S_ @小号_ @?锰@}我?uDIu @@ aBBw @@ @öLoCHmA?的@ AoDI_CA_AJ {FH {BD] ?2 H @ kBT_AJSLKRIZMFAEm @米@ ODG [U [wBeCuBcCIMI] GgACWG我GCQUGGG @ SUGAK @} @ tCiBhGs @ DC [Z @ QTQJe 1 L {ALoHb @米K〜@ WrAEHNNt @升@ jB表示|?AvFrFhAbAfAfAnBjB〜@ | @ LDJBRj @ tAxE ^ RAT @ jCPn @ VAN @ BZLf @ T @ F〜DN @ RLVLtCn @ ND | @ ZADCvBj @ ZBJ @ AV_BbUbB | A〜BrBjAdAz @ d @的RPx @ PAM @ BBO @ |?甲[Z @ H B ?@M \ vAnItGr_ @个HTx @我@ Z @克@ zByAHIHEAWo @ wD_AmF&安培;传感器=假
我认为由于加密路径,tcpdf没有解析这个并在谷歌地图中显示错误的路径。
有人可以帮我解决这个问题吗?在此先感谢!!
答案 0 :(得分:0)
使用writeHTMLCell()
&amp; <img>
html标记:
$html = <<<EOD
<img border="0" src="//maps.google.com/maps/api/staticmap?zoom=14&size=800x800&maptype=roadmap&markers=color:green|label:A|52.3693824,4.8871682&markers=color:green|label:B|52.369369,4.901235&markers=color:red|label:C|52.3585252,4.8808168&path=color:66ACF2|weight:3|enc:uks~Haoy\iDOCp@Ap@pGVV?@o@B_Db@MXSCsDrBaDN[S_@S_@?Mn@}I?uDIu@@aBBw@@o@LoCHmA?s@AoDI_CA_AJ{FH{BD]h@kBT_AJSLKRIZMFAEm@m@oDG[U[wBeCuBcCIMI]GgACWG?I?GCQUGGG@SUGAK@}@tCiBhGs@dC[z@QTQJe@L{ALoHb@M?K~@WrAEHNNt@l@jB|AvFrFhAbAfAfAnBjB~@|@LDJBRj@tAxE^rAt@jCPn@VAn@BZLf@T@F~Dn@RLVLtCn@nD|@ZADCvBj@zBj@AV_BbUbB|A~BrBjAdAz@d@RPx@pAm@bBo@|A[z@?H?B?@M\vAnItGr_@HTx@i@z@g@zByAHIHEAWo@wD_AmF&sensor=false" alt="Greenwich, England">
EOD;
$pdf->writeHTMLCell('', '', 0, 0, $html, 0, 1, false, true, 'L', false);
结果:
<强>更新强>
您也可以使用Image()
:
$pdf->Image(
'http://maps.google.com/maps/api/staticmap?zoom=14&size=800x800&maptype=roadmap&markers=color:green|label:A|52.3693824,4.8871682&markers=color:green|label:B|52.369369,4.901235&markers=color:red|label:C|52.3585252,4.8808168&path=color:66ACF2|weight:3|enc:uks~Haoy\iDOCp@Ap@pGVV?@o@B_Db@MXSCsDrBaDN[S_@S_@?Mn@}I?uDIu@@aBBw@@o@LoCHmA?s@AoDI_CA_AJ{FH{BD]h@kBT_AJSLKRIZMFAEm@m@oDG[U[wBeCuBcCIMI]GgACWG?I?GCQUGGG@SUGAK@}@tCiBhGs@dC[z@QTQJe@L{ALoHb@M?K~@WrAEHNNt@l@jB|AvFrFhAbAfAfAnBjB~@|@LDJBRj@tAxE^rAt@jCPn@VAn@BZLf@T@F~Dn@RLVLtCn@nD|@ZADCvBj@zBj@AV_BbUbB|A~BrBjAdAz@d@RPx@pAm@bBo@|A[z@?H?B?@M\vAnItGr_@HTx@i@z@g@zByAHIHEAWo@wD_AmF&sensor=false',
0.5, 0.5, 20, 20, '', '', '', false, 300
);
它正确显示路径: