You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Robert Šiška (JIRA)" <ji...@apache.org> on 2016/05/18 08:23:12 UTC

[jira] [Comment Edited] (PDFBOX-3352) Calendar values are parsed with unknown timezones

    [ https://issues.apache.org/jira/browse/PDFBOX-3352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15288611#comment-15288611 ] 

Robert Šiška edited comment on PDFBOX-3352 at 5/18/16 8:22 AM:
---------------------------------------------------------------

{code:java}
document = PDDocument.load(new File("/home/rsiska/test.pdf"));
metadata = document.getDocumentInformation();

creationDate = metadata.getCreationDate();
// creationDate = "java.util.GregorianCalendar[time=1463558972000,areFieldsSet=true,areAllFieldsSet=true,lenient=false,zone=java.util.SimpleTimeZone[id=unknown,offset=7200000,dstSavings=3600000,useDaylight=false,startYear=0...
getTimeZone().toZoneId();
{code}

The {{test.pdf}} was created by exporting from LibreOffice Writer (attached to ticket). But it happens with other files too.


was (Author: robsis):
{code:java}
document = PDDocument.load(new File("/home/rsiska/test.pdf"));
metadata = document.getDocumentInformation();

creationDate = metadata.getCreationDate();
// creationDate = "java.util.GregorianCalendar[time=1463558972000,areFieldsSet=true,areAllFieldsSet=true,lenient=false,zone=java.util.SimpleTimeZone[id=unknown,offset=7200000,dstSavings=3600000,useDaylight=false,startYear=0...
getTimeZone().toZoneId();
{code}

The {{test.pdf}} was created by exporting from LibreOffice Writer (attached to ticket).

> Calendar values are parsed with unknown timezones
> -------------------------------------------------
>
>                 Key: PDFBOX-3352
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3352
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: Parsing
>    Affects Versions: 1.8.12
>            Reporter: Robert Šiška
>         Attachments: test.pdf
>
>
> Example of Calendar instance parsed from document:
> {code}
> java.util.SimpleTimeZone[id=unknown,offset=7200000,dstSavings=3600000,useDaylight=false,startYear=0,startMode=0,startMonth=0,startDay=0,startDayOfWeek=0,startTime=0,startTimeMode=0,endMode=0,endMonth=0,endDay=0,endDayOfWeek=0,endTime=0,endTimeMode=0]
> {code}
> Although calling e.g. {{timeZone.getDisplayName()}} shows correclty 'GMT+02:00', {{timeZone.toZoneId()}} fails with following stack trace:
> {code}
> java.time.zone.ZoneRulesException: Unknown time-zone ID: unknown
> 	at java.time.zone.ZoneRulesProvider.getProvider(ZoneRulesProvider.java:272)
> 	at java.time.zone.ZoneRulesProvider.getRules(ZoneRulesProvider.java:227)
> 	at java.time.ZoneRegion.ofId(ZoneRegion.java:120)
> 	at java.time.ZoneId.of(ZoneId.java:411)
> 	at java.time.ZoneId.of(ZoneId.java:359)
> 	at java.time.ZoneId.of(ZoneId.java:315)
> 	at java.util.TimeZone.toZoneId(TimeZone.java:556)
>         ...
> {code}
> -This is fixed in PDFBOX-1633 but although the fixVersion is 1.8.3, I couldn't find the commit on 1.8 branch (only on 2.0)-



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org