Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-170

Another converting date error with LucenePDFDocument

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.2.0
    • Text extraction
    • None

    Description

      [imported from SourceForge]
      http://sourceforge.net/tracker/index.php?group_id=78314&atid=552832&aid=1495545
      Originally submitted by sbartocci on 2006-05-26 06:55.

      I'm using Lucene with PDFBox but It seems there is an
      error in converting date when the CreationDate field
      is a set as text field in Document properties:

      (xmp file)
      <rdf:Description rdf:about=''
      xmlns:pdf='http://ns.adobe.com/pdf/1.3/'>
      <pdf:CreationDate--Text>27/10/2005
      14:59:39</pdf:CreationDate--Text>
      <pdf:Producer>Amyuni PDF Converter</pdf:Producer>
      </rdf:Description>

      instead if the field is formatted like this:

      (xmp file)
      <rdf:Description rdf:about=''
      xmlns:xap='http://ns.adobe.com/xap/1.0/'>
      <xap:CreatorTool>PScript5.dll Version
      5.2.2</xap:CreatorTool>
      <xap:ModifyDate>2005-09-
      27T15:57:14+02:00</xap:ModifyDate>
      <xap:CreateDate>2005-09-
      27T15:57:14+02:00</xap:CreateDate>
      </rdf:Description>

      the library works without any exception.

      The exception found is:

      Error converting date:27/10/2005 14:59:39

      java.io.IOException: Error converting date:27/10/2005
      14:59:39
      at org.pdfbox.util.DateConverter.toCalendar
      (DateConverter.java:237)
      at org.pdfbox.util.DateConverter.toCalendar
      (DateConverter.java:134)
      at org.pdfbox.cos.COSDictionary.getDate
      (COSDictionary.java:704)
      at
      org.pdfbox.pdmodel.PDDocumentInformation.getCreationDa
      te(PDDocumentInformation.java:232)
      at
      org.pdfbox.searchengine.lucene.LucenePDFDocument.addCo
      ntent(LucenePDFDocument.java:297)
      at
      org.pdfbox.searchengine.lucene.LucenePDFDocument.getDo
      cument(LucenePDFDocument.java:187)

      Best regards
      Stefano

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Anonymous Anonymous
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: