Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

open an attahced pdf on click of a part in 3d model

New Here ,
Jul 27, 2017 Jul 27, 2017

I want to open an attached pdf when i click on a part of 3d model.

when i try host.exportDataObject({ cName: "MindSphere_GettingStarted.pdf", nLaunch: 2 }); it throws an error

this is my complete code:

//start

var myMouseHandler = function( event ) {

if ( event.isMouseUp ) {

var myMesh = null;

if ( event.hits.length > 0 ) {

myMesh = event.hits[0].target;

}

if ( myMesh != null ) {

host.exportDataObject({ cName: "MindSphere_GettingStarted.pdf", nLaunch: 2 });

}

}

}

var mouseEventHandler = new MouseEventHandler();

mouseEventHandler.onMouseDown = false;

mouseEventHandler.onMouseMove = false;

mouseEventHandler.onMouseUp = true;

mouseEventHandler.onEvent = myMouseHandler;

runtime.addEventHandler( mouseEventHandler );

TOPICS
Acrobat SDK and JavaScript , Windows
401
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 27, 2017 Jul 27, 2017

What does the error message say?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 27, 2017 Jul 27, 2017

TypeError: Invalid argument type.

Doc.exportDataObject:0:Doc undefined:Exec

===> Parameter cName.Line: 20: Code: -36(0xffffffdc): Not implemented

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 27, 2017 Jul 27, 2017

Are you sure the name you specified is correct?

Open the file in Acrobat and execute this code from the JS-Console:

this.dataObjects

What is the output?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 27, 2017 Jul 27, 2017

When i try

this.exportDataObject({ cName: "MindSphere_GettingStarted.pdf", nLaunch: 2 }):

In console, pdf gets opened, but when i try in the script it doesnt work

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 27, 2017 Jul 27, 2017

Are you sure the "host" variable is referencing the Document object?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 27, 2017 Jul 27, 2017

looks like... i have given host.app.alert(host); and the result is in the snapshot

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 27, 2017 Jul 27, 2017
LATEST

Maybe there's some kind of undocumented restriction on executing this command from the 3D context... I'm not sure.

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