Formatting Hyperlinks for PDF Layout Export

1114
8
02-12-2021 07:48 AM
Labels (1)
KieranClark
Occasional Contributor

Hey folks, I'm having a bit of trouble figuring out how to format a clickable link in a map layout that is exported to PDF. I have a Dynamic Text field that is creating the link I need based on a base URL plus some text from a data field. The expression is as follows:

var RSSLink = 'https://subtelforum.com/?s=' + UrlEncode($feature.SystemName);
IIf($feature.SystemName != 'NULL', RSSLink, 'Not Available')

 This correctly returns the URL I would like to have. (example: https://subtelforum.com?s=GTT%20Express)

Further, setting the <url> tag before the dynamic element in the text properties makes this URL clickable on PDF export like so:

 DynTextUrl.png

 

So far so good!

However, what I would like to do is to change the display of this clickable URL to read something like "Click here to read more" instead of the text of the URL itself. Like so: Click here to read more 

0 Kudos
8 Replies
MatthewDriscoll
MVP Regular Contributor

Try this <url href="https://subtelforum.com?s=GTT%20Express">Click here to read more</url>

0 Kudos
KieranClark
Occasional Contributor

Hm, this didn't seem to work.

DynURLTest.png

 

I should have probably clarified, the reason I need the expression to pull the URL together in the first place is because this needs to be a dynamic element in a map series.

I have also figured out a simpler way to get the URL I need by changing my Dynamic Text expression to the following:

'https://subtelforum.com/?s=' + UrlEncode($feature.SystemName);

 

0 Kudos
MatthewDriscoll
MVP Regular Contributor

Just tested it and I am not having any luck either... 

0 Kudos
FeikeKramer2
New Contributor II

With this solution you'll see the full URL in the PDF, isn't it? 

Is it possible to hide the URL and show a label instead? Something like Matthew suggested? Has anyone a working solution for that?

I found that the URL is only clickable if the label is fully visible. It seems the PDF reader interpretes/recognizes the link and let the user navigate to that URL. ArcGIS Pro doesn't really support clickable links in its Layouts. Am I right?

0 Kudos
veredshasho
New Contributor

did you succeed putting clickable link in a layout? i am also trying and it doesn't seem to work. 

also, i don't see there is any <url> tag in dynamic texts

0 Kudos
FeikeKramer2
New Contributor II

No, I ended up with using a Python script and a 3rd party Python PDF library (pdfrw / pdf-annotate) to put all the links in the PDF. 

0 Kudos
DanielMyers
New Contributor II

my workaround for this was to set the text color to 'no color' (transparent) and place that element over a stylized text box. You can't see the text but they can still click it and the button looks like a hyperlink.

0 Kudos
stevebrooks1
New Contributor II

This is  something I have been pondering for some time. We produce a lot of reports that we need to refer to other reporting. I tried the <url> </url> and that worked for me. I also tried the <url href=""></url> version as well with limited success. The latter version would work once with subsequent tries reducing the text box to nothing. The problem I am finding now is if my text is edited, for example in Adobe, then the link box is not in the correct place or deleted. I have not found the dynamic text bit mentioned above. It would be a good idea if we could have the ability to insert a link, similar to what we have in this text box or in storymaps, for example.

0 Kudos