Why is there no DenyDownloading in GroupDocs.Viewer.Options Permissions?

I’m currently trialing GroupDocs.Viewer in our .NET project for rendering PDF files. Everything is smooth, fast, and easy to integrate. We were hoping to use this API to display our PDF files to the user in a “read-only” mode. We want to restrict their ability to print, extract, modify, and download. However, the documentation on Permissions ( Permissions | GroupDocs.Viewer for .NET API Reference) has no option to deny downloads. Is there a reason for this? Are there any work-arounds? If not, what alternatives does GroupDocs.Viewer have to display PDF files in a “read-only” mode? Maybe converting the PDF file to a different format that is read-only? Please let us know, we really hope this API is the right solution for us.

@YahyaM

The GroupDocs.Viewer API does not include a specific option to deny downloads within its Permissions enumeration. The permissions available, such as DenyPrinting and DenyModification, are designed to control how the application interacts with PDF files, but the ability to restrict file downloads is not included in this scope.

This limitation means that managing download permissions must be handled on the client side. You can implement various strategies to prevent users from downloading files, such as:

  1. Client-Side Controls: You can create a user interface that does not provide download options. This could involve hiding or disabling buttons that allow file downloads.

  2. Disabling Browser Features: While not foolproof, you can attempt to disable features like the “Inspect Element” option in the browser to make it harder for users to access the file directly.

  3. Alternative Formats: If you want to display content in a read-only manner, consider converting your PDF files to formats that are inherently more difficult to download or manipulate, such as images or HTML, depending on your use case.

While these methods can help mitigate the risk of unauthorized downloads, it’s important to note that no solution is completely foolproof, as determined users may still find ways to access the files.

For more detailed information on the available permissions and how to implement them, you can refer to the GroupDocs.Viewer for .NET API Reference.

If you have further questions or need assistance with specific implementations, feel free to ask!

Sources:
[1]: Deny downloading a source file XL#84182

Hi @YahyaM

Thank you for interest in GroupDocs.Viewer. Please clarify what exactly are you trialing: the GroupDocs.Viewer for .NET UI-less API or the GroupDocs.Viewer for .NET UI?
If the 2nd one - the “Download PDF” button can be disabled as it is described here: Hide Download PDF button.

With best regards,
Denis Gvardionov

1 Like

Hi Denis, thanks for the quick response! I’m using GroupDocs.Viewer for .NET UI-less. Is it possible for this API? If not, I will definitely make the switch to the .NET-UI API! Thanks again.

Hi @YahyaM ,

Thanks for the response, let me make a step back and explain all in details.

1. GroupDocs.Viewer is a UI-less library. Basically, it is a DLL, and you can interact with it only programmatically, through the public API. In a nutshell, the GroupDocs.Viewer is a kind of a complicated converter, which obtains on input a variety of the supported input formats (list) and converts them to 4 possible formats: HTML, PDF, PNG, or JPEG. You can select into which format you want to convert the specified document by using the ViewOptions inheritors: HtmlViewOptions, PdfViewOptions, PngViewOptions, and JpgViewOptions. By design, the GroupDocs.Viewer can be used in any application, including Windows Forms, Console, WPF, Android, iOS, web-application and so on. From this perspective the “deny downloading” option has no any sence, because “deny downloading” from where? From console application or Windows Forms? It’ like “deny downloading” option for output files, generated by the console-based FFMpeg.exe on the local machine.

2. The Permissions enumeration, which you have cited in your original post, controls the permissions in the generated output PDF file, if you use the PdfViewOptions. For example, you have input DOCX, and you want to convert it to the resultant PDF, and you want to deny the ability for the users to print this resultant PDF, when you share it with your users. Then you use the Permissions.DenyPrinting, and the PDF viewer (like Adobe Reader or Foxit Reader), IF it supports such denial options (!!!), will deny printing option for the user, who opens this generated PDF in this reader. But this has no relation to the downloading the resultant PDF itself.

3. GroupDocs.Viewer for .NET UI is basically a wrapper around the previously explained GroupDocs.Viewer DLL. It is a open-source (MIT license ) ASP.NET Core web-application, basically, a solution, which consists of several projects, which internally use the GroupDocs.Viewer DLL and in a nutshell is a complex web-interface for the GroupDocs.Viewer DLL. It has its own control panel (screenshot), customizable toolbar, buttons, options, lots of different stuff, and there is a possibility to disable downloading on this control panel. The link I gave you in my plevious answer is exactly about it - tuning the toolbar in order to hide the “Download” button from it.

4. Concluding.
4.1. If you already have or want to build a web-application, where you have a web-site, where users can view the different documents like DOCX, PDF, XLSX, PPTX, XPS, PSD, AI, ZIP, SVG, and others right on the web-site from their web-browser, without downloading them locally and installing 3rd party software on their local computers to open these documents, AND the GroupDocs.Viewer for .NET UI web-UI is acceptable for you, you can use it. It internally uses the GroupDocs.Viewer DLL, but for you there is no need to develop you own web-UI - you already have it.
4.2. If you want to use the GroupDocs.Viewer not in the web application, or existing GroupDocs.Viewer for .NET UI is unacceptable for you, you need to develop your own GUI for the GroupDocs.Viewer, which will pass the input files to the GroupDocs.Viewer public API and obtain the resultant converted files from it and show them to the users. In that case it is up to you and your code to allow or deny the file downloading.

Hope this will help to make a right choise.

With best regards,
Denis Gvardionov

1 Like

Hi Denis, thank you very much for this detailed response! You really helped me understand the functionality and options of GroupDocs.Viewer very well. We’ll definitely look into the .NET UI option as it will meet our needs. Thanks again.

1 Like