You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Arjohn Kampman <ar...@aduna-software.com> on 2010/03/01 14:21:25 UTC

Date conversion errors

Hi all,

I've collected the various "Error converting date" errors from our logs
and categorized them. I have found four date patterns that seem to occur
frequently:

Acrobat Distiller 1.0.2 for Macintosh:
   Fri, Apr 10, 1998

ECMP5:
   Wednesday January 3, 2001 10:02:13

GNU Ghostscript 7.0.7:
   Thu Feb  5 23:23:54 UTC 2009

Acrobat Net Distiller 1.0 for Windows
   Monday, May 16, 1994 at 3:39PM

A patch to add support for these formats is attached. Can this be
integrated into pdfbox?

Regards,
Arjohn

Re: Date conversion errors

Posted by Arjohn Kampman <ar...@aduna-software.com>.
Daniel Wilson wrote:
> Arjohn,
> 
> Would you put this into https://issues.apache.org/ and, when you attach the
> patch, select the box to grant us the license to use it?
> 
> If I understand the legal requirements correctly (and I may not) we're not
> allowed to incorporate somebody's patch unless we get that license grant.
> 
> Additionally, test PDF's that demonstrate the correction would be
> appreciated ... though not really required.

Done: https://issues.apache.org/jira/browse/PDFBOX-643

I noticed that pdfbox uses a fair amount of StringBuffer's. How about
replacing these with StringBuilder's for a (small) performance
improvement with almost no effort?

Arjohn

Re: Date conversion errors

Posted by Daniel Wilson <wi...@gmail.com>.
Arjohn,

Would you put this into https://issues.apache.org/ and, when you attach the
patch, select the box to grant us the license to use it?

If I understand the legal requirements correctly (and I may not) we're not
allowed to incorporate somebody's patch unless we get that license grant.

Additionally, test PDF's that demonstrate the correction would be
appreciated ... though not really required.

Thanks.

Daniel

On Mon, Mar 1, 2010 at 8:21 AM, Arjohn Kampman <
arjohn.kampman@aduna-software.com> wrote:

> Hi all,
>
> I've collected the various "Error converting date" errors from our logs
> and categorized them. I have found four date patterns that seem to occur
> frequently:
>
> Acrobat Distiller 1.0.2 for Macintosh:
>  Fri, Apr 10, 1998
>
> ECMP5:
>  Wednesday January 3, 2001 10:02:13
>
> GNU Ghostscript 7.0.7:
>  Thu Feb  5 23:23:54 UTC 2009
>
> Acrobat Net Distiller 1.0 for Windows
>  Monday, May 16, 1994 at 3:39PM
>
> A patch to add support for these formats is attached. Can this be
> integrated into pdfbox?
>
> Regards,
> Arjohn
>
> Index: DateConverter.java
> ===================================================================
> --- DateConverter.java  (revision 917416)
> +++ DateConverter.java  (working copy)
> @@ -47,7 +47,12 @@
>         new SimpleDateFormat("EEEE, dd MMM yyyy hh:mm:ss a"),
>         new SimpleDateFormat("EEEE, MMM dd, yyyy hh:mm:ss a"),
>         new SimpleDateFormat("MM/dd/yyyy hh:mm:ss"),
> -        new SimpleDateFormat("MM/dd/yyyy")};
> +        new SimpleDateFormat("MM/dd/yyyy"),
> +        new SimpleDateFormat("EEEE, MMM dd, yyyy"), // Acrobat Distiller
> 1.0.2 for Macintosh
> +        new SimpleDateFormat("EEEE MMM dd, yyyy HH:mm:ss"), // ECMP5
> +        new SimpleDateFormat("EEEE MMM dd HH:mm:ss z yyyy"), // GNU
> Ghostscript 7.0.7
> +        new SimpleDateFormat("EEEE, MMM dd, yyyy 'at' hh:mma") // Acrobat
> Net Distiller 1.0 for Windows
> +    };
>
>     private DateConverter()
>     {
>
>