Dim caption As String = "Example: SelectPage"
Dim gdpicturePDF As New GdPicturePDF()
If gdpicturePDF.LoadFromFile("test.pdf", False) = GdPictureStatus.OK Then
Dim count As Integer = gdpicturePDF.GetPageCount()
Dim status As GdPictureStatus = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
Dim current As Integer = 0
status = gdpicturePDF.SelectPage(0)
If status = GdPictureStatus.OK Then
current = gdpicturePDF.GetCurrentPage()
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
MessageBox.Show("The currently selected page is page nr." + current.ToString(), caption)
Else
MessageBox.Show("The GetCurrentPage() method has failed with the status: " + status.ToString(), caption)
End If
status = gdpicturePDF.SelectPage(count + 1)
If status = GdPictureStatus.OK Then
current = gdpicturePDF.GetCurrentPage()
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
MessageBox.Show("The currently selected page is page nr." + current.ToString(), caption)
Else
MessageBox.Show("The GetCurrentPage() method has failed with the status: " + status.ToString(), caption)
End If
status = gdpicturePDF.SelectPage(1)
If status = GdPictureStatus.OK Then
current = gdpicturePDF.GetCurrentPage()
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
MessageBox.Show("The currently selected page is page nr." + current.ToString(), caption)
Else
MessageBox.Show("The GetCurrentPage() method has failed with the status: " + status.ToString(), caption)
End If
Else
MessageBox.Show("The SelectPage(1) method has failed with the status: " + status.ToString(), caption)
End If
Else
MessageBox.Show("The SelectPage(count + 1) method has failed with the status: " + status.ToString(), caption)
End If
Else
MessageBox.Show("The SelectPage(0) method has failed with the status: " + status.ToString(), caption)
End If
Else
MessageBox.Show("The GetPageCount() method has failed with the status: " + status.ToString(), caption)
End If
Else
MessageBox.Show("The file can't be loaded.", caption)
End If
gdpicturePDF.Dispose()
string caption = "Example: SelectPage";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
if (gdpicturePDF.LoadFromFile("test.pdf", false) == GdPictureStatus.OK)
{
int count = gdpicturePDF.GetPageCount();
GdPictureStatus status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
int current = 0;
status = gdpicturePDF.SelectPage(0);
if (status == GdPictureStatus.OK)
{
current = gdpicturePDF.GetCurrentPage();
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
MessageBox.Show("The currently selected page is page nr." + current.ToString(), caption);
else
MessageBox.Show("The GetCurrentPage() method has failed with the status: " + status.ToString(), caption);
status = gdpicturePDF.SelectPage(count + 1);
if (status == GdPictureStatus.OK)
{
current = gdpicturePDF.GetCurrentPage();
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
MessageBox.Show("The currently selected page is page nr." + current.ToString(), caption);
else
MessageBox.Show("The GetCurrentPage() method has failed with the status: " + status.ToString(), caption);
status = gdpicturePDF.SelectPage(1);
if (status == GdPictureStatus.OK)
{
current = gdpicturePDF.GetCurrentPage();
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
MessageBox.Show("The currently selected page is page nr." + current.ToString(), caption);
else
MessageBox.Show("The GetCurrentPage() method has failed with the status: " + status.ToString(), caption);
}
else
MessageBox.Show("The SelectPage(1) method has failed with the status: " + status.ToString(), caption);
}
else
MessageBox.Show("The SelectPage(count + 1) method has failed with the status: " + status.ToString(), caption);
}
else
MessageBox.Show("The SelectPage(0) method has failed with the status: " + status.ToString(), caption);
}
else
MessageBox.Show("The GetPageCount() method has failed with the status: " + status.ToString(), caption);
}
else
MessageBox.Show("The file can't be loaded.", caption);
gdpicturePDF.Dispose();