Skip to main content
July 26, 2024
Question

Anchor link in html doesn't work in pdf

  • July 26, 2024
  • 3 replies
  • 0 views

I have a html file and I have put anchor link in the Table of Content that will direct me to the selected part in the html webpage. But after I print the page and save as pdf, the anchor link is clickable but it directs me to the wrong part. Anyone have idea of how to solve this?

I also try to use html to pdf smart service instead of printing as pdf, the anchor link in pdf completely doesn't work.

3 replies

davidj137213
Brainy
July 28, 2024

COuld you attach here your html sample please?

August 1, 2024

Hi David, thanks for replying. I have solved the problem. The key here is to make sure html and pdf layouts are consistent, otherwise the link will point to a different destination. I had a print button in the middle of my html script and it seems to mess up my layout. I moved the button to the top of script.

davidj137213
Brainy
August 2, 2024

glad to hear that.. Good work!!