setNamedDest does not work for AxAcroPDFLib.AxAcroPDF

Community Beginner ,
Jul 23, 2018

Copy link to clipboard

Copied

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>

Adobe Community Professional
Correct answer by BarlaeDC | Adobe Community Professional

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

TOPICS
Acrobat SDK and JavaScript

Views

379

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

setNamedDest does not work for AxAcroPDFLib.AxAcroPDF

Community Beginner ,
Jul 23, 2018

Copy link to clipboard

Copied

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>

Adobe Community Professional
Correct answer by BarlaeDC | Adobe Community Professional

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

TOPICS
Acrobat SDK and JavaScript

Views

380

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jul 23, 2018 0
Adobe Community Professional ,
Jul 23, 2018

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 23, 2018 0
MD3D LATEST
Community Beginner ,
Jul 23, 2018

Copy link to clipboard

Copied

It works now, Thanks a lot Malcolm.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 23, 2018 0