Lets say I have a document:
https://{tenant}.sharepoint.com/sites/{site-collection}/Shared%20Documents/Document.docx
Then I can use the "endpoint" _layouts/15/embed.aspx?Id=
for an url that I can use to embed that document:
https://{tenant}.sharepoint.com/sites/{site-collection}/_layouts/15/embed.aspx?Id=/sites/{site-collection}/Shared%20Documents/Document.docx
How can I modify that url to hide the border and the page control?
Where can I find a documentation on the supported query arguments?
Is it possible to use this api endpoint to modify the resulting view? For example hide the border and the page navigation?
I asked some AI chat about the query options and it suggested some options. However, none of them seems to work except the Id.
Id
: Specifies the document ID or URL of the document to be embedded. (Required)Related:
https://sharepointstuff.com/2021/03/30/useful-sharepoint-urls/comment-page-1/
I did not find extra query options and the result of embed endpoint contains a nested iframe structure where content is loaded in several steps.
Thefore, I applied following css workaround to hide the pagination control and "zoom in" to hide the borders for embedded Word documents:
div .ItemPreview-detailsBar {
display: none;
background-color: red;
}
#WebApplicationFrame {
margin-left:-15px;
margin-top:-15px;
width: 108%;
height: 108%;
background-color: white !important;
}