Le 24/08/2017 ? 16:45, BOURASSE Aziz a ?crit?: > > Why is it impossible to include special characters (like '#' for example) in > a text field name property on a pdf document ? >
The PDF spec apparently does not specifically disallow the '#' character, however, the field name should allow it be used in embedded javascripts, ie it should be also a valid Javascript variable name. If I quote https://mathiasbynens.be/notes/javascript-identifiers: "An identifier must start with $, _, or any character in the Unicode categories ?Uppercase letter (Lu)?, ?Lowercase letter (Ll)?, ?Titlecase letter (Lt)?, ?Modifier letter (Lm)?, ?Other letter (Lo)?, or ?Letter number (Nl)?. The rest of the string can contain the same characters, plus any U+200C zero width non-joiner characters, U+200D zero width joiner characters, and characters in the Unicode categories ?Non-spacing mark (Mn)?, ?Spacing combining mark (Mc)?, ?Decimal digit number (Nd)?, or ?Connector punctuation (Pc)?." The '#' character belongs to the unicode "Ponctuation, Other" category, so it cannot be used in a javascript variable name and hence should not be used in a PDF field name. Jean