Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list
SOLVED

xfa.log.message(...) gone in ES2?

Avatar

Level 4
Level 4

Good day,

It would seem that the xfa.log object has been removed in LC Designer ES2. What alternative mean is there to write data to the log tab? (Javascript alerts is out of the question.)

1 Accepted Solution

Avatar

Correct answer by
Level 2

The xfa.log object is still around -- but it exists only when executing in the context of the server.  In acrobat if you check typeof xfa.log it will tell you "undefined".

Server-scripts will run in Designer under certain circumstances.  It depends on the kind of file you're saving:

- save-as XDP: no script will run.

- save-as static PDF: all scripts will run

- save-as dynamic PDF: only scripts marked to run-at server will execute (scripts marked runat "client and server" do not execute)

Some of this is explained at:

http://blogs.adobe.com/formfeed/2009/05/template_transformation.html

  John

View solution in original post

0 Replies

Avatar

Level 4
Level 4

( It would have been nice if the designer object were available when previewing the form. That way a developer could log 'live' messages using designer.println(). )

Avatar

Level 10

I see the commands in the object assist but I always get an accessor error when the command executes. Are you seeing the same behaviour?

You can also use the javascript command console.println("This is my message") to write a message to the javascript console.

paul

Avatar

Level 4
Level 4

Hello pguerett,

I just tried turning on the statement completion 'feature' (it's the mother of inpredictability - "Was it tab, space or return?"). I take it that's what you're refering to by 'object assist'. It does show there's a log object tucked in there.

I doubt however that is the case. This snippet tells me it doesn't even exist as an internal member of xfa:

xfa.log = function() {
  return {message: function() {return "overloaded";}}
}();

xfa.log.message();

(Doing the same for xfa.host.print() yields an entirely different result.)

Producing javascript alerts/console dumps won't do since the messages I'm producing is "for form designers only", in order for them to track the existence of certain "heritage objects" due for manual removal. There's no need to risk these messages slipping through to the production environment.

Avatar

Correct answer by
Level 2

The xfa.log object is still around -- but it exists only when executing in the context of the server.  In acrobat if you check typeof xfa.log it will tell you "undefined".

Server-scripts will run in Designer under certain circumstances.  It depends on the kind of file you're saving:

- save-as XDP: no script will run.

- save-as static PDF: all scripts will run

- save-as dynamic PDF: only scripts marked to run-at server will execute (scripts marked runat "client and server" do not execute)

Some of this is explained at:

http://blogs.adobe.com/formfeed/2009/05/template_transformation.html

  John