Is there a way to have a link in PDF to open in a new browser's tab?
-
We have a template with a link written like so
<a href="{{:#data.assetLink}}" target="new">REVIEW</a>
When PDF is generated the link would open in the same browser window as the PDF itself, replacing it. Is there a way to specify anything that would open link in a new browser's tab?
We are using wkhtmltopdf and JSReport 2.6.1
-
it seems it is not possible by the pdf design, we had a similar question and it seems it not possible to define that it should open file in a new page.
-
thank you!
-
Just to close this, is there a way to add javascript to PDF file via JSReport?
-
Here is a demo how you can add javascript to the pdf using afterRender hook.
If you download the pdf from the demo and open it in the desktop acrobat reader, the print dialog automatically pops up.
https://playground.jsreport.net/w/anon/SyuX7ahJe-25However just answering your last question, I don't know how I would solve your original request at this moment.
-
Got it, I was thinking about finding and replacing all the links with JavaScript
app.launchURL()
but it seems this wouldn't be easy (or even doable) from within the jsreport processing pipeline.