Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

does any body know how to link to a bookmark or tag in .PDF ??

Status
Not open for further replies.

jackal63

MIS
May 22, 2001
67
CA
This has actually become critical to me now, to make Adobe work for my application. What's the file referance that you include in a link to open a .pdf at a specific point, either marked by a bookmark or tag or whatever.

Any help would be appreciated.
 
You cannot link directly to a PDF bookmark. You can, however, link from HTML to a named destination in a PDF file. Create the named destinations in Acrobat. It can be done in the original application by using pdfmark commands, but I've done that only in FrameMaker. In your HTML link, the format is like so: ../path/book.pdf#nameddestination

You can also do it like this: ../path/book.pdf#page3 (I have not used page numbers, so I'm less sure of this method.)

When you go to the Acrobat Guide for help, search for "named destination" in the index of Acrobat 4.x; in Acrobat 5.x, search for "destination." The link format provided in one or both versions is incorrect--use the format I provided. ~~~~~~~~~~
FrameGirl
~~~~~~~~~~
 
Ok, if you CAN link directly to the named link in the PDF from an HTML file, you should be able to use the same method of opening any other URL from within your program... ShellExecute.

In VFP (VB is similar) just do this:

Code:
* Call ShellExecute with the PDF named reference:
Res=ShellExecute("../path/book.pdf#nameddestination", "", "OPEN","")

************************************************************************
* WinApi :: ShellExecute*********************************
***    Author: Rick Strahl, West Wind Technologies
***            [URL unfurl="true"]http://www.west-wind.com/[/URL]
***  Function: Opens a file in the application that it's
***            associated with.
***      Pass: lcFileName  -  Name of the file to open
***            lcWorkDir   -  Working directory
***            lcOperation -  "Open" "Run" "Play" "Edit" etc...
***    Return: 2  - Bad Association (invalid URL)
***            31 - No application association
***            29 - Failure to load application
***            30 - Application is busy***
***            Values over 32 indicate success
***            and return an instance handle for
***            the application started (the browser)
************************************************************************
FUNCTION ShellExec
LPARAMETERS lcFileName, lcWorkDir, lcOperation, pcParameters
LOCAL pp, lcParam
pp = pCount()          && LAS v9b1w  wgcs
if pp>3                    && LAS v9b1w  wgcs
  lcParam = pcParameters   && LAS v9b1w  wgcs
else                       && LAS v9b1w  wgcs
  lcParam = ''
endif
lcWorkDir=IIF(type("lcWorkDir")="C",lcWorkDir,"")
lcOperation=IIF(type("lcOperation")="C",lcOperation,"Open")
DECLARE INTEGER ShellExecute ;    
    IN SHELL32.DLL ;    
    INTEGER nWinHandle,;
    STRING cOperation,;    
    STRING cFileName,;    
    STRING cParameters,;
    STRING cDirectory,;    
    INTEGER nShowWindow
RETURN ShellExecute(0,lcOperation,lcFilename,lcParam,lcWorkDir,1)
*ENDFUNC  ShellExecute
 
Create your bookmarks in a word doc, make sure your distiller is checked to save all bookmarks, create your pdf, now you can link from the bookmark to your destination or create a link from bookmark to using "open file" to set the path to your pdf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top