Skip to main content
MD3D
Known Participant
July 23, 2018
Answered

setNamedDest does not work for AxAcroPDFLib.AxAcroPDF

  • July 23, 2018
  • 1 reply
  • 1352 views

Dear master:

I created one HTML page based on the sample of AcroPDFInHTML, with small modification. Seems the function of setNamedDest does not work here.

below is the code used in my html page. I set one bookmark named "N2" in my pdf file. The function setZoom(50) works fine in this page, but it does not go to the bookmark "N2". Is there anything missing in my code? or the function has been removed from the interface? I installed the  adobe acrobat reader DC.

Thanks in advance.

<html>

<head>

<title></title>

<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">

<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">

<script id="clientEventHandlersJS" language="javascript">

<!--

function Button1_onclick() {

//set the URL ...

Object1.src = Text1.value;

                Object1.setZoom(50);

                Object1.setNamedDest("N2");

}

//-->

</script>

</head>

<body>

<P>This is a simple example of using the PDF control embedded in an HTML

page. we also demonstrate how to use the automation API on the control from

client-side javascript.</P>

<P>URL:  <INPUT id="Text1" style="WIDTH: 568px; HEIGHT: 22px" type="text" size="89" name="Text1"

value="d:/test1.pdf"><INPUT id="Button1" type="button" value="Go" name="Button1" language="javascript" onclick="return Button1_onclick()">                         </P>

<P> </P>

<OBJECT id="Object1" style="WIDTH: 784px; HEIGHT: 592px" classid="clsid:CA8A9780-280D-11CF-A24D-444553540000"

VIEWASTEXT>

<PARAM NAME="_cx" VALUE="26035">

<PARAM NAME="_cy" VALUE="15663">

</OBJECT>

</body>

</html>

This topic has been closed for replies.
Correct answer BarlaeDC

HI,

The setNamedDest function takes the name of a "Named Destination" not a bookmark, you can see what named destinations you have your document and then use that in your code.

To see your destinations do the following

View-> Show/Hide - > Navigation Panes -> Destinations

If you want to create a named destination that matches your bookmark, navigate using the bookmark, and then change panels and click a new destination at that point in the document.

Hope this helps

Malcolm

1 reply

BarlaeDC
Community Expert
BarlaeDCCommunity ExpertCorrect answer
Community Expert
July 23, 2018

HI,

The setNamedDest function takes the name of a "Named Destination" not a bookmark, you can see what named destinations you have your document and then use that in your code.

To see your destinations do the following

View-> Show/Hide - > Navigation Panes -> Destinations

If you want to create a named destination that matches your bookmark, navigate using the bookmark, and then change panels and click a new destination at that point in the document.

Hope this helps

Malcolm

MD3D
MD3DAuthor
Known Participant
July 23, 2018

It works now, Thanks a lot Malcolm.