pdf-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pdf-devel] pdf_time_from_string_pdf


From: jemarch
Subject: Re: [pdf-devel] pdf_time_from_string_pdf
Date: Mon, 15 Jun 2009 21:44:12 +0200
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/23.0.60 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

Hi Lukasz.

   Hi i have one question about PDF_TIME_FORMAT_PDF.
   In pdf-time-string.c in begining of pdf_time_from_string_pdf is following
   comment.

      /*
       * From PDF Reference 1.7: ( D:YYYYMMDDHHmmSSOHH'mm' )
       * From ISO 32000:         ( D:YYYYMMDDHHmmSSOHH'mm  )
       *
       * Notes: Year is mandatory, all the other fields may appear if the
   preceding
       *        also appear.
       *
       *  D:   = string "D:"
       *  YYYY = four-digit year
       *  MM   = two-digit month (01=January, etc.)
       *  DD   = two-digit day of month (01 through 31)
       *  HH   = two digits of hour (00 through 23)
       *  mm   = two digits of minute (00 through 59)
       *  SS   = two digits of second (00 through 59)
       *  O    = either '+', '-' or 'Z'
       *  HH   = two digits of hour (00 through 23) for the GMT offset
       *  '    = string "'"
       *  MM   = two digits of minute (00 through 59) for the GMT offset
       *  '    = string "'"  (NOTE: Mandatory in 1.7, optional in ISO32000)
       */
   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?).

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?

--
Jose E. Marchesi  <address@hidden>
                  http://www.jemarch.net
GNU Project       http://www.gnu.org





reply via email to

[Prev in Thread] Current Thread [Next in Thread]