8

I need to export a (GEO)PDF - overview map with bounding boxes - with clickable links in every bounding box.

I tried to simply export a PDF with html-links as text labels, but as you can see in the screenshot of my PDF below, the HTML syntax is not interpreted as linkenter image description here

I also tried simple links like: <a href>www.qgis.org</a>

This solution works on clickable text field links (rendered as HTML) but does not match my needs: Exporting PDF from QGIS Print Layout including clickable hyperlinks

Even this post is not helping me: Clickable HTML link in QGIS print composer pdf export?

4
  • 2
    You have text-labels overlayed over your map? Than you have to check the box "render as html" to make the html-tags disappear an only show the link - this seems not to be the case in your screenshot. However, as stated in the posts linked by you in the moment it seems to be possible to create only links of the actual URL, not of any other text. Workaround: create another text label containing the URL formatted as link, see the last comment here: gis.stackexchange.com/questions/354249/…
    – Babel
    Commented May 13, 2020 at 10:07
  • A text field rendered as HTML is not what im looking for. I need a link für every single rectangle in my map.
    – MartinMap
    Commented May 18, 2020 at 9:52
  • 1
    have you already perhaps just tried to insert the actual link as a text and not as html? like only http://URL.com/7025 just to see how it works?
    – umbe1987
    Commented May 20, 2020 at 10:16
  • @MAP Does this pdf fit your needs? drive.google.com/open?id=1YvLNlTfL2bQyLp6uRNQYgjxKfhB1RfkH Commented May 20, 2020 at 12:09

2 Answers 2

5
+25

This method is software dependent and may not work with some PDF readers.

Tested with Acrobat Reader DC (OS: Windows 10).

To create a PDF file with clickable links inside polygons, just save the links as text in text field and create labels using this field.

You must also set the option Always export text as text objects when exporting to PDF. Here is an example pdf. If you use acrobat reader to view PDF - hold Ctrl button when click on the text.

Also you can change the label formatting if you want it to looks like a real URL (blue and underlined).

enter image description here

8
  • @MAP Answer updated Commented May 20, 2020 at 12:20
  • I believe the question is asking for a solution to create text links using arbitrary text, such as this, rather than just printing the URL like https://stackexchange.com
    – Jake
    Commented May 20, 2020 at 12:49
  • @Jake The example PDF file the contains clickable text. So it is a link. Also you can change the text formatting if you want it to looks like a real URL (blue and underlined). Probably the author of the question should clarify what specific result he wants to get. Commented May 20, 2020 at 13:12
  • I did like you explained: but the links are still not clickable. Could you provide some screenshots?
    – MartinMap
    Commented May 25, 2020 at 7:36
  • 1
    When I understand it correctly this solution is just that some PDF "Readers" (like Acrobat Reader DC and in my case Chrome Internet Browser) interprets texts matching a pattern (like "http://" or "www") as links. Other readers don't because it's not coded as a hyperlink in the PDF.
    – signedav
    Commented Oct 27, 2021 at 11:23
4

Unfortunately , there is a known problem associated with the task you are trying to realise and the QGIS development team is working on it.

For now, the issue is considered " a won't fix " because of how the underlying libraries (QT) export data to GeoPDF.

You can read and follow the issues on QGIS Github at these two addresses:

Issue 35172

Issue 29888

1
  • To sum: it's fixed now - but you can't use the HTML element option. You need to use a label option and then render as HTML.
    – Mike D
    Commented 7 hours ago

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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