logo
search
SharePoint Document Issues

How to Resize the SharePoint File Viewer Web Part

Camila MilosovichCamila Milosovich Oct 22, 2026 868 views

Question details

Users need a way to resize the SharePoint File Viewer web part so that it properly matches the displayed document's dimensions.

How to Resize the SharePoint File Viewer Web Part
Product
SharePoint
Device & OS
not provided
Scenario
Displaying a document on a SharePoint site page and attempting to adjust the viewer window to prevent awkward scrolling or layout issues.
Observed behavior
SharePoint lacks a built-in option to resize the File Viewer web part natively, causing limitations in how documents are presented on modern site pages.
Before you start

Ensure you have editing permissions for the SharePoint site page and have access to the document you wish to display.

Solution 1Recommended

Use the Embed Web Part as a Workaround

Since the native File Viewer cannot be freely resized, using the Embed web part allows you to manually specify custom dimensions using iframe attributes.

The Embed web part acts as an alternative by allowing you to inject HTML iframe codes directly onto your SharePoint page. This gives you manual control over the width and height properties.

1
Generate the embed code

Navigate to the document in your SharePoint document library or OneDrive. Open the file, click on 'File', select 'Share', and then choose 'Embed'. Copy the provided iframe code.

2
Edit the SharePoint page

Go to the SharePoint site page where you want to display the document and click 'Edit' in the top-right corner to enter edit mode.

3
Add the Embed web part

Hover over the canvas, click the '+' icon to add a new web part, and select 'Embed' from the available list of web parts.

4
Adjust the dimensions

Paste your copied iframe code into the Embed web part's property pane. Locate the 'width' and 'height' attributes in the code (e.g., width="100%" height="600px") and modify them to your desired size, then republish the page.

Use the Embed Web Part as a Workaround
Best Practice: Using percentages for the width (like 100%) ensures the web part remains responsive on different screen sizes, while using a fixed pixel value for height usually works best.
Free Microsoft Office alternative

Experience Superior Document Processing with WPS Office

While SharePoint web parts have display limitations online, your local document editing shouldn't be restrictive. WPS Office is a free, lightweight Microsoft Office alternative offering comprehensive format compatibility, a familiar UI, and a seamless migration path for all your document needs.

  1. 1. Download the software: Visit the official WPS Office website to download the free installation package tailored for your operating system.
  2. 2. Install quickly: Run the lightweight installer and follow the straightforward prompts to set up the software in just a few minutes.
  3. 3. Edit your files seamlessly: Launch WPS Office and open your existing Office files instantly without losing any layout or formatting data.
Highly compatible with Microsoft Word, Excel, and PowerPoint file formats (.docx, .xlsx, .pptx).Flexible, feature-rich document viewing and editing modes optimized for your screen.Lightweight application with fast startup, minimizing device resource usage.Familiar user interface ensuring a zero-learning-curve seamless migration.
microsoft office alternative - wps office

Frequently Asked Questions

Can I make the SharePoint File Viewer web part auto-resize based on document length?

Currently, SharePoint does not offer a native auto-resize feature for the File Viewer. The web part maintains a fixed default container size, requiring users to scroll vertically for longer documents.

What is the primary difference between the File Viewer and Embed web parts in SharePoint?

The File Viewer is specifically designed for displaying Office files and PDFs directly with native Microsoft controls but has limited layout adjustments. The Embed web part allows you to use customized iframe codes, giving you explicit manual control over the container's height and width attributes.

Will modifying the iframe width and height in the Embed web part distort my document?

No, changing the dimensions in the Embed web part only changes the outer viewer window size, not the document's internal aspect ratio. The document will scale or provide scrollbars accordingly based on the space available.