Daniel Katzan
Daniel Katzan

Reputation: 564

create hyper link to a specific location in pdf using mpdf

until now I was using TCpdf to create pdf documents

and I used html href tags in order to create a refernce to a specific location inside the same document like this:

<a href="#' . $page . ',' . $y_loc . '">

which created an hyperlink that sent me to a specific page , and to a specific cordinate on that page.

I switched to mpdf,

how can I achive the same behiviour using mpdf? (using the same format doent work) thx

Upvotes: 2

Views: 2450

Answers (1)

Meghan Hartman
Meghan Hartman

Reputation: 41

With mPDF it's similar to the way you would create an internal link in an HTML document. For the link text create a link like so:

<a href="#desired_content">Click here to jump to the content</a>

And then wrap the content in an tag with no href, but with a name the same as the # one above. Like so:

<a name="desired_content">This is where your content goes.</a>

I hope this helps!

Upvotes: 4

Related Questions