react-pdf icon indicating copy to clipboard operation
react-pdf copied to clipboard

Open Links new tab

Open chemseddine201 opened this issue 2 years ago • 3 comments

hi, is it possible to open links within the pdf file in new window when clicked ?

<Link src="google.com" target="_blank">Some Text</Link>

i tried the above example but the link opened same tab where the pdf file rendered.

Please any way to open theses links in new tab?

chemseddine201 avatar Nov 01 '24 21:11 chemseddine201

It is not. PDF spec does not specify a way to tell browsers how to open links. It's up to the browser. From a quick search I couldn't find a way to configure the browser either

diegomura avatar Nov 16 '24 22:11 diegomura

It is not. PDF spec does not specify a way to tell browsers how to open links. It's up to the browser. From a quick search I couldn't find a way to configure the browser either

maybe it is possible to render a custom JavaScript function that works with the onclick event and uses pure JavaScript code to open the link in a new tab? or the possibility of use app.launchURL() that supported by acrobat

chemseddine201 avatar Nov 16 '24 23:11 chemseddine201

It might in the future. Good call

diegomura avatar Nov 17 '24 01:11 diegomura