Seeing JavaScript Console output...

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

DSSavant
User
Posts: 216
Joined: Thu Jul 08, 2004 7:29 pm

Seeing JavaScript Console output...

Post by DSSavant »

Two items:

A) In the FullDemo as well in code, the Command ToggleJSConsole does not work properly. You can show the window once and only once:

In pseudo code:
DoVerb(null, "ExecuteCommand", "ToggleJSConsole"); // will show the window
DoVerb(null, "ExecuteCommand", "ToggleJSConsole"); // will hide
DoVerb(null, "ExecuteCommand", "ToggleJSConsole"); // will do nothing

My questions:
1) How can you determine if the console is showing or not?
2) Is there such a command as "ShowJSConsole"/"Show"?

B) Is there a way to capture the JS console output. For example, how do I capture the output from the JS script: 'console.println("Hello World.")'
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: Seeing JavaScript Console output...

Post by Vasyl - PDF-XChange »

Hi, DSSavant.

Code: Select all

DoVerb(null, "ExecuteCommand", "ToggleJSConsole"); // will show the window
DoVerb(null, "ExecuteCommand", "ToggleJSConsole"); // will hide
DoVerb(null, "ExecuteCommand", "ToggleJSConsole"); // will do nothing
It is issue really and will be fixed in the next build. Thanks.
1) How can you determine if the console is showing or not?
You may obtain actual visibility state by:

Code: Select all

GetProperty("View.Panes["JavaScript"].Visible", val, 0);
2) Is there such a command as "ShowJSConsole"/"Show"?
You may change the "View.Panes["JavaScript"].Visible" property directly, without UI-command sending:

Code: Select all

SetProperty("View.Panes["JavaScript"].Visible", "true", 0); // to show JS-Console
SetProperty("View.Panes["JavaScript"].Visible", "false", 0); // to hide JS-Console
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
DSSavant
User
Posts: 216
Joined: Thu Jul 08, 2004 7:29 pm

Re: Seeing JavaScript Console output...

Post by DSSavant »

Great thanks. This will work good. Piecing all the different ways to execute a command with the SDK is, at time, difficult. I have also found how to do it in JavaScript since my last post.
User avatar
John - Tracker Supp
Site Admin
Posts: 5223
Joined: Tue Jun 29, 2004 10:34 am

Re: Seeing JavaScript Console output...

Post by John - Tracker Supp »

Excellent - thanks :)
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com