我在导出到PDF时在锚标记中遇到问题。锚标记适用于http://google.com之类的静态网址,但不适用于动态url。我正在使用PDF的mpdf模块。
$url = $fullBaseUrl.'/designers/attachment/time/'.$value['filetime'].'/uploadTab/imgattach';
// http://localhost/msme_latest/designers/attachment/time/1394432246/uploadTab/imgattach
$html= '<a href="'.$url.'">'.$value['filename'].'</a>';
// echo $html; die;
$mpdf->WriteHTML($html);
$mpdf->Output();
exit;
当我回显我的代码$ html时,它正确地给出了我的链接。但是当我以PDF格式导出此代码时,它没有给出任何形式的链接PDF。任何帮助将被申请。
使用Ip地址而不是localhost或使用Live服务器url它对我有用
<?php
$fullBaseUrl = "http://127.0.0.1/meme_latest";
$url = $fullBaseUrl.'/designers/attachment/time/'.$value['filetime'].'/uploadTab/imgattach';
//(http://localhost/msme_latest/designers/attachment/time/1394432246/uploadTab/imgattach)
$html= '<a href="'.$url.'">Test link</a>';
//echo $html; die;
include("../mpdf.php");
$mpdf=new mPDF();
$mpdf->WriteHTML($html);
$mpdf->Output();
exit;
?>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句