Java script not working.

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

vijaysayee
User
Posts: 5
Joined: Fri Mar 14, 2014 9:42 pm

Java script not working.

Post by vijaysayee »

Hi,

I have a .PDF file which I have created using Adobe Livecycle. I have written some java script code to display page numbers based on each master page. This PDF file is working fine when viewed Adobe Reader. But the script is not working when the PDF file is opened in PDF-XChange Viewer [Ver 2.5]. Below is the java script I am using.

CC243a_0313Fields.#pageSet[0].MasterPage1.PageCount::ready:layout - (JavaScript, client)
this.rawValue = xfa.layout.absPageSpan(xfa.form.CC243a_0313Fields.Page1);

I have lot of other scripts in the same file. All other scripts are working fine except for "xfa.layout.absPageSpan(xfa.form.CC243a_0313Fields.Page1);"

I would like to know how troubleshoot java script issue in PDF-XChange Viewer. Please advice.

Thanks,
Vijay.
User avatar
Will - Tracker Supp
Site Admin
Posts: 6815
Joined: Mon Oct 15, 2012 9:21 pm

Re: Java script not working.

Post by Will - Tracker Supp »

Hi vijaysayee,

Thanks for the post and welcome to the forums!

Please first make sure that you are running the latest build of the Viewer (214.2) and, failing that, please try the Editor (download link below) and you may find that helps:

Viewer
https://www.pdf-xchange.com/PDFXVwer.zip

Editor
https://www.pdf-xchange.com/PDFXVE3zip

Failing both of the above, please do send the actual PDF to test here.

Cheers,
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

Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
vijaysayee
User
Posts: 5
Joined: Fri Mar 14, 2014 9:42 pm

Re: Java script not working.

Post by vijaysayee »

Will,

Thanks for you help. The java script is working in PDF-Xchange editor. But not working in PDF-XChange viewer. I have attached a pdf file to simulate this problem. Please check the page numbers on every page.

Thanks,
Vijay.
You do not have the required permissions to view the files attached to this post.
User avatar
Will - Tracker Supp
Site Admin
Posts: 6815
Joined: Mon Oct 15, 2012 9:21 pm

Re: Java script not working.

Post by Will - Tracker Supp »

Hi vijaysayee,

From looking at the script, this seems to be an XFA script - some XFA functions were not supported in the Viewer, but support was implemented in the Editor. Given that the Editor is the replacement for the Viewer and that this issue is not a critical bug, I'm afraid that it's likely the Dev. Team will not implement/fix this in the Viewer.

Cheers,
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

Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
vijaysayee
User
Posts: 5
Joined: Fri Mar 14, 2014 9:42 pm

Re: Java script not working.

Post by vijaysayee »

Will,

Thanks for the update. Is there any other equivalent script available instead of using XFA script. I am trying to calculate the page numbers separately for each master page in the form.

Thanks,
Vijay.
User avatar
Will - Tracker Supp
Site Admin
Posts: 6815
Joined: Mon Oct 15, 2012 9:21 pm

Re: Java script not working.

Post by Will - Tracker Supp »

Hi Vijay,

I don't know of any other scripts that you could use, offhand, but I will ask the Dev. Team if they know of anything that may help.

As far as support for this goes, I'm afraid that as it's working in the Editor, which is the replacement for the Viewer, it's likely not something that we would implement in the Viewer. Also, it may be worth noting that this script also doesn't work correctly in Foxit and Nitro.

Cheers,
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

Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com