Hi there,
Last ' character is mandatory in 1.7, but what with minor versions of pdf
files. Is last ' character mandatory also?. If no then
pdf_time_from_string_pdf must accept strings without '. Currently it don't
accept them.
According to the 7.9.4 section of ISO32000, the format of a date
should be:
(D:YYYYMMDDHHmmSSOHH'mm )
where the ' after the HH should be specified only if HH is specified.
As long as I understand that apostrophe is NOT allowed in ISO 32000
documents (Aleks, am I missing something?).
Last apostrophe is optional in ISO32000, if I remember correctly... from
my comments in the source code:
"'" (NOTE: Mandatory in 1.7, optional in ISO32000)
In consequence I would extend the function declaration to:
pdf_status_t
pdf_time_from_string_pdf (pdf_time_t time_var,
const pdf_char_t *time_str,
pdf_bool_t allow_trailing_apostrophe)
so the caller can have control on what kind of date formats to
support.
What do you think?
Well, as the last apostrophe is optional in ISO32000, and mandatory in
PDF1.7, I wouldn't let the caller choose one or the other, and just
manage it internally as optional, so accept both.
Another thing would be when creating such a string from a pdf_time_t.
Then, I would always add it, so that it is compatible with both ISO32000
and PDF1.7
-Aleksander