DocumentViewerPermissions Enumeration

Defines the document viewer permissions.

When combining permissions, they should be separated by comma in string and by bitwise 'or' operator in code (| in C# and OR in VB).

Definition

Namespace: GleamTech.DocumentUltimate.AspNet.UI
Assembly: GleamTech.DocumentUltimate (in GleamTech.DocumentUltimate.dll) Version: 7.1.5
C#
[FlagsAttribute]
public enum DocumentViewerPermissions

Example

Setting document viewer permissions in code:

C#
//allow all set of permissions (default value)
documentViewer.AllowedPermissions = DocumentViewerPermissions.All;

//allow only Download and Print permissions
documentViewer.AllowedPermissions = DocumentViewerPermissions.Download | DocumentViewerPermissions.Print;

//allow all except Download and Print permissions
documentViewer.AllowedPermissions = DocumentViewerPermissions.All;
documentViewer.DeniedPermissions = DocumentViewerPermissions.Download | DocumentViewerPermissions.Print;

//allow all set of permissions and also add OpenLocalPdf which is not included in all
documentViewer.AllowedPermissions = DocumentViewerPermissions.All | DocumentViewerPermissions.OpenLocalPdf;

Setting document viewer permissions in ASPX markup:

ASPX
<%-- allow all set of permissions (default value) --%>
<GleamTech:DocumentViewerControl runat="server" 
    Width="800" 
    Height="600" 
    Document="~/Documents/Document.docx"
    AllowedPermissions="All" />

<%-- allow only Download and Print permissions --%>
<GleamTech:DocumentViewerControl runat="server" 
    Width="800" 
    Height="600" 
    Document="~/Documents/Document.docx"
    AllowedPermissions="Download, Print" />

<%-- allow all except Download and Print permissions --%>
<GleamTech:DocumentViewerControl runat="server" 
    Width="800" 
    Height="600" 
    Document="~/Documents/Document.docx"
    AllowedPermissions="All"
    DeniedPermissions="Download, Print" />

Members

None None of the permissions (unset).
Download Ability to download the original document. Downloading can be disabled for security (DRM) purpose.
DownloadAsPdf Ability to download a PDF version of the original document . Downloading as PDF can be disabled for additional security (DRM) purpose.
Print Ability to print the displayed document Printing can be disabled for additional security (DRM) purpose.
SelectText Ability to select and copy text in the displayed document Text selection can be disabled for additional security (DRM) purpose.
NavigatePages Ability to navigate pages, e.g. next page, previous page and jump to page.
NavigateHistory Ability to navigate UI history, e.g. go back and go forward.
Obsolete.
Zoom Ability to zoom in or out of the document.
Pan Ability to pan the document.
ChangeFitMode Ability to change fit mode of the document, e.g. fit width and fit page.
Obsolete.
ChangeZoomMode Ability to change zoom mode of the document, e.g. fit width, fit page etc.
ChangeLayoutMode Ability to change layout mode of the document, e.g. continuous, facing etc.
Obsolete.
ChangeSpreadMode Ability to change spread mode of the document, e.g. odd, even etc.
Rotate Ability to rotate the page or document, e.g. rotate clockwise and rotate counterclockwise.
Find Ability to find text within the document.
GoFullScreen Ability to switch the document viewer to full screen.
ViewThumbnails Ability to view thumbnails for the document pages.
ViewBookmarks Ability to view bookmarks/outlines of the document.
Obsolete.
ViewOutlines Ability to view outlines of the document.
Search Ability to search text (advanced search) within the document.
Obsolete.
ViewAnnotations Ability to view and edit annotations of the document.
FillForms Ability to fill values into form fields of the document. Requires also ViewAnnotations permission.
ViewAttachments Ability to view attachments of the document.
ViewLayers Ability to view layers of the document.
ViewProperties Ability to view properties of the document.
GoPresentationMode Ability to switch the document viewer to presentation mode.
ChangeScrollMode Ability to change scroll mode of the document, e.g. vertical, horizontal etc.
All All the permissions combined.
OpenLocalPdf Ability to open local PDF files, i.e. user is shown "Open" menu item which is when clicked shows browser's open dialog to choose a PDF file to load. This permission is not included in All permission so it should be added additionally.

Note that only PDF files can be opened this way and not other formats because file is not processed on the server side (no conversions), and it's loaded by client-side DocumentViewer directly (same for attachments, non-PDF attachments will trigger download only and not load). However, it can be useful to test quickly, how a specific PDF file is rendered in the DocumentViewer.

See Also