问题
Recently, I would like to use the “edit mode” of Office Online Server to open the Microsoft Word file as follows:
http://office-online/we/wordeditorframe.aspx?WOPISrc=...&access_token=...
However, I notice that there is no gap between two consecutive pages, please see the following screenshot.
In addition, when I use the “view mode” to view a word document with wordviewframe.aspx, the presentation of page is normal.
http://officeonline/wv/wordviewerframe.aspx?WOPISrc=...&access_token=...
But this time I discover that the Edit in Browser button(in the top right-hand corner)cannot be used.
I have added the attributes such as
HostEditUrl
, EditModePostMessage
in CheckFileInfo
described in official document.
So I have two questions:
1) How to let “edit mode” own the style of “view model”? Namely, there is some space between two word page.
2) How to switch to edit-mode from view mode?
Thanks very much.
回答1:
1) This might actually be a bug in the OOS. Can you verify that the problem persists when you switch the <ui=UI_LLCC&><rs=DC_LLCC&> to English locale & open a document written in English? Just to rule out this possibility.
2) The HostViewUrl
and HostEditUrl
is supposed to lead to a "host page" - an HTML page which will host an iframe that points to an Office for the web application. => Not to the OOS URL directly.
回答2:
Your WOPI host (your own API which implemented WOPI Protocol) must,
Implement methods PutFile (to save updated file on your storage) and PutRelativeFile (to create a new file based on the current file, for example converting from .doc to be .docx).
Return following data in the response of CheckFileInfo operation.
2.1 SupportUpdate : true (to let WOPI Client know that your API implement the PutFile and PutRelativeFile methods)
2.2 UserCanWrite : true (to indicate that the use have Write permission over the file)
2.3 LicenseCheckForEditIsEnabled : true (to route user to Microsoft Login page to verify that the user have Office 365 license)
2.4 HostEditUrl : url_to_your_edit_page
NOTE: Your user need MS Office 365 license in order to edit file on WOPI..
来源:https://stackoverflow.com/questions/60540105/how-to-let-office-online-own-the-style-of-view-mode