topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 3:05 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Open or launch hyperlinks from a pdf file  (Read 5001 times)

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Open or launch hyperlinks from a pdf file
« on: July 13, 2013, 05:00 PM »
Open or launch hyperlinks from a pdf file

Periodically I receive a pdf with links to web normatives (laws...).
Are normally 20 or less links
I would like a program to open all links in my firefox browser at the same time (one after another....)

How can I do this ?

Best Regards

Note : a code snack ?

« Last Edit: July 13, 2013, 05:07 PM by Contro »

Shades

  • Member
  • Joined in 2006
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: Open or launch hyperlinks from a pdf file
« Reply #1 on: July 13, 2013, 05:07 PM »
Most PDF readers can open hyperlinks by using the browser that you have set on your computer as default. Personally I use both FoxIt Reader and Adobe which do this, so I think it is safe to assume that the PDF reader of your choice will do the same.

No extra software required  :Thmbsup: (or I miss the point of the request).

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: Open or launch hyperlinks from a pdf file
« Reply #2 on: July 13, 2013, 05:08 PM »
 :-*

trying.
But I need to open all hyperlinks with a hotkey.....
In different tabs of my browser


Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: Open or launch hyperlinks from a pdf file
« Reply #3 on: July 14, 2013, 12:30 AM »
I can't
I have tried, but I don't see the way to open multiple url included in the pdf file.
 :-[

Shades

  • Member
  • Joined in 2006
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: Open or launch hyperlinks from a pdf file
« Reply #4 on: July 14, 2013, 10:40 AM »
In the Foxit reader (version 2.3) I use I have to click on each link with the mouse. I couldn't find any hot-key or setting for this, but my version of Foxit is old and newer version may have hot-keys configured for this.

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: Open or launch hyperlinks from a pdf file
« Reply #5 on: July 14, 2013, 01:55 PM »
I think he wants to open all of them at once rather than clicking on each.

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: Open or launch hyperlinks from a pdf file
« Reply #6 on: July 14, 2013, 06:38 PM »
I continue investigating.
Recently I got this :
1. Convert the pdf to a doc word document
2. Apply a function to extract all the url to a new doc file. a VB script for word 2010.
but for my God now I have lost the script. When refound I'll put here.
The answer is possible too with special software like pCOS and other (PDFlink ?).
I am trying to relocate all this and put the links....
 :-[


Note : At my present situation my problem may be solved because now i have the url addresses in a txt file. And with "my" script LinetoClip I parse the url to the browser opening all the tabs even with a temporal distance between the launchs.
With the url in a txt file is super easy with AHK to multi launch.....

Really my target now is the partial scanning of any folder to my goldmine database.
While scanning the folder the files are added to my database and linked in the link tab. I can do in two ways : creating multiple records or a single records with all the links.
But the partial scanning must control the files and take into consideration past actions. This is useful with the scanned files folder of the year I need to link several times each year, but only once each file inside.

 :-[


« Last Edit: July 14, 2013, 06:47 PM by Contro »

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: Open or launch hyperlinks from a pdf file
« Reply #7 on: July 14, 2013, 07:00 PM »
I have a text document with randomly spread URLs. Is there any solution to extract all the URLs under Word?
Solution

    Press Alt + F9 to display the fields
    Ctrl + F to open the search box
    Search: ^d hyperlink
    Check "Highlight all items found ..."
    Click on the Find All button
    Close the dialog
    Ctrl + C to copy everything that is highlighted
    Open a new document and paste.



Thanks to M@rina for this tip.


This may be another method i haven't try. I am keep trying to locate the script for VB editor I used. .....

 :(

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: Open or launch hyperlinks from a pdf file
« Reply #8 on: July 14, 2013, 07:04 PM »
Retrieving Hyperlinks from a Word Document

One of the…joys…of working at a place like Microsoft is that you get plenty of opportunities to brush up on your reading; hardly a day goes by without you being asked to read a white paper, a spec, a proposal, a draft chapter…. As you might expect, any time you read that many things you’re bound to encounter a clunker or two; in fact, there have been several occasions when we said to ourselves, “Well, the paper isn’t very good, but there sure are a lot of useful references scattered throughout it. If only there was a way to extract the hyperlinks and discard the rest of the document.”

But, unfortunately, there’s no way to – what’s that? You say that the Microsoft Word object model includes something called the Hyperlinks collection, a collection that contains all the hyperlinks found in the document? You say that we could write a script that extracts all these hyperlinks? You say that we could then take these hyperlinks and add them to our Internet Explorer Favorites or save them as an HTML page?

Wow. Wish we’d thought of that.

Turns out that you guys were right: we can write a script that extracts all the hyperlinks from a Word document. In fact, here’s a script that does that very thing:



Set objWord = CreateObject("Word.Application")
objWord.Visible = True

Set objDoc = objWord.Documents.Open("c:\scripts\test.doc")

Set colHyperlinks = objDoc.Hyperlinks

For Each objHyperlink in colHyperlinks
    Wscript.Echo objHyperlink.Address
    Wscript.Echo objHyperlink.TextToDisplay
Next



That’s right: on top of being very handy this script is amazingly simple as well. We begin by creating an instance of the Word.Application object, and then set the Visible property to True. (We do that just so you’ll see Word pop up on the screen and thus get some assurance that the script is hard at work.) When then use the Open method to open the document C:\Scripts\Test.doc.

The rest is easy. We use the Hyperlinks property to return a collection of all the hyperlinks found in the document; those hyperlinks get stashed in a variable named colHyperlinks. Next we set up a For Each loop and loop through all the hyperlinks in the collection; for each hyperlink we echo the value of two properties:

    Address, which is the URL of the hyperlink.

    TextToDisplay, which is the text you actually click on.

For example, suppose we had a link like this, a link that takes you to the Script Center home page (http://www.microsoft...tcenter/default.mspx):

Script Center

If this is the only hyperlink in Test.doc then our script returns output like this:



http://www.microsoft...tcenter/default.mspx
Script Center



Yes, very cool.

But you’re right: not as cool as it could be. It’s nice that we can echo back URLs in a command window or a message box; unfortunately, though, you can’t click a hyperlink in a command window and be transported to that Web page. (We tried.) What would really be cool would be the ability to add these URLs to our Internet Favorites folder or to an HTML document. And because the Scripting Guys and cool are practically synonymous (hey, we said practically), then let’s do something really cool and add these URLs to our Internet Favorites:



Set objWord = CreateObject("Word.Application")
objWord.Visible = True

Set objDoc = objWord.Documents.Open("c:\scripts\test.doc")

Set colHyperlinks = objDoc.Hyperlinks

For Each objHyperlink in colHyperlinks
    objHyperlink.AddToFavorites
Next



Hey, we said this was cool; we didn’t say it was hard. As you can see we pretty much used the same script as before; the only difference is that we didn’t echo back the properties of each hyperlink. Instead we simply called the AddToFavorites method and had Word add each hyperlink to our Internet Favorites. (Really: try it for yourself and see.) Notice that we don’t even have to pass the AddToFavorites method any parameters; it does all the work for us.

Of course, this also means that AddToFavorites won’t always do things exactly the way we’d like them to. For example, when testing this method we had the following hyperlink (linking to http://www.microsoft...s/qanda/default.mspx) in our document:

Hey, Scripting Guy!

When this was added to our Internet Favorites it looked like this:

Default.mspx (www.microsoft.com)

The link worked fine; it just had a different name than we expected.

Of course, you might not want every hyperlink automatically added to your Internet Favorites. But that’s OK; it’s very easy to create an HTML page that includes all these links. All you’d have to do then is open that particular page and start clicking links. For example, here’s a script that creates a file named C:\Scripts\Links.htm. The script then grabs all the hyperlinks from our Word document and uses HTML tagging to create a corresponding link in Links.htm:



Set objWord = CreateObject("Word.Application")
objWord.Visible = True

Set objDoc = objWord.Documents.Open("c:\scripts\test.doc")

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile("c:\scripts\links.htm")

Set colHyperlinks = objDoc.Hyperlinks
For Each objHyperlink in colHyperlinks
    objFile.WriteLine "<a href=" & chr(34) & objHyperlink.Address & Chr(34) & ">" & _
        objHyperlink.TextToDisplay & "</a href><br>"
Next

objFile.Close



We won’t talk about the HTML tagging today; that’s a bit outside the scope of this column. However, you can find more information in the HTML and DHTML Reference on MSDN. In the meantime, here’s what your finished product might look like:
Internet Explorer


Now that’s cool.
Top of page


this may be another answer i haven't tried. I keep tryng to locate the script i applied
 :-[

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: Open or launch hyperlinks from a pdf file
« Reply #9 on: July 14, 2013, 07:23 PM »
 ;D

Owwww , this was the function :

http://www.tek-tips.com/viewthread.cfm?qid=1689945

Function doHL() Dim nd As Document Dim a As Document Dim h As Hyperlink Dim r As Range Application.ScreenUpdating = False Set a = ActiveDocument Set nd = Documents.Add For Each h In a.Hyperlinks Set r = nd.Range r.Collapse r.InsertParagraph r.InsertAfter (h.Address) Next nd.Activate Application.ScreenUpdating = True Application.ScreenRefresh End Function