logo
search
SharePoint Document Issues

How to Embed a Public SharePoint PDF on an External Website

Aamir Naveed AkramAamir Naveed Akram Sep 25, 2026 869 views

Question details

The user needs to embed a SharePoint-hosted PDF into an external website so that all visitors can view the document without being prompted to sign in to a Microsoft account.

How to Embed a Public SharePoint PDF on an External Website
Product
Microsoft SharePoint
Device & OS
not provided
Scenario
Displaying a PDF hosted on SharePoint on a public-facing external webpage using an iframe embed code.
Observed behavior
The embedded PDF successfully loads for the file owner but displays an access-denied message or a sign-in prompt for public visitors and users in private browsing mode.
Before you start

Verify with your Microsoft 365 IT administrator that your organization's SharePoint tenant policies permit anonymous external sharing and iframe embedding for documents.

Solution 1Recommended

Generate an Anonymous Sharing Link

Create an 'Anyone with the link' URL in SharePoint to grant public viewing access without requiring visitor authentication.

SharePoint files default to restricted access based on your organization's directory. To embed a file publicly in an iframe, you must generate a special sharing link that explicitly bypasses the sign-in requirement.

1
Open File Sharing

Navigate to your SharePoint document library, locate the target PDF file, right-click it, and select 'Share' from the context menu.

2
Adjust Link Settings

Click the gear icon or the current link scope button, then select 'Anyone with the link' under the sharing settings to enable anonymous access.

3
Copy and Embed

Click 'Apply' and then 'Copy link'. Replace the restricted SharePoint document URL in your website's iframe HTML tag with this newly generated public link.

Generate an Anonymous Sharing Link
Tenant Restrictions: If the 'Anyone with the link' option is grayed out or unavailable, your tenant administrator has disabled anonymous external sharing for security reasons.
Free Microsoft Office alternative

Easily Manage and Edit PDFs with WPS Office

While SharePoint limits how you host and share documents online, creating and editing professional PDFs doesn't have to be complicated. WPS Office is a free, lightweight alternative to Microsoft Office that offers a comprehensive suite of built-in PDF tools.

Seamless compatibility with Microsoft Word, Excel, PowerPoint, and PDF document formats.Built-in PDF toolkit allows you to read, edit, annotate, and compress PDF files easily without third-party software.Lightweight design ensures incredibly fast launch times and smooth performance, even on older devices.Familiar, intuitive user interface makes document creation and migration completely effortless.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my embedded SharePoint PDF show an access denied error?

By default, SharePoint requires users to authenticate to view files. If you use the standard browser URL in an iframe, visitors who are not logged in or do not have explicit permissions will be blocked by SharePoint security policies.

How do I test if my PDF embed is working for public visitors?

Open your external website in an incognito or private browsing window where no Microsoft accounts are currently signed in. If the PDF displays correctly without asking for credentials, your public access is successfully configured.

Can I force SharePoint to allow iframe embedding on my domain?

SharePoint administrators can use the 'HTML Field Security' configuration in Site Settings to allow or restrict specific external domains from embedding SharePoint documents. Ensure your website's domain is added to this allowed list if iframe restrictions are active.