tecnickcom / TCPDF

Official clone of PHP library to generate PDF documents and barcodes
https://tcpdf.org
Other
4.18k stars 1.51k forks source link

Internal HTML links do not work #550

Open Jefferson49 opened 2 years ago

Jefferson49 commented 2 years ago

When using document internal links in HTML and generating a PDF file with writeHTML, the internal links do not work in PDF readers. Indeed, they look like links. However, nothing happens if the link is clicked.

Used TCPDF version 6.4.4

Example HTML:

<!DOCTYPE HTML>
<html lang="de">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
        <title>Title</title>
    </head>
    <body>
        <a href="#my_id">Link</a>
        <p>Text<p>
        <a id="my_id">Target</a>
        <p>Text<p>
    </body>
</html>

Is there any other way to write HTML code in order to make internal linking work?

chalda-pnuzig commented 1 year ago

I am facing the same issue. The example 45 is not functioning properly either, the link on page 6 that should redirect to the first page but it doesn't.