[javascript FR] support Intl object in javascript

Please post any ideas or requests for new features here for the End User Version of PDF-XChange (printer Drivers)

Moderators: Daniel - PDF-XChange, PDF-XChange Support, Vasyl - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange, Tracker - Clarion Support, John - Tracker Supp, Support Staff, moderators

Post Reply
Mathew
User
Posts: 565
Joined: Thu Jun 19, 2014 7:30 pm

[javascript FR] support Intl object in javascript

Post by Mathew »

As of build 395 the ECMAScript Internationalization API is not supported in PXCE. It would be very useful for sorting according to international rules, and number formatting.

Code: Select all

new Intl.Collator();
//Console:Exec:1: ReferenceError: Intl is not defined
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 10959
Joined: Wed Jan 03, 2018 6:52 pm

Re: [javascript FR] support Intl object in javascript

Post by Daniel - PDF-XChange »

Hello, Mathew

Thank you for the request, I have passed it up to the Dev team for review!

Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 10959
Joined: Wed Jan 03, 2018 6:52 pm

Re: [javascript FR] support Intl object in javascript

Post by Daniel - PDF-XChange »

Hello again!

I have just head back from the Dev team, apparently this will not be possible to implement at this time, due to the complexity of the API involved.

Our of curiosity, did you find that this worked in the past? I (perhaps mistakenly) thought from your wording that this should have worked in build 394 or previous, but in testing it does not see that it does.

Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Mathew
User
Posts: 565
Joined: Thu Jun 19, 2014 7:30 pm

Re: [javascript FR] support Intl object in javascript

Post by Mathew »

Well, that's somewhat disappointing but thank you for checking. There is String.localeCompare() available for sorting, but I don't think any of the settings work.

I was just thinking about it because often languages other than US-English (that I use) sort in different orders, have different letters, etc. So for a script to work for those languages, it makes sense to use something a bit more internationally aware.

I was also running into a bit of a quagmire trying to figure out how to convert number strings to numbers when the decimal point and thousands separator may vary. How does PDF XChange handle this internally? Do the developers have a suggestion on how I should handle it?
All I really need to make number conversion work is to have a way of knowing the system Decimal symbol and Digit grouping symbol.

For example, if I use util.printf does it default to the system nDecSep?

Code: Select all

util.printf('%f',1.234);
// for a german system would it output 1,234000 ?
Daniel - PDF-XChange wrote: Thu May 08, 2025 6:13 pm Our of curiosity, did you find that this worked in the past? I (perhaps mistakenly) thought from your wording that this should have worked in build 394 or previous, but in testing it does not see that it does.
No it doesn't work in any previous builds. I'd not updated to the most recent version yet :oops: so just wanted to note the version that I was using.
Post Reply