Skip to main content
Inspiring
January 10, 2017
Answered

Trusted function throwing exceptions when called initially but work afterwards

  • January 10, 2017
  • 1 reply
  • 1469 views

Hi,

I have a working plugin that adds buttons to a toolbox, the issue I'm having is that when adding the buttons using the trusted functions e.g doc.addField, doc.addToolButton, it works but it keeps throwing exceptions and it looks as if it is affecting the application, the app crashes, the toolbox window is too small and I need to scroll instead of it fitting all the items. the error messages I get back are all from one call. The weird part that I am failing to understand is that these functions will work flawlessly on the second call but not on the first? instead I get the following exceptions being hit:

InitializeFormsTrackerJS is not defined

InitAnnot is not defined

SetRSSMethods is not defined

I am using Acrobat X Pro.

Thank you.

This topic has been closed for replies.
Correct answer jabulanim57049389

I've looked in the reference docs and I couldn't find anything that would explain why the first call breaks(still creates the button) and the second doesn't. I'll just have to go over them again and continue to debug. Thanks for your help.


Thanks for putting me on the right track, I was able to determine that the plugins config file (config.js) needed to be renamed and now all the objects are being initialized without any exceptions. Thanks.

1 reply

Bernd Alheit
Community Expert
Community Expert
January 10, 2017

What can you see when you execute following in the console:

for ( var i in this ) {

  console.println( i + " : " + ( typeof this) );

}

Inspiring
January 10, 2017

This is the output I get from the print.

app : object

global : object

console : object

util : object

search : object

catalog : object

identity : object

shareIdentity : object

SOAP : object

Net : object

RSS : object

Collab : object

AnnotsString : object

EScriptString : object

SOAPString : object

Preflight : object

PreflightResult : object

PreflightProfile : object

PreflightAuditTrail : object

tts : object

spell : object

FormsString : object

XMLData : object

FormWorkflow : object

security : object

dbg : object

event : object

aActiveDocs : object

aNewDoc : object

numpages : number

name : string

i : string

inUMSSession : string

edtFinish : object

fileString : undefined

appViewerType : undefined

btnOpenRubric : undefined

addCommentMarkIcon : undefined

addMarkIcon : undefined

addTickIcon : undefined

addCrossIcon : undefined

addCountIcon : undefined

addStampIcon : undefined

addDeselectIcon : undefined

addHalfTick : undefined

oo : undefined

The above is before I call one of the trusted functions I mentioned, the following is what I got after the initial call:

app : object

global : object

console : object

util : object

search : object

catalog : object

identity : object

shareIdentity : object

EScriptString : object

Preflight : object

PreflightResult : object

PreflightProfile : object

PreflightAuditTrail : object

tts : object

spell : object

FormsString : object

XMLData : object

FormWorkflow : object

security : object

dbg : object

aActiveDocs : object

aNewDoc : object

numpages : number

name : string

i : string

inUMSSession : string

edtFinish : object

fileString : string

appViewerType : string

btnOpenRubric : object

addCommentMarkIcon : object

addMarkIcon : object

addTickIcon : object

addCrossIcon : object

addCountIcon : object

addStampIcon : object

addDeselectIcon : object

addHalfTick : object

oo : undefined

Bernd Alheit
Community Expert
Community Expert
January 10, 2017

What can you see when you execute the code without the plugin?