Copy link to clipboard
Copied
I have a product catalogue that has hyperlinks applied to each product name so the respective webpage for the product will load if the product name is clicked when viewing the exported pdf.
Unfortunately the url's have a strange hidden character that isn't always visible - I have found "^p" sometimes when i copy and paste the url back and forth from notepad - so this may be the character I am looking for. But in acrobat pro when I go in the edit url menu there is a visible space that appears after the product number in the URL.
Does anyone know a script that I can run in either indesign or acrobat to search for the character in every single hyperlink in the document to remove the character, The document has several thousand hyperlinks so it's a very tedious job to do one by one.
1 Correct answer
Hey @Riannon368885617n15, can you try this script and see if it works? It's a stab in the dark, but it might do the trick.
- Mark
/**
* @file Clean Hyperlinks.js
*
* Attempts to strip bad characters from
* the active document's hyperlink URLs.
*
* @author m1b
* @version 2025-02-28
* @discussion https://community.adobe.com/t5/indesign-discussions/update-urls-to-remove-hidden-character-in-large-document-so-they-function-correctly/m-p/15180488
*/
function main() {
const illegalC
...
Copy link to clipboard
Copied
Yes that seems to be the problem—a carriage return in the URL. The encoded version you show from Acrobat has double-encoded the carriage return (the %250D). Normal (correct!) encoding is %0D, but if you encode that again the % is encoded as %25.
It is strange that the problem doesn't appear in the indesign one. I think the hyperlinks might be a bit messy.
Copy link to clipboard
Copied
I think I know what's the problem - all your bad Hyperlinks point to:
P:\Marketing Communications\Literature\Pricelists\New Zealand\2025\February\2_Domestic & Household_NZ.indd
Copy link to clipboard
Copied
Yes Robert, but it is only a sample document. On OP's machine they might be fine.


-
- 1
- 2