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
Dates.Such date/time strings are typically retrieved via
Document.getAttribute(String), using theDocument.ATTR_CREATION_DATEorDocument.ATTR_MOD_DATEattribute keys.- Version:
- ©2004-2025 Snowtide
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DateparseDateString(String pdfDate)Parses the provided PDF-format date string into aDateinstance.
-
-
-
Method Detail
-
parseDateString
public static final Date parseDateString(String pdfDate) throws ParseException
Parses the provided PDF-format date string into aDateinstance. 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.
-
-