* pdf of tree diagram hyperlink not work in browser

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile. If your question fits in one of these subject-specific sub-forums, please ask it there.
Post Reply
User avatar
ississi
Diamond
Posts: 59
Joined: 15 Feb 2021 14:47
Family Historian: V7

pdf of tree diagram hyperlink not work in browser

Post by ississi » 10 Oct 2022 16:39

Hi,
I've created a pdf of a family tree diagram in FH 7, with the added hyperlink in each person's 'box' pointing to where their webpage will be in my website. This worked previously tested on my pc with a short url, but for many reasons the url is longer for where the pages will be on the internet.
So now the url is wrapped in the diagram. The wrapping happens at a '-' in the text of the url. This means, when I click on the url in the pdf it goes to the url

Code: Select all

sometext-
not

Code: Select all

sometext-moretext.hml
. Yes, I could ask the server administrator if he would kindly consider taking the hyphen out of the directory name, but I'd rather know how to get it to work properly for long urls in the pdf. Making the boxes wider is not ideal, as it's a tree of 154 people.

Just done some further testing, the same problem occurs even if I take the hyphen out, any text in the second line of the wrapped text isn't passed to the browser. So sometextmoretext.hml becomes sometextm

Just to add, the reason I put https:// in was to make the url more obvious to people viewing the document, as I couldn't see a way to change the style of the text, eg. to italic, to make it stand out as different to the rest of the text in the individual's box.

Any ideas anyone, please?

The Template for the FH pdf hyperlink in the tree diagram is (changed for obvious reasons):

Code: Select all

=Text("https://" . "websitename/tree-content/familyname/" . "ind" . RecordId() . ".html")
Many thanks for your help,
Isabel

User avatar
tatewise
Megastar
Posts: 27074
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: pdf of tree diagram hyperlink not work in browser

Post by tatewise » 10 Oct 2022 18:15

Isobel, I guess your URL concept is based on FHUG KB Family Tree Tips ~ Diagram Hyperlinks PDF.
If you can't shorten the URL then one option is to reduce the font size with a Font Change item just before the URL item.
I suggest you << Select Font: Arial Font style: Narrow Size: 6
If you need a point Size smaller than the values in the drop list then just type the digit into the box.

If the font is too small to read then you can have a plain text item just before the Font Change item to instruct the user to click the URL below.

PDF-URL.png
PDF-URL.png (11.56 KiB) Viewed 368 times
PDF-Items.png
PDF-Items.png (79.13 KiB) Viewed 368 times
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
ississi
Diamond
Posts: 59
Joined: 15 Feb 2021 14:47
Family Historian: V7

Re: pdf of tree diagram hyperlink not work in browser

Post by ississi » 11 Oct 2022 09:00

Thanks very much Mike, I'll give that a go. From what you've shown I could also probably make the link italic to help it stand out more too.

I'd wondered if there was a way to enter alternative text for a link, like in the html anchor tag. or a way of getting it to be treated as one phrase for the link, eg with double quotes around it. How does a text item in the Used Items get turned into a url in the pdf? I'm curious as to how this works under the hood. Especially as it seems to know that the first line (of a wrapped url) is part of a url, but thinks the second isn't, even though it's the second line that has the .html in it. Though from a bit of experimentation it seems like 'http'(s) or 'www' seem to trigger the pdf to include it as a url, but not '.html'.

But interestingly, it seems there's some trick with clicking on the pdf that gets it to follow the whole hyperlink. From clicking around it sometimes happens, but I can't replicate it reliably. Interacting somehow with the document seems to do it. Did it just now by highlighting a bit of the second line of the url. Which then turned on the full links wherever I clicked on them (viewing the doc in adobe acrobat reader). Or doubleclicking a few times on the second line sometimes does it. This is weird. And may not be replicated once the doc is on a website and not my pc.

User avatar
tatewise
Megastar
Posts: 27074
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: pdf of tree diagram hyperlink not work in browser

Post by tatewise » 11 Oct 2022 10:21

I am not aware of a method of formatting box text such that alternative text for a URL hyperlink can be specified.

It is a 'feature' of most PDF viewers that they automatically detect a URL text string and use it as an active hyperlink.

Yes, they allow the https:// prefix to be omitted from the URL and still recognise it. So that lets you shorten the URL.

Layout characters such as newline, space & tab are not valid within a URL, so they terminate the URL.
The second wrapped line is not a valid URL text string, so should be ignored.
Yes, it does seem possible to sometimes trick the PDF viewer into ignoring the layout characters but that is unreliable.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

Post Reply