How-To GuidesMarch 13, 2026

How to Convert an HTML Page to PDF and Keep All Clickable Links

When you convert a web page to PDF, one of the most important functional elements to preserve is its hyperlinks. A PDF with working links can be a genuinely useful digital document — readers can navigate to references, access related resources, or follow citations directly from within the PDF. A PDF where all links are dead text defeats much of the purpose of creating a digital document rather than a printed page. Whether links survive PDF conversion depends on two things: the method you use to create the PDF, and the type of links involved. Internal anchor links (linking to sections within the same page), external URLs (linking to other websites), and email links (mailto:) each have slightly different behavior in PDF conversion, and some tools handle some types better than others. This guide explains which conversion methods preserve links, how to test link functionality in your output PDF, and how to handle edge cases like dynamically generated links or links inside JavaScript-driven menus.

Which HTML-to-PDF Methods Preserve Links

Not all HTML-to-PDF methods treat links equally. Understanding the difference helps you choose the right tool for your specific needs. Browser Print to PDF (Ctrl+P > Save as PDF) preserves external hyperlinks in most modern browsers. Chrome, Firefox, and Edge all preserve clickable links when using the built-in PDF print function. Internal anchor links may or may not work depending on the browser and PDF viewer combination. Online converters that use a headless browser engine (like Puppeteer or Chrome in headless mode) produce PDFs where links are faithfully preserved because the browser itself handles the link detection. LazyPDF's HTML-to-PDF tool uses a rendering engine that preserves both external URLs and email links as clickable annotations in the output PDF. Conversely, basic HTML-to-PDF converters that parse HTML as text and lay it out manually (rather than rendering it in a browser engine) often lose links entirely, converting them to plain text. Always test a sample conversion before relying on any tool for link-preserving PDF output.

  1. 1Open the webpage you want to convert and identify all critical links that must be preserved.
  2. 2Use Chrome's Print to PDF (Ctrl+P > Save as PDF) for a quick test with link preservation.
  3. 3Open the resulting PDF in Adobe Acrobat Reader and hover over link areas — working links show the cursor change to a hand pointer.
  4. 4Click several links in the PDF to verify they open the correct URLs in your browser.
  5. 5If links are not working, switch to a headless-browser-based converter like LazyPDF's HTML to PDF tool.
  6. 6Test the output from the alternative converter using the same link verification steps.

Using LazyPDF's HTML-to-PDF Converter for Link Preservation

LazyPDF's HTML-to-PDF converter renders pages using a full browser rendering engine, which means the link handling is identical to how a real browser would treat them. External <a href='...'> links become clickable PDF annotations pointing to the original URLs. Email links (mailto:) become clickable email actions. Internal anchor links (#section-id) become internal document navigation links. When providing a URL for conversion, the tool fetches the live page including all stylesheets, scripts, and images. For pages with complex navigation or dynamic content, the converter captures the loaded state of the page, so links in dynamically rendered menus and JavaScript-populated content are captured correctly. For HTML file upload (rather than URL), ensure all linked stylesheets and images are referenced with absolute URLs or are included in the uploaded file package. Links to other pages (relative links) will be captured as-is — they will point to the relative URL, which may not resolve correctly in a PDF context outside of the original web server.

  1. 1Go to LazyPDF and open the HTML to PDF converter.
  2. 2Enter the complete URL of the page you want to convert, including https://.
  3. 3Wait for the rendering to complete — the tool fetches and renders the full page.
  4. 4Download the PDF and open it in a PDF reader.
  5. 5Test at least 5 links of different types (external, internal, email) to verify preservation.

Handling Different Link Types in HTML PDFs

External links (https://example.com) are the most straightforwardly preserved — any proper HTML-to-PDF converter that uses browser rendering will produce clickable PDF links that open in the user's browser when clicked. Internal anchor links (#section-name) behavior depends on whether the converter maps these to PDF bookmarks or internal navigation. In Chrome's Print to PDF, anchor links within the same page are converted to PDF page navigation links when they exist in the rendered page. In standalone PDF converters, this conversion is less consistent — some tools map anchors to PDF bookmarks, others ignore them. Email links (mailto:example@email.com) are preserved by most converters but depend on the PDF viewer and the user's email client configuration. When clicked, they should open the user's default email application with the address pre-filled. Test this functionality if email links are important in your document. JavaScript-triggered links or buttons that fire JavaScript functions (onclick handlers) rather than following <a href> links are not preserved as links — they appear as visual buttons or text with no click functionality. These must be manually noted and replaced with static URLs in the PDF if link functionality is critical.

  1. 1List all link types on your page: external URLs, anchor links, email links, and JavaScript-triggered actions.
  2. 2Accept that JavaScript-triggered actions will not convert — document these and add static URL equivalents if needed.
  3. 3After converting, test one link of each type to verify preservation.
  4. 4For internal navigation (table of contents anchors), verify they jump to the correct PDF page.

Troubleshooting Missing or Broken Links in HTML PDFs

If links are not preserved in your converted PDF, the most common fix is to switch to a better conversion method. Browser Print to PDF and headless-browser-based online tools are the most reliable for link preservation. For PDFs where links appear visually but do not work (cursor changes to hand pointer but clicking does nothing), check whether your PDF viewer is blocking external links for security reasons. Adobe Acrobat Reader has a warning dialog when clicking external links — the link works after the user dismisses the warning. Some corporate PDF viewers block all external links by policy. For PDFs where link text is visible but not clickable at all, the converter likely used a print-path conversion that treats links as plain text. Re-convert using a method that explicitly preserves hyperlinks (Chrome Print to PDF or a headless-browser-based converter).

Frequently Asked Questions

Why do some links work in my HTML PDF and others do not?

Different link types are handled differently during conversion. Standard <a href='https://...'> links are reliably preserved. Relative links ('../page') may not resolve correctly outside the original website context. JavaScript onclick handlers are not preserved as links. Images used as links may lose their click target depending on the converter. Check your non-working links and categorize them by type — relative links can be fixed by making them absolute before converting, and JavaScript triggers need to be replaced with static href attributes if link functionality is essential in the PDF output.

Can I add links to a PDF manually after conversion?

Yes. Adobe Acrobat (paid) allows adding link annotations to any PDF. Select the Link tool, drag a rectangle over any text or area, specify the link action (open URL, jump to page, open file), and save. This is useful for adding links that were lost during conversion. Free alternatives include Foxit PDF Reader and PDF24 Desktop, which also offer link annotation features. For documents with many missing links, however, re-converting with a link-preserving method is faster than manually adding each link.

How do I convert a web page with a table of contents to PDF with working navigation?

For a table of contents to work in the PDF, two things must happen: the TOC entries must link to internal anchors, and those anchors must be mapped to PDF page numbers or bookmarks during conversion. Chrome's Print to PDF handles this well for pages with proper anchor links. After converting, open the PDF and click each TOC entry to test navigation. If TOC links do not work, use a converter that explicitly maps HTML anchor links to PDF destination annotations. Adobe Acrobat's HTML-to-PDF conversion has the most robust handling of document navigation structures.

Are links in a PDF safe to click? How can I verify them before sharing?

Before sharing a PDF with external links, verify that all links point to the correct, trusted URLs. In Adobe Acrobat, go to Edit > Preferences > Trust Manager to see link security settings. You can also audit all links in a PDF by going to View > Tools > Edit PDF in Acrobat, which shows all link annotations and their destinations. For PDFs you receive from others, hover over links before clicking to preview the destination URL in most PDF readers. Be cautious of PDF links in unsolicited documents — phishing attacks sometimes use PDF links as redirects to malicious sites.

Convert any web page or HTML file to PDF with all hyperlinks preserved and clickable. No registration required.

Convert HTML to PDF

Related Articles