1

I am attempting to add text labels in the composer that will result in clickable relative hyperlinks in the PDF output.

Adding a text label, ticking "Render as HTML" and adding www.google.com results in a clickable hyperlink from the PDF to Google. However, i'm struggling to generate a clickable relative hyperlink in the PDF. I'm aware the format of a relative path needs to use \ rather than /. Ive even attempted to wrap it in the following HTML code: Link but does not help.

How do I create a clickable relative hyperlink in the PDF output please?

Two related questions are: Clickable HTML link in QGIS print composer pdf export?

Creating Mapbook with Hyperlink texts in PDF using QGIS Atlas?

Ive tried this in QGIS 3.0.3

0

You should to use variable @project_folder in expresion for action.

Type=Python

Action text=

from PyQt4.QtCore import QUrl;
from PyQt4.QtWebKit import QWebView;

myWV = QWebView(None);
myWV.load(QUrl("file:///[% @project_folder || '/' || "link" %]"));
myWV.show()

enter image description here

  • I'm unsure how adding this action will result in a composer text label that is a clickable relative hyperlink in the PDF output. However, I'm intrigued by your answer. Am I right in thinking that a layer feature could be a clickable hyperlink in the PDF output? This would actually be my preferred method but I didn't this this was possible. – ASHHart Jul 2 '18 at 18:44
  • Ups, sorry, now i read slowly your question and i see that I been confused. – Carlos López Quintanilla Jul 2 '18 at 21:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.