pdf-association / pdf-issues

Industry-based resolutions for issues and errata reported against any PDF-related specification
https://pdf-issues.pdfa.org/
64 stars 2 forks source link

In ISO 21757, the ECMAScript version for use with PDF 2.0 is not specified or constrained #185

Closed petervwyatt closed 2 years ago

petervwyatt commented 2 years ago

ISO 21757-1:2020 (ECMAScript for PDF 2.0) normatively references (as a DATED reference): "ISO/IEC 22275:2018, Information technology — Programming languages, their environments, and system software interfaces — ECMAScript® Specification Suite".

ISO/IEC 22275:2018 (https://www.iso.org/standard/73002.html) is freely available from https://standards.iso.org/ittf/PubliclyAvailableStandards/index.html as https://standards.iso.org/ittf/PubliclyAvailableStandards/c073002_ISO_IEC_22275_2018.zip

ISO/IEC 22275:2018 is a VERY short ISO/IEC standard which just normative references ECMA-262 and ECMA-402 using UNDATED references. As all ISO standards state: "For undated references, the latest edition of the referenced document (including any amendments) applies."

"ECMA-262, ECMAScript® Language Specification" is available from https://www.ecma-international.org/publications-and-standards/standards/ecma-262/ with the latest version being ECMAScript 2021. All older ECMAScript specification editions are still available from this URL.

I believe the root cause of this issue is probably ISO insisting that ISO specs are always used in preference to supposedly equivalent standards from other SDOs - but in this case the ISO standard is clearly NOT technically equivalent to a specific version of JS!

Referring back to ISO 32000-1:2008 (PDF 1.7) which normatively referenced "Client-Side JavaScript Reference, (May 1999), Mozilla Foundation.". I cannot locate this but I suspect was supposed to be ECMA-262 4th edition however this was never released by ECMA. This theory would also align with the previous support for E4X (now agreed deprecated for PDF 2.0).

The latest Adobe documentation for "Acrobat JavaScript API Reference" from https://opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/ provides this information on p.33:

image

This is also confusing as I cannot find references to JavaScript versions as "1.x" but only "ESx" with "ES5" being ECMAScript 5 (2009) and I'm not sure what JavaScript "1.8" is in terms of ECMAScript editions since after ES6 the year is the version...

I do not believe PDF should allow a moving target for JS language support. So the question is: what version(s) of ECMAScript can be used with PDF 2.0, and what are the correct normative references for that fixed version(s)?

lrosenthol commented 2 years ago

I have no objection to PDF 2.0, via 21757, specifying a specific version of JS to target. I would recommend ES2020.

Adobe's implementation was not tied to a specific standard but instead to an implementation (for better or worse).

petervwyatt commented 2 years ago

PDF TWG to update 21757 to refer to ES2020 via appropriate ECMA-262 edition.