Class Date
The Date class is a utility class used to simplify work with PDF date objects.
PDF defines a standard date format, which closely follows international standard ASN.1 (Abstract Syntax Notation One), A date is a string of the form (D:YYYYMMDDHHmmSSOHH'mm'); See PDF Reference Manual for details.
Date can be associated with a SDF/Cos date string using Date(Obj) constructor or later using Date::Attach(Obj) or Date::Update(Obj*) methods.
Date keeps a local date/time cache so it is necessary to call Date::Update() method if the changes to the Date should be saved in the attached Cos/SDF string.
Inheritance
Implements
Inherited Members
Namespace: pdftron.PDF
Assembly: PDFNetiOS.dll
Syntax
public class Date : IDisposable
Constructors
Date()
Date default constructor.
Declaration
public Date()
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Date(Date)
Creates a Date
object from specified Date
object
Declaration
public Date(Date d)
Parameters
Type | Name | Description |
---|---|---|
Date | d |
|
Date(Obj)
Create a Date and initialize it using given Cos/SDF string date object. String date object is attached to this Date.
Declaration
public Date(Obj d)
Parameters
Type | Name | Description |
---|---|---|
Obj | d | the |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Date(Int16, Byte, Byte, Byte, Byte, Byte)
Create a Date and initialize it using specified parameters. The Date is not attached to any Cos/SDF object.
Declaration
public Date(short year, byte month, byte day, byte hour, byte minute, byte second)
Parameters
Type | Name | Description |
---|---|---|
System.Int16 | year | the year |
System.Byte | month | the month |
System.Byte | day | the day |
System.Byte | hour | the hour |
System.Byte | minute | the minute |
System.Byte | second | the second |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Properties
day
Declaration
public byte day { get; set; }
Property Value
Type | Description |
---|---|
System.Byte |
hour
Declaration
public byte hour { get; set; }
Property Value
Type | Description |
---|---|
System.Byte |
minute
Declaration
public byte minute { get; set; }
Property Value
Type | Description |
---|---|
System.Byte |
month
Declaration
public byte month { get; set; }
Property Value
Type | Description |
---|---|
System.Byte |
second
Declaration
public byte second { get; set; }
Property Value
Type | Description |
---|---|
System.Byte |
UT
Declaration
public byte UT { get; set; }
Property Value
Type | Description |
---|---|
System.Byte |
UT_hour
Declaration
public byte UT_hour { get; set; }
Property Value
Type | Description |
---|---|
System.Byte |
UT_minutes
Declaration
public byte UT_minutes { get; set; }
Property Value
Type | Description |
---|---|
System.Byte |
year
Declaration
public short year { get; set; }
Property Value
Type | Description |
---|---|
System.Int16 |
Methods
Attach(Obj)
Attach the Cos/SDF object to the Date.
Declaration
public void Attach(Obj d)
Parameters
Type | Name | Description |
---|---|---|
Obj | d |
|
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Dispose()
Declaration
public void Dispose()
Dispose(Boolean)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Finalize()
Releases all resources used by the Date
Declaration
protected void Finalize()
IsValid()
Indicates whether the Date is valid (non-null).
Declaration
public bool IsValid()
Returns
Type | Description |
---|---|
System.Boolean | True if this is a valid (non-null) Date; otherwise false. |
Remarks
If this method returns false the underlying SDF/Cos object is null and the Date object should be treated as null as well.
op_Assign(Date)
Assignment operator
Declaration
public Date op_Assign(Date r)
Parameters
Type | Name | Description |
---|---|---|
Date | r | object at the right of the operator |
Returns
Type | Description |
---|---|
Date | object equals to the given object |
Set(Date)
Sets value to given Date
object
Declaration
public void Set(Date p)
Parameters
Type | Name | Description |
---|---|---|
Date | p | given |
SetCurrentTime()
Sets the current time.
Declaration
public void SetCurrentTime()
Update()
Saves changes made to the Date object in the attached (or specified) SDF/Cos string.
Declaration
public bool Update()
Returns
Type | Description |
---|---|
System.Boolean | true if the attached Cos/SDF string was successfully updated, false otherwise. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Update(Obj)
Update.
Declaration
public bool Update(Obj d)
Parameters
Type | Name | Description |
---|---|---|
Obj | d | the d |
Returns
Type | Description |
---|---|
System.Boolean | true, if successful |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |