2017-09-26 140 views
0

我想将链接插入到使用FPDF生成的PDF中。这是我的代码的当前状态:在PDF生成器(FPDF)中启用HTML定位标记

$link = 'www.blablabla.de'; 

$pdf->MultiCell("Please click the following link: <a href=".$link.">Click</a>. Thank you!"); 

我也尝试了其他方式,但它不工作。

希望有人能帮助我..

+1

也许这可以帮助:http://www.fpdf.org/en/tutorial/tuto6.htm – teeyo

回答

1

使用此代码。并阅读fpdf手册。代码参考Manual

$pdf->SetFont('Arial','',14); 
$pdf->Write(5,'Visit '); 
// Then put a blue underlined link 
$pdf->SetTextColor(0,0,255); 
$pdf->SetFont('','U'); 
$pdf->Write(5,'your text','http://www.yourlink.com'); 
+0

这是工作,但我怎么能在中心内写在生成的PDF链接-方法。文件中没有任何内容.. – Codehan25