These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

How do I link to a picture in a pdf using hyperlink() in Excel 2003

Frank Pytel
Registered: Jan 12 2009
Posts: 10

Hello;

I understand how to use the hyperlink() function within Excel. I would like to open a pdf using the function.

What I need to do is go directly to a particular graphic within a PDF document. The hyperlink function is dynamic such that it opens a file based on a connection type chosen. This works fine with .bmp and .jpeg. I want to combine all of the graphics within a single file and include descriptions with the graphics.

I know in Word I can add a bookmark and from Excel I know how to link to this. I know as well this can be done in HTML using the anchor tag.

My question is can I directly link to a bookmark and what might that link look like in Excel?

Thank you for your time. Have a Great Day.

Frank Pytel

My Product Information:
Acrobat Pro 8.0, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Acrobat/Reader has a number of options that can be used in a link to navigate to a particular location within the PDF. It's all document in the "Open Parameters" reference.

http://www.adobe.com/devnet/acrobat/pdfs/PDFOpenParameters.pdf

You might want to consider creating a "Named Destination" for the image in the PDF, then using this destination in the URL.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

Frank Pytel
Registered: Jan 12 2009
Posts: 10
Thomp;

Thank you for replying so rapidly. I sincerely appreciate it. I see that these open paramters work fine in an html/internet environment.

My situation is unique from that environment. The hyperlink function within Excel 2003 will open the document. But the open parameters will absolutely not open the file to a bookmark or a page.

Example.

c:\my docs\blah\blah\test.pdf will open the file.
c:\my docs\blah\blah\test.pdf#axf will open the file, but not the bookmark "axf".
c:\my docs\blah\blah\test.pdf#nameddest=axf will open the file, but not the bookmark "axf". ( I am also unclear how to create a nameddest within a pdf file. Can anyone please explain this using Acrobat pro 8.0)
c:\my docs\blah\blah\test.pdf#page=2 will open the file, but not to page 2.

Is this an Excel issue? Does anyone know if Excel supports the naming conventions that acrobat is using to bookmark/nameddest there files?

Again, I sincerely appreciate your help and the help of anyone else that can explain this to me.

God Bless and Have a Great Day.

Frank Pytel
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Hmm, it's possible that the open parameters are being removed, or at least not honored at some stage of the process.

But it's also possible that it's not working because these are local files. I also seem to remember that a linked PDF will only use the open parameters when it's opened in the browser. You didn't say where the PDF was being opened.

So here's an alternative idea. And this is one that's covered, with code, in the document navigation section at www.pdfscriping.com. You can go there for more information.

But here's the idea:

1. In the link, place some parameters using the regular URL query string syntax

EX: http://www.windjack.com/mypdf.pdf?page=3

2. Add a page open script to the first page in the target PDF to parse out the query string data and use it for navigation.
var oURL = util.crackURL(this.URL);var pgNum = oURL.cQuery.split("=").pop();this.pageNum = (pgNum-1);

This setup can be used to pass just about any information into the PDF from an URL. It's just a matter of parsing the URL query string.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script