Using gdpicturePDF As New GdPicturePDF()
Dim status As GdPictureStatus = gdpicturePDF.LoadFromFile("test.pdf", False)
If status = GdPictureStatus.OK Then
Dim pageCount As Integer = gdpicturePDF.GetPageCount()
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
MessageBox.Show("This document contains " + pageCount.ToString() + " pages.", "Example: CloseDocument")
End If
status = gdpicturePDF.CloseDocument()
If status <> GdPictureStatus.OK Then
MessageBox.Show("The CloseDocument() method has failed with the status: " + status.ToString(), "Example: CloseDocument")
End If
Else
MessageBox.Show("The file can't be loaded.", "Example: CloseDocument")
End If
End Using
using (GdPicturePDF gdpicturePDF = new GdPicturePDF())
{
GdPictureStatus status = gdpicturePDF.LoadFromFile("test.pdf", false);
if (status == GdPictureStatus.OK)
{
int pageCount = gdpicturePDF.GetPageCount();
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
MessageBox.Show("This document contains " + pageCount.ToString() + " pages.", "Example: CloseDocument");
status = gdpicturePDF.CloseDocument();
if (status != GdPictureStatus.OK)
MessageBox.Show("The CloseDocument() method has failed with the status: " + status.ToString(), "Example: CloseDocument");
}
else
{
MessageBox.Show("The file can't be loaded.", "Example: CloseDocument");
}
}