Package com.snowtide.pdf
Class PDFDateParser
- java.lang.Object
-
- com.snowtide.pdf.PDFDateParser
-
public class PDFDateParser extends Object
This class provides methods for parsing PDF-format date/time strings into
Date
s.Such date/time strings are typically retrieved via
Document.getAttribute(String)
, using theDocument.ATTR_CREATION_DATE
orDocument.ATTR_MOD_DATE
attribute keys.- Version:
- ©2004-2024 Snowtide
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Date
parseDateString(String pdfDate)
Parses the provided PDF-format date string into aDate
instance.
-
-
-
Method Detail
-
parseDateString
public static final Date parseDateString(String pdfDate) throws ParseException
Parses the provided PDF-format date string into aDate
instance. If the date string is not properly formatted (there are some PDF generators that do not output proper dates in their documents), this method will throw an appropriate exception. If this happens, it is likely that the date string is formatted in a human-readable way (i.e. Friday, November 14, 2001, etc).- Parameters:
pdfDate
- a PDF-format date string, retrieved viaDocument.getAttribute(String)
- Throws:
ParseException
- if the provided date string is not properly formatted.
-
-