Dim caption As String = "Example: GetAnnotationActionID"
Dim gdpicturePDF As GdPicturePDF = New GdPicturePDF()
If (gdpicturePDF.LoadFromFile("test.pdf", False) = GdPictureStatus.OK) AndAlso
(gdpicturePDF.SelectPage(1) = GdPictureStatus.OK) Then
Dim annotCount As Integer = gdpicturePDF.GetAnnotationCount()
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
Dim message As String = "The number of annotations on the 1st page is: " + annotCount.ToString() + vbCrLf
Dim actionID As Integer = -1
Dim actionType As PdfActionType = PdfActionType.ActionTypeUnknown
For annotID As Integer = 0 To annotCount - 1
message = message + "annotID: " + annotID.ToString() + " subtype: "
Dim annotSubtype As String = gdpicturePDF.GetAnnotationSubType(annotID)
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
message = message + annotSubtype + " action: "
actionID = gdpicturePDF.GetAnnotationActionID(annotID)
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
actionType = gdpicturePDF.GetActionType(actionID)
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
message = message + actionType.ToString()
Else
message = message + gdpicturePDF.GetStat().ToString()
End If
Else
message = message + gdpicturePDF.GetStat().ToString()
End If
Else
message = message + gdpicturePDF.GetStat().ToString()
End If
message = message + vbCrLf
Next
MessageBox.Show(message, caption)
Else
MessageBox.Show("The GetAnnotationCount() method has failed with the status: " + gdpicturePDF.GetStat().ToString(), caption)
End If
Else
MessageBox.Show("The file can't be loaded.", caption)
End If
gdpicturePDF.Dispose()
string caption = "Example: GetAnnotationActionID";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
if ((gdpicturePDF.LoadFromFile("test.pdf", false) == GdPictureStatus.OK) &&
(gdpicturePDF.SelectPage(1) == GdPictureStatus.OK))
{
int annotCount = gdpicturePDF.GetAnnotationCount();
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
{
string message = "The number of annotations on the 1st page is: " + annotCount.ToString() + "\n";
int actionID = -1;
PdfActionType actionType = PdfActionType.ActionTypeUnknown;
for (int annotID = 0; annotID < annotCount; annotID++)
{
message = message + "annotID: " + annotID.ToString() + " subtype: ";
string annotSubtype = gdpicturePDF.GetAnnotationSubType(annotID);
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
{
message = message + annotSubtype + " action: ";
actionID = gdpicturePDF.GetAnnotationActionID(annotID);
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
{
actionType = gdpicturePDF.GetActionType(actionID);
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
message = message + actionType.ToString();
else
message = message + gdpicturePDF.GetStat().ToString();
}
else
message = message + gdpicturePDF.GetStat().ToString();
}
else
message = message + gdpicturePDF.GetStat().ToString();
message = message + "\n";
}
MessageBox.Show(message, caption);
}
else
MessageBox.Show("The GetAnnotationCount() method has failed with the status: " + gdpicturePDF.GetStat().ToString(), caption);
}
else
MessageBox.Show("The file can't be loaded.", caption);
gdpicturePDF.Dispose();