'We assume that the GdViewer1 control has been properly integrated.
If GdViewer1.DisplayFromFile("") = GdPictureStatus.OK Then
Dim message As String = "The current file is: " + GdViewer1.GetLastPath()
If GdViewer1.GetDocumentType() = DocumentType.DocumentTypePDF Then
message += vbCrLf + "Number of pages: " + GdViewer1.PageCount.ToString() +
vbCrLf + "Page height: " + (GdViewer1.PdfGetPageHeight()) / 72 * 2.54 + " cm" +
vbCrLf + "Page width: " + (GdViewer1.PdfGetPageWidth()) / 72 * 2.54 + " cm"
Else
message += vbCrLf + "This file is not a PDF document, its format is: " + GdViewer1.GetDocumentType().ToString()
End If
MessageBox.Show(message, "GdViewer.PdfGetPageHeight")
Else
MessageBox.Show("The file can't be loaded. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.PdfGetPageWidth")
End If
//We assume that the GdViewer1 control has been properly integrated.
if (GdViewer1.DisplayFromFile("") == GdPictureStatus.OK)
{
string message = "The current file is: " + GdViewer1.GetLastPath();
if (GdViewer1.GetDocumentType() == DocumentType.DocumentTypePDF)
{
message += "\nNumber of pages: " + GdViewer1.PageCount.ToString() +
"\nPage height: " + (GdViewer1.PdfGetPageHeight())/72*2.54 +
" cm\nPage width: " + (GdViewer1.PdfGetPageWidth())/72*2.54 + " cm";
}
else
{
message += "\nThis file is not a PDF document, its format is: " + GdViewer1.GetDocumentType().ToString();
}
MessageBox.Show(message, "GdViewer.PdfGetPageWidth");
}
else
MessageBox.Show("The file can't be loaded. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.PdfGetPageWidth");