I am using MS Wopi when the file is open for the view so how to remove the edit option as seen in the image.
Asked
Active
Viewed 257 times
1

Alex Robbio
- 21
- 4
-
What have you tried? How did it work? – rajah9 Mar 11 '21 at 15:03
-
Does this answer your question? [WOPI how to remove edit icon](https://stackoverflow.com/questions/66635933/wopi-how-to-remove-edit-icon) – rocky Mar 20 '21 at 21:59
1 Answers
0
I have done something like this,
You can have Edit and View separate in the View. So I have passed some parameters with the session context in WOPI action URL to identify what is the operation.
Ex:
https://{_baseUrl}/wopi/files/{combinedDocumentId}?sc=<your value>&wopisrc={wopiHostUrl}
By checking that you can get value inside the Session Context with,
Request.Headers["X-WOPI-SessionContext"]
Keep in mind this value comes with Base64 encoded.
Then you need to decode it and pass it to the GetFileInformation function.
With that, you can set,
ReadOnly = true
UserCanWrite = false
for disabling edit on that iframe.

Sandun Isuru Niraj
- 493
- 5
- 14