SetViewerLayoutMode Method (GdPicturePDF)
Sets the document's layout mode setting, specifying the page layout to be used when the document is opened in Adobe Reader or Acrobat viewer.
Parameters
- LayoutMode
- A member of the PdfViewerLayoutMode enumeration. Set this parameter according to your preference.
Return Value
A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK.
We strongly recommend always checking this status first.
How to set the PDF document's page layout mode to display a single page at a time.
Dim gdpicturePDF As New GdPicturePDF()
Dim status As GdPictureStatus = gdpicturePDF.LoadFromFile("test.pdf", False)
If status = GdPictureStatus.OK Then
status = gdpicturePDF.SetViewerLayoutMode(PdfViewerLayoutMode.PdfViewerLayoutModeSinglePage)
If status = GdPictureStatus.OK Then
If gdpicturePDF.SaveToFile("test_SetViewerLayoutMode_func.pdf", False) = GdPictureStatus.OK Then
MessageBox.Show("The page layout mode has been set successfully.", "Example: SetViewerLayoutMode")
End If
Else
MessageBox.Show("The SetViewerLayoutMode() method has failed with the status: " + status.ToString(), "Example: SetViewerLayoutMode")
End If
Else
MessageBox.Show("The file can't be loaded.", "Example: SetViewerLayoutMode")
End If
gdpicturePDF.Dispose()
GdPicturePDF gdpicturePDF = new GdPicturePDF();
GdPictureStatus status = gdpicturePDF.LoadFromFile("test.pdf", false);
if (status == GdPictureStatus.OK)
{
status = gdpicturePDF.SetViewerLayoutMode(PdfViewerLayoutMode.PdfViewerLayoutModeSinglePage);
if (status == GdPictureStatus.OK)
{
if (gdpicturePDF.SaveToFile("test_SetViewerLayoutMode_func.pdf", false) == GdPictureStatus.OK)
MessageBox.Show("The page layout mode has been set successfully.", "Example: SetViewerLayoutMode");
}
else
{
MessageBox.Show("The SetViewerLayoutMode() method has failed with the status: " + status.ToString(), "Example: SetViewerLayoutMode");
}
}
else
{
MessageBox.Show("The file can't be loaded.", "Example: SetViewerLayoutMode");
}
gdpicturePDF.Dispose();