GdPicture.NET.14.API
GdPicture14 Namespace / GdPicturePDF Class / SetViewerLayoutMode Method
A member of the PdfViewerLayoutMode enumeration. Set this parameter according to your preference.
Example





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.
Syntax
'Declaration
 
Public Function SetViewerLayoutMode( _
   ByVal LayoutMode As PdfViewerLayoutMode _
) As GdPictureStatus
 

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.

Remarks
This method is only allowed for use with non-encrypted documents.
Example
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()
See Also