Skip to content

Commit 559a115

Browse files
Update using-file-preview.md
Changed to tip. I like the format more
1 parent ae7272a commit 559a115

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

docs/embedded/tutorials/using-file-preview.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ In order to preview a file in an `iframe`, you need to
1515

1616
1. Call Graph's driveItem preview endpoint and obtain the GetUrl
1717
1. Use the URL in an iFrame (or even open it in a new page)
18-
1. If you want to load the preview dynamically...
1918

2019
## Get the preview url using Graph
2120

@@ -48,9 +47,14 @@ The JSON response includes the preview URLs for each document. Use the one obtai
4847
}
4948
```
5049

50+
> [!TIP]
51+
> It is possible to remove the banner at the top by adding the parameter `nb=true` to the obtained URL. E.g.
52+
> `https://contoso.sharepoint.com/restOfUrl/embed.aspx?param1=value&nb=true`
53+
5154
> [!CAUTION]
5255
> Currently **getUrl** contains a parameter with an encrypted token that can only be used with your application. However, this may change in the near future and you may be asked to add an auth header as you do with other requests.
5356
57+
5458
## Use the URL in an `iframe`
5559

5660
The next step is simply to use the URL obtained in the previous step in a new page. You could have an endpoint in your application that serves a new page as similar to this one:
@@ -98,11 +102,3 @@ async function preview(driveId, itemId) {
98102
document.getElementById('preview').src = response + "&nb=true"; //Use nb=true to suppress banner
99103
}
100104
```
101-
102-
## Remarks
103-
104-
Embedded Preview is an offering from OneDrive. It is possible to remove the 'OneDrive' banner by adding the parameter `nb=true` to the url. E.g.
105-
106-
```html
107-
https://contoso.sharepoint.com/restOfUrl/embed.aspx?param1=value&nb=true
108-
```

0 commit comments

Comments
 (0)