It's a bug. The pdf spec is clear in that Z is only used when the local time is the
same as UTC and in that case no time offset is present. The fix is in PdfDate:
PdfDate(GregorianCalendar d) {
super();
StringBuffer date = new StringBuffer("D:");
date.append(setLength(d.get(GregorianCalendar.YEAR), 4));
date.append(setLength(d.get(GregorianCalendar.MONTH) + 1, 2));
date.append(setLength(d.get(GregorianCalendar.DATE), 2));
date.append(setLength(d.get(GregorianCalendar.HOUR_OF_DAY), 2));
date.append(setLength(d.get(GregorianCalendar.MINUTE), 2));
date.append(setLength(d.get(GregorianCalendar.SECOND), 2));
int timezone = d.get(GregorianCalendar.ZONE_OFFSET) / (60 * 60 * 1000);
if (timezone == 0) {
date.append("Z");
}
else if (timezone < 0) {
date.append("-");
timezone = -timezone;
}
else {
date.append("+");
}
if (timezone != 0) {
date.append(setLength(timezone, 2)).append("'");
int zone = Math.abs(d.get(GregorianCalendar.ZONE_OFFSET) / (60 * 1000)) -
(timezone * 60);
date.append(setLength(zone, 2)).append("'");
}
value = date.toString();
}
Best Regards,
Paulo Soares
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Peter Soelter
> Sent: Friday, June 18, 2004 2:54 PM
> To: [EMAIL PROTECTED]
> Subject: [iText-questions] Bug in PDFDate?
>
> Hi everybody,
> maybe I found a little bug in PdfDate.java!?
>
> On a machine in time zone 0 the Date-String has the format:
> D:20040618144644Z00'00'
>
> This doesn't seem to work correctly, if the date appears in a
> signature dictionary (/Type /Sig).
>
> Acrobat 5.1 accepts this date-format, Acrobat 6 gives an error:
> 'Invalid parameter' when opening the signature tab.
>
> If the zero time zone is left out like this:
> D:20040618144644Z
> everything works fine in Acrobat Reader 5.1 and 6
>
> The Adobe PDF spec is not clear about this point.
>
> Best Regards,
> Peter
>
> --
> +++ Jetzt WLAN-Router f�r alle DSL-Einsteiger und Wechsler +++
> GMX DSL-Powertarife zudem 3 Monate gratis* http://www.gmx.net/dsl
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
> Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
> Conference, June 28 - July 1 at the Moscone Center in San
> Francisco, CA
> REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority
> Code NWMGYKND
> _______________________________________________
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions