Forum How do I...?

hyperlinks issue to the generated PDF

Bayanna
Hello there,

I'm getting a problem for showing as hyperlink in the PDF particularly if the website link is listed in the below format:

(e.g. www.infogridpacific.com),

But it seems to be working correctly for the following format.

www.infogridpacific.com

Is there any reason why the hyperlink is not working if I've opening and closing brackest before and after the website link as in my first example?

Thanks in advance for your valuable time looking into this.

Regards,
Getti.
mikeday
Is there actually a link element in the HTML source, eg. <a href="..."> or is it just a bare URL in the text? Because some PDF viewers will turn bare URLs into clickable links, and some won't, it's not reliable. If you definitely want a link in the PDF, you need to have a link in the source HTML document.
Bayanna
It is just a bare url in the text, I have also tried applying a link <a href="..."> too, however just because of there follows a opening and closing brackets the link is not clickable after generated a PDF.

When I removed the brackets that the link works fine.

I think this type of URL where follows brackets is not handled through like some other basic url do correctly upon generating the PDF.

Find attached html for your reference.

Regards,
Getti
  1. hyperlink_issue_in_pdfs.html1.6 kB
mikeday
In the HTML there is no <a href="..."> so it may not work.
Bayanna
Dear Mike,

I mean to say that the first two websites in the attached file is not working even after the link appied to them. Find attached revised file now.

Getti
  1. hyperlink_issue_in_pdfs.html1.7 kB
mikeday
It works for me if I run Prince on the attached file. Can you attach the PDF you are generating?
Bayanna
Please find attached the PDF where I'm getting problem for links that the first two are not clickable as others do.

Issue is for Print PDF - Trimmed and Print PDF Cros marks

Thanks very much

Getti
  1. hyperlinks test case 01.pdf24.4 kB
mikeday
There must be some additional CSS styling being applied to the input document which is disabling the link elements.
Bayanna
Hi Mike,

I have attached Prince output xhtml and CSS, yes there may be some additional CSS that set links none, find attached.

My concern is that, if the links are set none in the CSS, none of the links must be clickable.

Why does the first two URLs different to the other URLs in the document for links behavior?

I really appreciate your quick replies in this matter, thanks again.

Regards,
Getti
  1. 25978_pdf_test_x1_custom_print.css218.9 kB
  2. NOID_printpdf.xhtml1.7 kB
mikeday
This is removing the links:
/* Remove Links for the Print PDF output ===== */
a[href] {
        prince-link: none;
        text-decoration: none;
        color: black;
}

If you want to keep the links, remove the line with "prince-link: none;" and put <a href="..."> around all the URLs.
jim_albright
Mike Day at
1. www.princexml.com
2.<a href='www.princexml.com'>Prince 2</a>
3.<a href='https://www.princexml.com'>Prince 3</a>

1 works: www.princexml.com does show as black text and does link in Firefox.
2 and 3 do not work. They show as blue text with no underline

CSS that I found were:

/* Links */

a[href] {
text-decoration: underline;
prince-link: attr(href)
}

Jim Albright
Wycliffe Bible Translators

mikeday
Please try the attached example document. Note that the broken link still works in some PDF viewers but may not be reliable in all.
  1. links.html0.2 kB
  2. links.pdf22.3 kB
jim_albright
a[href] {
prince-link:attr(href);
text-decoration: none ;
color: blue;
}
in my CSS fixed the problem

Jim Albright
Wycliffe Bible Translators