Application hangs up in case of multiple RunJavaScript calls

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

vzgherea
User
Posts: 23
Joined: Mon Sep 09, 2013 8:38 am

Application hangs up in case of multiple RunJavaScript calls

Post by vzgherea »

From time to time our application hangs up. We suspect this is caused by multiple calls of RunJavaScript while importing annotations.

In order to ensure this JavaScript project from API samples has been modified to execute script for 10 times instead of 1 time when 'Run' button is clicked. As a script we provide the following:
this.importAnXFDF('annotations.xfdf'); //file with annotations, about 600kb size, pdf file - about 1.5mb size with 300 pages

A click, or several clicks one by one, or double click, or several double clicks on 'Run' makes application to hang.

Investigations shown that this happens only on the 32bit system, on 64bit this can not be reproduced!


Any thoughts on how to get rid of this problem?
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2445
Joined: Thu Jun 30, 2005 4:11 pm

Re: Application hangs up in case of multiple RunJavaScript c

Post by Vasyl - PDF-XChange »

Try to use the following special flag for RunJavaScript():

string js = this.importAnXFDF('annotations.xfdf');
pdfViewer.RunJavaScript(js, null, 0, PXCVA_Sync);

If this does not help then please give us the file to reproduce the problem.

HTH
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.
vzgherea
User
Posts: 23
Joined: Mon Sep 09, 2013 8:38 am

Re: Application hangs up in case of multiple RunJavaScript c

Post by vzgherea »

Hello,

PXCVA_Sync flag doesn't help. Please find attached a modified API sample project.
Run it on a 32bit machine and just click 'Run' button. For me this hangs application.
You do not have the required permissions to view the files attached to this post.
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2445
Joined: Thu Jun 30, 2005 4:11 pm

Re: Application hangs up in case of multiple RunJavaScript c

Post by Vasyl - PDF-XChange »

Thanks for your sample project. I tried to reproduce problem on x86/x64 platforms but couldn't on both. :?
If you have any details which can help us to reproduce it - we would be happy to help further.
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.
vzgherea
User
Posts: 23
Joined: Mon Sep 09, 2013 8:38 am

Re: Application hangs up in case of multiple RunJavaScript c

Post by vzgherea »

I am testing on a machine with Windows 7 Enterprise, SP1. System is clean, no VS is installed, only .net framework is installed in order to be able to run application.

On other machines with the similar config problem can be easily reproduced.
vzgherea
User
Posts: 23
Joined: Mon Sep 09, 2013 8:38 am

Re: Application hangs up in case of multiple RunJavaScript c

Post by vzgherea »

Is there any news on our issue? What info exactly do you expect from us?
We are able to reproduce this issue on multiple 32bit machines.
On some application hangs immediately, on other it hangs after clicking several times on 'Run' button.
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2445
Joined: Thu Jun 30, 2005 4:11 pm

Re: Application hangs up in case of multiple RunJavaScript c

Post by Vasyl - PDF-XChange »

When application is hanged - please look to the task manager 'Processes' tab - its there any process that using the CPU hardly? What is CPU using for JavaScript.exe and PDFXCview.exe ?
Thanks
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.
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2445
Joined: Thu Jun 30, 2005 4:11 pm

Re: Application hangs up in case of multiple RunJavaScript c

Post by Vasyl - PDF-XChange »

Good news for you. We reproduced the issue and found the reason of it. It will be fixed in next build, please wait..
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.
vzgherea
User
Posts: 23
Joined: Mon Sep 09, 2013 8:38 am

Re: Application hangs up in case of multiple RunJavaScript c

Post by vzgherea »

This is great! When could we expect for a new build?
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19869
Joined: Mon Jan 12, 2009 8:07 am

Re: Application hangs up in case of multiple RunJavaScript c

Post by Stefan - PDF-XChange »

Hi vzgherea,

No particular release date has been set yet, but we will try to make it as soon as possible! :)

Regards,
Stefan
costea
User
Posts: 14
Joined: Mon Sep 09, 2013 6:51 am

Re: Application hangs up in case of multiple RunJavaScript c

Post by costea »

Hi Stefan,

Tell me please if the issue was fixed in latest releases.

Thank you,
Costea
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19869
Joined: Mon Jan 12, 2009 8:07 am

Re: Application hangs up in case of multiple RunJavaScript c

Post by Stefan - PDF-XChange »

Hi Costea,

Build 214 of the Viewer (and the SDK) was updated yesterday, so can you please try to download that and see if the problem is resolved?
https://www.pdf-xchange.com/product/downloads/sdk

Regards,
Stefan
costea
User
Posts: 14
Joined: Mon Sep 09, 2013 6:51 am

Re: Application hangs up in case of multiple RunJavaScript c

Post by costea »

Hi Stefan,

I have installed the latest build SDK but the problem still persists.

Regards,
Costea
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2445
Joined: Thu Jun 30, 2005 4:11 pm

Re: Application hangs up in case of multiple RunJavaScript c

Post by Vasyl - PDF-XChange »

Hi, Costea.

The latest build have some minor fixes only without many previously promised fixes. The reason of it - currently we very heavily focused on getting the Editor as up to speed with the Viewer features and as result - we did not have enough time to fix all bugs and to make good test of such fixes.

We will try to resolve outstanding issues in a build expected in about a month's time.

Best
Regards.
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.