5 Replies Latest reply on Jan 9, 2014 7:31 AM by dkgraft

    How to code URL Links to a pdf on my computer

    kratistoss

      Hi!

       

      Im prepping a presentation/website where i need to link a pdf file (on my computer) to a small text i have on the stage.

      I tried with some variations in the code (wether with the .pdf extension or not, removing underscores in name), but it simply will not react in any way.

      When i prep the code for linking to a website...i have no problem, it works perfectly.

       

      Please tell me this isnt a limit in Edge....i have put so much work on this project, and i need to link those .pdf's

       

      thanks in advance for your time and help

       

      Krati

        • 1. Re: How to code URL Links to a pdf on my computer
          TimJaramillo Level 4

          Hi there,

           

          3 questions:

          1. to clarify- you have a text link, and on click of that link you want to show a pdf in the same/new window, yea?

          2. is the pdf file in the same directory as your Edge files, or nested deeply somewhere else on your hard drive?

          3. are you on a mac or PC?

          1 person found this helpful
          • 2. Re: How to code URL Links to a pdf on my computer
            jbowden Adobe Employee

            Hey there,

             

            It's a browser limitation for JavaScript to open your file if your HTML is hosted online - opening local files via JavaScript is considered a security risk and is not allowed.

             

            However, if you're loading your HTML locally, you should be able to open a PDF locally. Here's some code I just tested that works (you must save your project, and then open the HTML file from the Finder/Explorer level):

             

            window.open("/users/username/desktop/myfile.pdf");

             

            But as I mentioned, if you host your HTML and required files (or if you try to Preview in Browser from Edge Animate), then this code will not work due to built-in browser security. If you intend to host your HTML online, then your PDF files would have to be online as well.

             

            hth,

            Joe

            1 person found this helpful
            • 3. Re: How to code URL Links to a pdf on my computer
              kratistoss Level 1

              Thank you for the fast reply.....

               

              I managed to confirm most of what you said Joe. I am now running the .pdf's from the same folder the actual edge file is in, and works fine, even if prompted from edge with cntrl+enter.

               

               

              Thank you both for the info and tips

              It is very appreciated

               

              And a special thanks to jaramillo for having helped a second time in my learning of Edge

              • 4. Re: How to code URL Links to a pdf on my computer
                TimJaramillo Level 4

                I'm glad to be of help!

                • 5. Re: How to code URL Links to a pdf on my computer
                  dkgraft Level 1

                  I just ran into a similar issue but thought I would share. I'm building an edge project for use in a DPS app. I wanted to have buttons that open PDFs in the in-app browser. So here is what I did.

                   

                  create a pdf folder in the folder with your edge file.

                   

                  place all of your pdfs in this folder.

                   

                  then, in animate, code the button "click" event with the following.

                   

                  window.open("pdf/file_name.pdf","_blank");

                   

                  Hope this helps.

                   

                  - Dylan