skip to Main Content

I have created the PDF file programmatically. For this, I have used the HTML to PDF converting library. In my PDF there are some links for some pages of website.

I have implemented the html by following way and then converted it to PDF programmatically.

<a target="_blank" href="http://mywebsite_url_here.html">Link</a>

But when opening this PDF into chrome or firefox browser and clicking on the any link exist in PDF. Links are opening is same TAB instead of the new TAB. Please help to find out the solution for this. so that my PDF reside in one tab and link will open in another tab in browser.

I have already tried

target="_blank"

target="_top"

<a onclick="window.open ('http://mywebsite_url_here.html', ''); 
 return false" href="javascript:void(0);"></a>

But nothing has worked for me.

2

Answers


  1. Could you try #toolbar=0&view=fitH

    <a target="_blank" href="http://mywebsite_url_here.html#toolbar=0&view=fitH">Link</a>
    

    or

    <a href="http://mywebsite_url_here.html#zoom=100&view=fitH" target="_blank">Link</a>
    
    Login or Signup to reply.
  2. Standard browser behaviour so don’t think you are going to get an answer. 🙂

    WHY ? Well the links in a pdf to a URL can simply be plain text like if I write

    Open link in new tab of browser from PDF file which I converted from HTML

    It will take you to ….

    YES this page.

    ANSWER right click and open in new window !! or Right Click open in new tab.

    enter image description here
    enter image description here
    enter image description here

    The best hack I can do will use the PDF to open the same tab as blank thus not really answer your question, but for WHY?

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search