Prevent Hyperlinks In Pdf



  • I am trying to prevent links in my pdf ... so I defanged all my hyperlinks to just be text like https://www.something.com ... took away the href tag in the html. Works when printing out html and also in the pdf viewer. But as soon as I open the pdf with Chrome or Mac Preview the link is back.

    Is there setting under pdf utilities I am missing to prevent this or some other trick to prevent hyperlinks from working.



  • Could you share an example?

    For example this does get rendered as a normal text

    <a>hello</a>
    


  • Should have given you a playground. https://playground.jsreport.net/w/jamesstacyjones/Xl8QbEht.

    We defang our links as our reports will have malicious links for an analyst to review ... but we defang then so they are not clickable in the html.

    In my testing sometimes the pdf software that opens up the pdf obeys the html sometimes it does not:
    Chrome : converted to hyperlink:

    • Edge: converted to hyperlink
    • Firefox: defanged hyperlink
    • Mac Preview: converted to hyperlink
    • Adobe Acrobat: defanged hyperlink

    And in the playground I made above ... they are converted to hyperlinks. Was wondering if there is a way to prevent them from being clickable or converted.



  • How about this

    <a href="javascript:void(0)">https://www.jsreport.net</a>
    


  • I think I have found a couple of solutions playing around in playground. Seems to work ... not perfect as it still acts like it is a link but I think I can use some css to prevent that also.



  • <a href="javascript:void(0)">https://www.jsreport.net</a>
    

    Definitely another good solution. Thanks again for your help.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.