[Qgis-user] Possibility for Labels as Hyperlinks in PDF Output?

Mike Treglia mtreglia at gmail.com
Mon Sep 11 11:57:36 PDT 2023


Thanks, Keith, for pointing me to that documentation.

That's really helpful. I guess I had gotten confused with some
functionality with web-map exports in  QGIS2Web - leaflet maps - in that
form, a field with an html-formatted hyperlink would function as a
hyperlink (though a hyperlink label still just seems to be formatted as a
link, but not function as one.)

I also see that in the Print Composer, manually using the "Add Label"
functionality enables one to include html-formatted hyperlinks, which
function in exported PDFs (when "render as html" is checked in the label
properties in the print composer).  So, it looks like there is almost the
functionality I'm looking for, but not quite.  If there's a way to place
labels from a map layer in a print composer in the right spots, that could
potentially work, but that seems challenging - I can't wrap my brain around
how that would functionally even work.

Welcome any other ideas folks have, or how others have worked through
this.  It seems like the alternative options to doing this fully in QGIS
would involve exporting the PDF and working in PDF-editing software to
incorporate the links.

Best,
Mike



On Mon, Sep 11, 2023 at 11:10 AM Keith Jenkins <kgjenkins at gmail.com> wrote:

> I don't think the label "HTML formatting" currently supports links.
> The supported HTML is just a subset of HTML, mainly focused on visual
> styles:
>
> """
> The HTML formatting option enables the proper rendering of some HTML
> tags to customize the label. The supported HTML tags are:
>
> * Color, applicable to text, underline, strikethrough, and overline
> * Font properties (font family, font size, bold and italic)
> * Superscript and subscript components in text
> """
>
> https://docs.qgis.org/testing/en/docs/user_manual/style_library/label_settings.html#text-tab
>
> Keith
>
> On Mon, Sep 11, 2023 at 9:28 AM Mike Treglia via QGIS-User
> <qgis-user at lists.osgeo.org> wrote:
> >
> > Hi all,
> >
> > Working on a project where the desired output is PDF map, where the
> labels are hyperlinks. From searching around, it seems like there are, at
> least historically, some challenges related to this functionality and Qt,
> which might still be present?
> >
> > I'm finding that in the Print Composer in QGIS, I can add a label that
> functions as a hyperlink in an exported PDF (using the "render as HTML"
> functionality"), but labels associated with a layer, placed in the main map
> window, do not function as hyperlinks when exported as a PDF.
> >
> > Thus, wanted to check if maybe either I'm missing something - like this
> is/should be possible, or if not directly, maybe there's an efficient
> work-around?  I'm working in QGIS 3.32-2 most immediately for testing this,
> on Windows.
> >
> > Thanks, all, for any insights!
> > Mike
> >
> >
> > _______________________________________________
> > QGIS-User mailing list
> > QGIS-User at lists.osgeo.org
> > List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20230911/88a6c2e3/attachment.htm>


More information about the QGIS-User mailing list