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

3D Javascript & app.openDoc

radiofreemike
Registered: Nov 14 2007
Posts: 3

This is probably an extremely basic question. I have authored a simple
3D PDF that has a single 3D Annotation in it. My goal was that when a
mesh was selected in the 3D area, the corresponding PDF (already
existing) for that object would be opened. I assumed I could use
app.openDoc(), but the debugger is complaining that "app is
undefined". How can Acrobat not know what app is? What am I
misunderstanding?

Thanks,
Mike

var myMouseHandlingFunction = function( event )
{
if ( event.isMouseUp )
{
var clickedMesh = null;
if(event.hits.length > 0)
clickedMesh = event.hits[0].target;

if(clickedMesh != null)
{
var meshPDFName = "c/temp/" + clickedMesh.name + ".pdf"
var meshDoc = app.openDoc(meshPDFName);
}
}
}

var mouseEventHandler = new MouseEventHandler();
mouseEventHandler.onMouseDown = false;
mouseEventHandler.onMouseMove = false;
mouseEventHandler.onMouseUp = true;

mouseEventHandler.onEvent = myMouseHandlingFunction;
runtime.addEventHandler( mouseEventHandler );

radiofreemike
Registered: Nov 14 2007
Posts: 3
I figured it out . . . I need to prepend the app.openDoc with host, making the call host.app.openDoc("filename.pdf");