Skip to main content
subieguy2
Inspiring
February 12, 2018
Question

Floating Tool Panel

  • February 12, 2018
  • 1 reply
  • 427 views

I was wondering if it is possible to have a Javascript tool panel that will "float" and allow the user to still navigate the pdf? I am wanting this panel to only display on page 2 of my document. I would also love if it could collapse or minimize out of the way. Not sure if it is possible.

Any help or guidance would be much appreciated!

Here is an example of one of the buttons I would like to have on the floating panel.

var ocgSchematicArray = this.getOCGs(this.pageNum);

var getButtonName = this.getField("GROUND WIRES");

for ( var i=0; i < ocgSchematicArray.length; i++) {

if ( ocgSchematicArray.name == "Black (Ground)")

if (ocgSchematicArray.state == true){

ocgSchematicArray.state = false;

getButtonName.buttonSetCaption("GROUND ON");

}

else if (ocgSchematicArray.state == false){

ocgSchematicArray.state = true;

getButtonName.buttonSetCaption("GROUND OFF");

}

}

Also I would like to note that this will be delivered to a user online so folder level will not be accessible to me for security reasons.

I am using Acrobat XI Pro and Javascript on a Windows computer.

Thank you in advance!

This topic has been closed for replies.

1 reply

Thom Parker
Community Expert
Community Expert
February 12, 2018

By floating you mean you want to user to be able to move it?  The answer is Yes, but only if the PDF is viewed in Acrobat/Reader. No other PDF viewer will do this, and it won't work at all on Mobil. 

the "app.addToolButton()" function will create a floating toolbar. 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often