Class PdfDate
PdfDate is the PDF date object.
PDF defines a standard date format. The PDF date format closely follows the format
defined by the international standard ASN.1 (Abstract Syntax Notation One, defined
in CCITT X.208 or ISO/IEC 8824). A date is a PdfString of the form:
(D:YYYYMMDDHHmmSSOHH'mm')
See also ISO-320001 7.9.4, "Dates".
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CalendarConverts a PDF string representing a date into aCalendar.private static StringGives the W3C format of the PdfDate.static StringgetW3CDate(String d) Gives the W3C format of thePdfDate.protected booleanDefines if the object behind this wrapper must be an indirect object in the resultant document.private static StringsetLength(int i, int length) Adds a number of leading zeros to a givenStringin order to get aStringof a certain length.
-
Field Details
-
DATE_SPACE
private static final int[] DATE_SPACE
-
-
Constructor Details
-
PdfDate
Constructs aPdfDate-object.- Parameters:
d- the date that has to be turned into aPdfDate>-object
-
PdfDate
public PdfDate()Constructs aPdfDate-object, representing the current day and time.
-
-
Method Details
-
getW3CDate
-
getW3CDate
-
decode
-
isWrappedObjectMustBeIndirect
protected boolean isWrappedObjectMustBeIndirect()Description copied from class:PdfObjectWrapperDefines if the object behind this wrapper must be an indirect object in the resultant document.
If this method returns true it doesn't necessarily mean that object must be in the indirect state at any moment, but rather defines that when the object will be written to the document it will be transformed into indirect object if it's not indirect yet.
Return value of this method shouldn't depend on any logic, it should return always true or false.- Specified by:
isWrappedObjectMustBeIndirectin classPdfObjectWrapper<PdfString>- Returns:
- true if in the resultant document the object behind the wrapper must be indirect, otherwise false.
-
generateStringByCalendar
-
setLength
Adds a number of leading zeros to a givenStringin order to get aStringof a certain length.- Parameters:
i- a given numberlength- the length of the resultingString- Returns:
- the resulting
String
-