Dim caption As String = "Example: GetViewerPageMode"
Dim gdpicturePDF As New GdPicturePDF()
Dim status As GdPictureStatus = gdpicturePDF.LoadFromFile("test.pdf", False)
If status = GdPictureStatus.OK Then
Dim oPdfViewerPageMode As PdfViewerPageMode = gdpicturePDF.GetViewerPageMode()
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
Select Case oPdfViewerPageMode
Case PdfViewerPageMode.PdfViewerPageModeUseNone
MessageBox.Show("Neither document outline nor thumbnail images are visible.", caption)
Case PdfViewerPageMode.PdfViewerPageModeUseOutlines
MessageBox.Show("Document outline is visible.", caption)
Case PdfViewerPageMode.PdfViewerPageModeUseThumbs
MessageBox.Show("Thumbnail images are visible.", caption)
Case PdfViewerPageMode.PdfViewerPageModeFullScreen
MessageBox.Show("Full-screen mode, with no menu bar, window controls, or any other window is visible.", caption)
Case PdfViewerPageMode.PdfViewerPageModeUseOC
MessageBox.Show("(PDF 1.5) Optional content group panel is visible.", caption)
Case PdfViewerPageMode.PdfViewerPageModeUseAttachments
MessageBox.Show("(PDF 1.6) Attachments panel is visible.", caption)
Case Else
MessageBox.Show("Invalid value has been returned.", caption)
End Select
Else
MessageBox.Show("The GetViewerPageMode() method has failed.", caption)
End If
Else
MessageBox.Show("The file can't be loaded.", caption)
End If
gdpicturePDF.Dispose()
string caption = "Example: GetViewerPageMode";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
GdPictureStatus status = gdpicturePDF.LoadFromFile("test.pdf", false);
if (status == GdPictureStatus.OK)
{
PdfViewerPageMode oPdfViewerPageMode = gdpicturePDF.GetViewerPageMode();
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
switch (oPdfViewerPageMode)
{
case PdfViewerPageMode.PdfViewerPageModeUseNone:
MessageBox.Show("Neither document outline nor thumbnail images are visible.", caption);
break;
case PdfViewerPageMode.PdfViewerPageModeUseOutlines:
MessageBox.Show("Document outline is visible.", caption);
break;
case PdfViewerPageMode.PdfViewerPageModeUseThumbs:
MessageBox.Show("Thumbnail images are visible.", caption);
break;
case PdfViewerPageMode.PdfViewerPageModeFullScreen:
MessageBox.Show("Full-screen mode, with no menu bar, window controls, or any other window is visible.", caption);
break;
case PdfViewerPageMode.PdfViewerPageModeUseOC:
MessageBox.Show("(PDF 1.5) Optional content group panel is visible.", caption);
break;
case PdfViewerPageMode.PdfViewerPageModeUseAttachments:
MessageBox.Show("(PDF 1.6) Attachments panel is visible.", caption);
break;
default:
MessageBox.Show("Invalid value has been returned.", caption);
break;
}
}
else
{
MessageBox.Show("The GetViewerPageMode() method has failed.", caption);
}
}
else
{
MessageBox.Show("The file can't be loaded.", caption);
}
gdpicturePDF.Dispose();