Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Apple's Preview doesn't handle links right in PDFs

Hi!


Recently, we've painfully discovered, that apple's Preview that's shipped with our Catalina, Version 11.0 (999.4) is not handling URL links right in the PDF. Namely urls with fragments in them (https://example.com/url#fragment) are rendered with the pound-sign/hashmark is url-encoded (https://example.com/url%23fragment which is obviously incorrect, and browsers won't re-encode it, so any urls that'd deeplink or depend on the # character are now screwed.

We worked around the issue with using URL shortener websites, not to contain the pound-sign in the embedded link, but you can imagine how a generation of users will open PDFs all around the world and find corrupt urls in them.


We tested this on earlier mac versions, with Preview v10.1 and the links work fine.

Tested with different characters (?, &, =) and it's only the # character that gets encoded to %23.


Thanks!

Alex

Posted on Jan 15, 2020 2:34 AM

Reply
Question marked as Best reply

Posted on Jan 15, 2020 6:34 AM


On Catalina 10.15.2, Adobe Acrobat Reader DC v2019.021.20061, on mouse-over, displays the hashtag link without percent encoding, and clicking the link works as expected.


The actual URI is stored correctly within the PDF with the '#' shown unencoded. It is the mouse over of the link displayed by Preview that shows the percent encoded URI, and it is that percent encoded URI that Preview interprets literally and fatally links too — not the actual URI stored in the PDF that it should be using.


See for yourself in the Terminal:


egrep -aC2 "\(http." /path/to/hashtag.pdf


5 replies
Question marked as Best reply

Jan 15, 2020 6:34 AM in response to alex_on_the_web


On Catalina 10.15.2, Adobe Acrobat Reader DC v2019.021.20061, on mouse-over, displays the hashtag link without percent encoding, and clicking the link works as expected.


The actual URI is stored correctly within the PDF with the '#' shown unencoded. It is the mouse over of the link displayed by Preview that shows the percent encoded URI, and it is that percent encoded URI that Preview interprets literally and fatally links too — not the actual URI stored in the PDF that it should be using.


See for yourself in the Terminal:


egrep -aC2 "\(http." /path/to/hashtag.pdf


Apple's Preview doesn't handle links right in PDFs

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.