How do I hide the EDIT IN WORD
command in Word Web App when viewing a PDF? Is it possible to hide it per-site or per-library?
-
You can try injecting some script and hide particular element if the Word Web App allows. If it doesn't work, then there is no other way. Most probably this is not possible as per my thinking because it is Office UI that you cannot change. (They don't allow such customizations).– Pradip R.Dec 23, 2015 at 5:54
-
1Seems the simplest way is to make the library read-only for users. Unfortunately we use a workflow to create the PDF document in the library - and we want it to show-up with the users modification history (rather than a system account).– PeterXDec 24, 2015 at 2:06
-
Did you get any solution for this?– Hemant KabraJan 18, 2017 at 10:29
1 Answer
I used the URL contained in the ServerRedirectedEmbedURL, managed property of the document library as the source attribute on an iframe, to load up a view only version of the document in the appropriate Web App (Word, in the case of PDFs).
I implemented this through JavaScript in one of my SharePoint 2013 hosted applications, but with some tweaking you can also use it in custom templates.
Elio Struyf wrote up a nice blog on managed properties, which can be found here https://www.eliostruyf.com/three-useful-managed-properties-for-working-with-office-web-apps/.
He provides some good examples and continues to explain that you'll need to add the the managed properties to the ManagedPropertyMapping attribute inside the display template, in order to use them. Below is a code snippet from Elio showing how to do just that.
<mso:ManagedPropertyMapping msdt:dt="string">'Link URL'{Link URL}:'Path','Line 1'{Line 1}:'Title','Line 2'{Line 2}:'','FileExtension','SecondaryFileExtension','ServerRedirectedEmbedURL','ServerRedirectedPreviewURL','ServerRedirectedURL'</mso:ManagedPropertyMapping>
-
Can you post some important things from the blog please, like code snippet, description etc. This will add value to your answer. Sometimes links break hence its good to have content in your answer :). Feb 10, 2017 at 9:42
-
1