1
How do you set the default view mode for toolbar items etc.?
Question asked by Al Del Degan - 6/13/2017 at 12:44 PM
Answered
When I initialize the .NET MVC page that displays the Document Ultimate control I want to have some defaults set for how it will look for the user.   For example, I would like to hide the side panel and set the page layout mode to continuous and use "fit width".  So far, I have not been able to find any initialization defaults in the knowledge base or community forum.  It seems like this should be extremely simple but I don't know how to do it.

2 Replies

Reply to Thread
1
Cem Alacayir Replied
Employee Post Marked As Answer
There are some direct properties for some,  we plan to add more:
 
SidePaneVisible
Gets or sets a value that specifies whether the left side pane is visible. The default is true.
 
ToolbarVisible
Gets or sets a value that specifies whether the top toolbar is visible. The default is true.
 
Others can be set like this:
 
<GleamTech:DocumentViewer ID="documentViewer" runat="server" 
        Width="800" 
        Height="600" 
        Resizable="True" 
        ClientLoad="documentViewerLoad" />
        
        
<script type="text/javascript">
    function documentViewerLoad(sender, e) { 
        var documentViewer = sender; //sender parameter will be the DocumentViewer instance

        documentViewer.setZoomLevel(1); // Set zoom to 100%
    }
</script>
 
Alternative methods that adjust view:
 
documentViewer.fitPage(); // Adjust page so that both width and height fits the view

documentViewer.fitWidth(); // Default behavior
Layout modes:
 
documentViewer.setLayoutMode("Continuous"); // Default behavior

documentViewer.setLayoutMode("Facing");

documentViewer.setLayoutMode("FacingContinuous");

documentViewer.setLayoutMode("FacingCover");

documentViewer.setLayoutMode("FacingCoverContinuous");

documentViewer.setLayoutMode("Single");
 
 
0
Jari Nieminen Replied
How do I use the code example above with code below?

@using GleamTech.Web.Mvc
@using GleamTech.DocumentUltimate.Web

@{
Layout = "";
}

@{
var documentViewer = new DocumentViewer
{
//Width = 800,
//Height = 600,
Document = "~/Documents/HyperlinkTestPage.pdf",
PrintEnabled = false,
SinglePageRotationEnabled = false,
};
}

<html>
<head>
@Html.RenderCss(documentViewer)
@Html.RenderJs(documentViewer)
</head>
<body>

@Html.RenderControl(documentViewer)

</body>
</html>

Reply to Thread