How do you set the default view mode for toolbar items etc.?
Question asked by Al Del Degan - June 13, 2017 at 12:44 PM
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
Cem Alacayir Replied
Employee Post Marked As Answer
There are some direct properties for some,  we plan to add more:
Gets or sets a value that specifies whether the left side pane is visible. The default is true.
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" 
        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%
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





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,




Reply to Thread