I'm using QGIS 2.8.1 Atlas and creating a mapbook using a grid layer that has an attribute with a URL in it.
I want to use the URL in the attribute to be a hyperlink in the PDF once its published.
Is there just an expression I can use to do this?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
In QGIS 3 (and possibly in your version) you can add an HTML box (Top menu: Add Item > Add HTML) where you can add a hyperlink. If your grid layer is being used as a coverage layer, adding the URL should be simple: you can use the expression [% "name-of-your-url-attribute" %] to pull in the link.
In your HTML Frame properties window, your code would look something like this:
<a href="[% "name-of-your-url-attribute" %]">[% "link-title" %]</a>
Unfortunately, QGIS doesn't seem to handle exporting hyperlinks in PDF for now. So even if you manage to create those links in the layout, the link will not be active.
Related question: Clickable HTML link in QGIS print composer pdf export?
EDIT: Here's a Python code snippet for creating a PDF mapbook from QGIS Atlas images by adding links to neighbor tiles on each page.
I used this script to add links to images generated from a QGIS atlas and read them on my e-reader as a PDF. It works just fine!