diff options
author | Carlos Garcia Campos <carlosgc@gnome.org> | 2009-04-21 19:29:32 +0200 |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@gnome.org> | 2009-04-21 19:29:32 +0200 |
commit | 39d09fa237d06fa93b02eb916d2c0242c4e8fe85 (patch) | |
tree | 927058e3e688e230913cc4dabbb18a8ef5a0d9eb /glib/poppler-attachment.cc | |
parent | 9c2714a3e1c02f445661618e24bcd27f1392b2b7 (diff) |
[glib] Add poppler_date_parse to parse PDF format date strings
We need to make this public because the field M in the Annot dictionary
might be a Date string (in PDF date format) or a text string. According
to the PDF spec: "The preferred format is a date string as described in
Section 3.8.3, “Dates,” but viewer applications should be prepared to
accept and display a string in any format". The only way to know whether
it's a PDF date string or not, is by trying to parse it. For this reason
poppler_annot_get_modified() returns a gchar * instead of a time_t. So,
viewers should try to parse the string in order to convert it to a
time_t, and if it fails to parse, use the date string as provided by the
document.
Diffstat (limited to 'glib/poppler-attachment.cc')
-rw-r--r-- | glib/poppler-attachment.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/glib/poppler-attachment.cc b/glib/poppler-attachment.cc index 1c3eef00..2e2d12da 100644 --- a/glib/poppler-attachment.cc +++ b/glib/poppler-attachment.cc @@ -94,8 +94,8 @@ _poppler_attachment_new (PopplerDocument *document, attachment->size = emb_file->size (); - _poppler_convert_pdf_date_to_gtime (emb_file->createDate (), &attachment->ctime); - _poppler_convert_pdf_date_to_gtime (emb_file->modDate (), &attachment->mtime); + _poppler_convert_pdf_date_to_gtime (emb_file->createDate (), (time_t *)&attachment->ctime); + _poppler_convert_pdf_date_to_gtime (emb_file->modDate (), (time_t *)&attachment->mtime); attachment->checksum = g_string_new_len (emb_file->checksum ()->getCString (), emb_file->checksum ()->getLength ()); |