How to hide upload button and does showdownload exist for annotation viewer?

How can I hide the file upload button on the toolbar? Also, does showdownload exist for the annotation viewer like it does for the other viewers?

Hello Jim,

Access rights management is slightly different in GroupDocs.Annotation for .NET than in GroupDocs.Viewer for .NET. Yes, you can enable or disable ability to export (this implies downloading too), upload, annotate and so on. In order to do this use “AccessRights” method which obtains “AnnotationReviewerRights” enumeration parameter. For example, if you want to allow user ability to view and annotate document, but to restrict ability to upload new document, download current and ability to detele existing annotations, use the next code:


<%= new WidgetFactory()
.Annotation()
.ElementId(“annotation-widget”)
.FilePath(“Quick_Start_Guide_To_Using_GroupDocs.pdf”)
.Width(600)
.Height(800)
.AccessRights(AnnotationReviewerRights.CanView | AnnotationReviewerRights.CanAnnotate)
%>


“AnnotationReviewerRights” also contains “CanExport”, “CanDelete”, “CanDownload” and “All” - this is flagged enum, so you can select any of its values. By default it has “All” enabled.

If you will have more questions please feel free to contact us.

I tried the suggested change and it did not work. I am still getting the upload button. Here is the code I am using. I also emailed the support email.



Thanks,



JIm




.Annotation()

.ElementId(“documentViewer”)

.FilePath( Request[“folder”] + “/” + Request[“doc”])

.Width(0)

.Height(800)

.ShowPrint(true)

.ShowFileExplorer(false)

.Zoom(80)

.ClickableAnnotations(false)

.AccessRights(Groupdocs.Common.AnnotationReviewerRights.CanDownload)

.ToHtmlString() %>

Hello Jim,

I’m sorry I misled you at the last time. GroupDocs.Annotation for .NET does not support disabling an “Upload file” button at this moment. You cannot disable it by using GroupDocs.Annotation.
But you can hide this button on client-side by using simple JavaScript code that I show you below:



Put this code on the ASPX page, behind the Annotation widget. This code simply removes “Upload” button from the Annotation header panel.

Also want to say that “.ToHtmlString()” is useless - this method is invoked by default and it make sense only on code-behind.

Please notify us if you will have any issues or questions, we will be glad to help you.