Reputation: 5367
I'm trying to create an internal link in my PDF using TCPDF
I create the link at the start of my document:
$pdf = new ManualPDF ();
$link = $pdf->addLink();
$pdf->SetLink($link);
and then create a link to it later:
$pdf->Write(0,'Click Here',$link);
however this doesn't work, and the Click Here text doesn't even appear clickable on the PDF (cursor is Caret).
Any guidance?
EDIT
ManualPDF is an extension of FPDI, sorry I should have mentioned that originally
Upvotes: 1
Views: 1610
Reputation: 21681
From the documentation, you can use the Write()
method on your TCPDF object to achieve this.
For example:
//Line height
$lh = 10;
//Indicates if the cell background must be painted (true) or transparent (false).
$bg = false;
//L or empty string: left align (default value)
$align = 'L';
//If true set cursor at the bottom of the line, otherwise set cursor at the top of the line.
$ln = true;
$link = 'http://www.example.com/';
$tcpdf->Write($lh, 'Example Link', $link, $bg, $align, $ln);
Would write a line with the text Google (left-aligned and with a line break, just added for a better example).
This could help you better!
Upvotes: 1