Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Update urls to remove hidden character in large document so they function correctly

Community Beginner ,
Feb 26, 2025 Feb 26, 2025

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.

TOPICS
How to , Scripting

Views

606
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 27, 2025 Feb 27, 2025

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
...

Votes

Translate
Community Expert ,
Feb 27, 2025 Feb 27, 2025

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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 27, 2025 Feb 27, 2025

Copy link to clipboard

Copied

@Riannon368885617n15 

 

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

 

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 27, 2025 Feb 27, 2025

Copy link to clipboard

Copied

Yes Robert, but it is only a sample document. On OP's machine they might be fine.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines