Show a link in fpdf

荒凉一梦 提交于 2019-12-24 03:27:26

问题


When I try to display a link in pdf it does not show me the link, but the php code or string text are displayed. How can I change that?

This is my code

while($fila2 = mysql_fetch_array($fila)) {
    $item = $item+1;    
    $pdf->Cell(5, 8 ,$item, 1);
    $pdf->Cell(10, 8 ,$fila2['FOLIO'], 1);
    $pdf->Cell(70, 8 ,$fila2['NOMBRE'], 1);
    $pdf->Cell(25, 8 ,date("d-m-Y",strtotime($fila2['FECHA_SOLICITUD'])), 1);
    $pdf->Cell(25, 8 ,$fila2['TIPO_AUTORIZACION'], 1);
    $pdf->Cell(25, 8 ,date("d-m-Y",strtotime($fila2['FECHA_AUTORIZACION'])), 1);
    $pdf->Cell(20,8 , '<a href="http://www.intranet.com/mb/rprh06/final.php?folio=$fila2["FOLIO"]" target="_blank">Enlace</a>',1); 
    $pdf->Ln(8);
}

And this is my result

I want to show something like "View Link" according to the result ID of the row. But when I pass the pointer on the link it shows the following

Thank You.


回答1:


Based on the link:- http://www.fpdf.org/en/doc/link.htm

You need to write like this:-

$pdf->Link(100,10,10,10, 'http://www.intranet.com/mb/rprh06/final.php?folio='.$fila2[‌​"FOLIO"]);

Or with Cell():-

$pdf->Cell(20,8 ,'','','','',false, "http://www.intranet.com/mb/rprh06/final.php?folio=".$fila2["FOLIO"]); 

Reference:- http://www.fpdf.org/en/doc/cell.htm

Note:- change parameters values accordingly.



来源:https://stackoverflow.com/questions/41972271/show-a-link-in-fpdf

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!