Using 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
MessageBox.Show("This PDF document contains " + count + " pages.", "Example: GetPageCount")
Else
MessageBox.Show("The GetPageCount() method has failed with the status: " + status.ToString(), "Example: GetPageCount")
End If
Else
MessageBox.Show("The file can't be loaded.", "Example: GetPageCount")
End If
End Using
using (GdPicturePDF gdpicturePDF = new GdPicturePDF())
{
if (gdpicturePDF.LoadFromFile("test.pdf", false) == GdPictureStatus.OK)
{
int count = gdpicturePDF.GetPageCount();
GdPictureStatus status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
MessageBox.Show("This PDF document contains " + count + " pages.", "Example: GetPageCount");
else
MessageBox.Show("The GetPageCount() method has failed with the status: " + status.ToString(), "Example: GetPageCount");
}
else
MessageBox.Show("The file can't be loaded.", "Example: GetPageCount");
}