Blocking PDF downloads

0
Customer want to restrict downloading of certain PDF's that are currently shown using the File Document Viewer. Is there a way to restrict showing the "download" button ?
asked
2 answers
5

Hi Lex,

  If I understand correctly, you are interested in removing the 'download' button in the Document Viewer widget itself, the one that renders in the black bar of the viewer next to the print icon, correct?

  That command comes from the pdfjs library and not from the widget itself.  There isn't a setting in the widget that allows you to overwrite, so I believe changing this will involve changing the widget.  Specifically, if you open the widget package, you can see the 'lib' folder.  In there, you can see the pdfjs\web\ folder that contains the html that renders the pdf viewer that the Mendix widget wraps around.  In the viewer.html file, the toolbar buttons are defined.  You could remove the one labeled 'download' and that would likely remove the button.  To remove the button, you are changing the underlying library for the widget, which does have some risks because your widget differs from the app store version.  Even with this change, I don't think there is a way to stop someone from saving or screen-shoting the document anyway. If downloading the pdf is a  major concern, maybe there is a process conversation that needs to be had somewhere?

I hope this helps,

Rob

answered
0

There is in version 7: surround your button with a container and change the container's Visibility from the standard Default to (by clicking Edit next to it) 'Based on an expression'. 

And you can do this in the button itself too, by the way.

answered