0 votes

We have some front and back matter which contains clickable hyperlinks / URLs to our website and facebook messenger as part of media to movements work. When I add these in PTXprint, the hyperlinks are stripped out and become unclickable. Is it possible to change the behaviour of PTXprint to allow such hyperlinks to be retained?

PTXprint is fantastic btw, thanks for all your hard work.

PTXprint by (104 points)

3 Answers

0 votes

We have similar. (These retain their live linking in the SAB app, BTW.)
Keeping these as hyperlinks is useful if/when the PDF is distributed as a PDF file rather than printed and distributed as a hardcopy.
I suppose a check box saying “Keep hyperlinks” or “Convert hyperlinks to bold text” or some such would be helpful for those who want to use the PDF in both applications (digital and print), so they might like the digital to have live hyperlinks and the print to NOT have the ugly underlining (depending on how they are formatted).

by (363 points)
reshown
+1 vote

I’m using the Sumatra PDF viewer and hyperlinks work fine for me - even though they don’t get formatter as blue-underlined links:
image

So perhaps this is PDF-browser dependent…

Or perhaps you mean that you want real hyperlinks to work, and not just making URLs clickable (as demonstrated above).

by (2.6k points)
reshown

Yes Sumara PDF viewer is smart and allows you to click on the URL, but its not embedded in the PDF as a hyperlink. I’m looking for an option @david_coward mentioned. My hyperlink display is actual an image rather than text anyway, which shouldn’t matter if the PDF output supports hyperlinks.

Sorry, maybe I wasn’t very clear.
I’m thinking that the user might want two types of end products, a digital form of the PDF for distribution on cellphones and tablets, etc. and a printed version. IFF the hyperlink is an overt link like a URL or some such, the user might prefer printed version to render the hyperlink without the blue text and underlying (just plain text like: http://www.mycoolsite.lookitup.org without the color).

Whereas the digital copy of the PDF might be nice to have it have live hyperlinks. (Much like in the last paragraph.)

This formatting choice might should be an option in PTXprint. (But maybe it kind of is already with the “color font” option.)

As to the original request, it sounds like it is a picture/image with a hyperlink embedded in/hidden under it. So that would be a different level of complexity I suspect. Sounds cool, and I could see the usefulness of such a capability.

(I was under the impression that PDFs had the ability to maintain real hyperlinks underneath, whereas what @andy_pi is saying, an app like Sumatra PDF sees the text string and recognizes it as a possible URL and offers to use it as a link. Is that what you are saying?)

@david_coward @mjpenny yes to your last paragraph - needs hyperlinks embedding, not just relying on PDF reader to recognise it as an URL and make it clickable.

0 votes

It seems that the USFM-3 markup for this is:

\w gracious|link-href="http://bibles.org/search/grace/eng-GNTD/all"\w*

Support for link-href as a special attribute class is not yet handled, but I’ve added an issue, so it may be addressed at some point. It is not as simple as declaring everything in that quote a URL, as not all contents in the link-href are web urls, so either your PDF viewer would need to not choke on “prj:RSV52” or something clever would have to happen in the TeX code.

I think that alternative styling for words based on the mere presence of an attribute is possible already, but I can’t verify that at the moment.

by (294 points)

Genuine URL links in the
link-href="http://some.where.org/"
attribute should now(1) be functioning correctly, as should in-document jumps specification that use link-href="#target" (1) and coming soon (2) also those like \xt verse 7|MAT 6:7\xt*

Notes:
1: Current version (1.9)
2: Code is up on github

Thank you, thats great!

Related questions

0 votes
2 answers
PTXprint Apr 10, 2023 asked by mnjames (1.8k points)
0 votes
2 answers
0 votes
4 answers
PTXprint Mar 27, 2022 asked by jeffh (1.3k points)
+1 vote
9 answers
PTXprint Jul 15, 2021 asked by john_nystrom (296 points)
0 votes
3 answers
Welcome to Support Bible, where you can ask questions and receive answers from other members of the community.
Give proper recognition to those widows who are really in need.
1 Timothy 5:3
2,606 questions
5,344 answers
5,034 comments
1,418 users