1

Let say for example I will put google.com link to some text in my pdf, and opens in new tab.

But this simple a href tag doesn't worked!

<a href="www.google.com" target="_blank">Go to google</a>

The above code generates:

file://google.com/

How can I do that when I'm using gem 'wicked_pdf'

Please help!

aldrien.h
  • 3,437
  • 2
  • 30
  • 52

1 Answers1

1

I'm not familiar with wicked_pdf, but it looks like your google link is missing the http protocol. You're going to want an absolute url like the following:

<a href="https://www.google.com">Go to google</a>

Try it out and see if that solves the problem

Ren
  • 1,379
  • 2
  • 12
  • 24
  • Hi @Ren, yes it works! Is it possible to use the target="_blank" to open the link in new tab? – aldrien.h Jul 28 '16 at 01:04
  • Again i've never used wicked_pdf, but you can certainly try adding target='_blank' to the anchor tag and see if it works. – Ren Jul 28 '16 at 02:45
  • Also don't forget to accept my answer and upvote if it helped you :) – Ren Jul 28 '16 at 02:46
  • I tried to add target="_blank" but it goes automatically to the link, not opening a new tab. – aldrien.h Jul 28 '16 at 03:16