GetEmbeddedFileCreationDate Method (GdPicturePDF)
Gets the creation date of an embedded file (the attachment's creation date) within the currently loaded PDF document. You need to specify this attachment by its 0-based index.
public string GetEmbeddedFileCreationDate(
int
)
public function GetEmbeddedFileCreationDate(
: Integer
): String;
public function GetEmbeddedFileCreationDate(
: int
) : String;
public: string* GetEmbeddedFileCreationDate(
int
)
public:
String^ GetEmbeddedFileCreationDate(
int
)
'Declaration
Public Function GetEmbeddedFileCreationDate( _
ByVal As Integer _
) As String
Parameters
- FileIdx
- The 0-based index of the embedded file. It must be a value from 0 to GdPicturePDF.GetEmbeddedFileCount-1.
Return Value
The creation date of the embedded file. It is the date when you have embedded this file into the PDF document (you have created this attachment).
The GdPicturePDF.GetStat method can be subsequently used to determine if this method has been successful.
How to find out the creation date of the first embedded file within the PDF document.
Dim caption As String = "Example: GetEmbeddedFileCreationDate"
Dim gdpicturePDF As New GdPicturePDF()
If gdpicturePDF.LoadFromFile("TestPDFWithAttachment.pdf", False) = GdPictureStatus.OK Then
Dim embeddedFileCount As Integer = gdpicturePDF.GetEmbeddedFileCount()
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
If embeddedFileCount = 0 Then
MessageBox.Show("This PDF file does not contain embedded files.", caption)
Else
Dim creationDate As String = gdpicturePDF.GetEmbeddedFileCreationDate(0)
Dim status As GdPictureStatus = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
MessageBox.Show("The creation date of the first embedded file is: " + creationDate, caption)
Else
MessageBox.Show("The GetEmbeddedFileCreationDate() method has failed with the status: " + status.ToString(), caption)
End If
End If
End If
Else
MessageBox.Show("The file can't be loaded.", caption)
End If
gdpicturePDF.Dispose()
string caption = "Example: GetEmbeddedFileCreationDate";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
if (gdpicturePDF.LoadFromFile("TestPDFWithAttachment.pdf", false) == GdPictureStatus.OK)
{
int embeddedFileCount = gdpicturePDF.GetEmbeddedFileCount();
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
{
if (embeddedFileCount == 0)
{
MessageBox.Show("This PDF file does not contain embedded files.", caption);
}
else
{
string creationDate = gdpicturePDF.GetEmbeddedFileCreationDate(0);
GdPictureStatus status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
MessageBox.Show("The creation date of the first embedded file is: " + creationDate, caption);
}
else
{
MessageBox.Show("The GetEmbeddedFileCreationDate() method has failed with the status: " + status.ToString(), caption);
}
}
}
}
else
{
MessageBox.Show("The file can't be loaded.", caption);
}
gdpicturePDF.Dispose();