PDFBox
  1. PDFBox
  2. PDFBOX-1219

org.apache.jempbox.impl.DateConverter unable to parse correct date value

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.0
    • Fix Version/s: 1.8.3, 2.0.0
    • Component/s: JempBox
    • Labels:
      None

      Description

      In a PDF I have found the following XMP field:

      xmp:CreateDate="2012-01-31T10:33+01:00"

      When Jempbox try to access this field I received the following error : "Error converting date:201201311033+0100"

      If we read the XMP SPECIFICATION PART 1 (http://www.adobe.com/devnet/xmp.html) in chapter "8.2.1.2 Date" the value is correct, it respect the format : YYYY-MM-DDThh:mmTZD but the DateConverter class is not able to read it.

      After a quick view of the class the complete parsing method need to be rewritten.

      Best regards,

      Pierre Huttin

        Issue Links

          Activity

          Pierre Huttin created issue -
          Hide
          Pierre Huttin added a comment -

          proposal of fixe for org.apache.jempbox.impl.DateConverter class

          Show
          Pierre Huttin added a comment - proposal of fixe for org.apache.jempbox.impl.DateConverter class
          Pierre Huttin made changes -
          Field Original Value New Value
          Attachment DateConverter.java.patch [ 12512983 ]
          Fred Hansen made changes -
          Link This issue is related to PDFBOX-1633 [ PDFBOX-1633 ]
          Hide
          Fred Hansen added a comment -

          pdfbox-1633 adds method toCalendar(String, String[]) which does not throw an exception for erroneous dates, but instead returns a valid date in the year 999. Replacing the call to toCalendar(String) will eliminate IOExceptions from unparsable dates.

          Show
          Fred Hansen added a comment - pdfbox-1633 adds method toCalendar(String, String[]) which does not throw an exception for erroneous dates, but instead returns a valid date in the year 999. Replacing the call to toCalendar(String) will eliminate IOExceptions from unparsable dates.
          Hide
          Andreas Lehmkühler added a comment -

          Solved after solving PDFBOX-1633

          Show
          Andreas Lehmkühler added a comment - Solved after solving PDFBOX-1633
          Andreas Lehmkühler made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Andreas Lehmkühler [ lehmi ]
          Fix Version/s 1.8.3 [ 12324576 ]
          Fix Version/s 2.0.0 [ 12319281 ]
          Resolution Fixed [ 1 ]
          Hide
          Andreas Lehmkühler added a comment -

          Closed after releasing 1.8.3

          Show
          Andreas Lehmkühler added a comment - Closed after releasing 1.8.3
          Andreas Lehmkühler made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Andreas Lehmkühler
              Reporter:
              Pierre Huttin
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development