问题
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