2 Replies Latest reply on Nov 16, 2008 9:34 AM by gkaiseril

    Script/tool to Customized URLs

      I have an e-book in Adobe format. There are many URLs in the document to pointing to different websites. I need to distribute this file to others and let them customize the URLs to point to their own websites. However, they should do this by using a tool or a script (no by re-compiling the PDF file)

      Does anyone know a scrip or a tool, which can do the above task?
        • 1. Re: Script/tool to Customized URLs
          Thom Parker Adobe Community Professional
          The URLs on the PDF are really just ordinary text in the page content. Each of these probably has an invisible link or button object floating over top of it. The buttons and links provide the interactive functionality. Alternatively, Acrobat/Reader has the ability to recognize text that looks like an URL and provide a kind of pseudo-interactive link.

          Ok, to change the link you have to change two things, the page text and the interactive element. The interactive element is easy, it's something that can be changed from Acrobat JavaScript. But there's nothing you can do about page text from Acrobat JavaScript, it is what it is. You could write a plug-in that modifies the text, but then you have a flow problem for text that appears within a sentence or paragraph. You can't easily reflow text in a PDF. You know, PDF is supposed to be the final format, it's not designed for editing.

          The easiest solution, although not the cleanest, is to place a button with a white background and no border over all of the link areas, Place text on the button that is the exact color, font, and size as the page text. Now both the link text and the link destination can be programed from JavaScript. The only problem is with the size of the new text. If it's much larger than the original URL, the text might be cut off, if it's much smaller it might look funny.

          Thom Parker
          The source for PDF Scripting Info

          The Acrobat JavaScript Reference, Use it Early and Often
          • 2. Re: Script/tool to Customized URLs
            gkaiseril MVP & Adobe Community Professional
            Since you will have many diverse users and some may have Reader, you need to design your solution to the Reader product. Reader not not allow a lot of form modification or saving of modified forms. So you will need to provide your eBook as a form with "Extended Reader Rights" and that will require licensing from Adobe for a fee or paying a 3rd party provider to enable the rights. Because your target application is Reader, you can not modify links in Reader with JavaScript. So you will need to use the JavaScript to modify the form's fields for the links. This most likely would need to be a custom JavaScript within the form.