How to Disable the Toolbar in an HTML PDF Iframe
Learn why iframe parameters cannot reliably hide a PDF toolbar, and how to control PDF.js or Adobe Embed UI instead.
Short answer: an HTML <iframe> has no universal attribute for hiding the toolbar in a browser’s built-in PDF viewer. The iframe usually hands the PDF to a viewer supplied by the browser or operating system, and that viewer owns its toolbar. Identify the viewer first. If you control the viewer, configure its documented UI options; otherwise, replace the native viewer with one your application controls.
1. Identify which PDF viewer is rendering the file
The same markup can produce different controls in Chrome, Firefox, Safari, Edge, Adobe’s browser integration, or a custom viewer. Before changing code, check:
- Does the iframe show a browser-native PDF toolbar?
- Is the URL loading Adobe PDF Embed API?
- Is it loading a PDF.js viewer such as
web/viewer.html? - Is the PDF opened by a plugin or desktop integration?
Open developer tools and inspect the iframe src. If the source is only a .pdf URL, your page is not configuring the viewer’s internal controls.
2. Native PDF iframe: what you can and cannot control
<iframe
src="/documents/guide.pdf"
title="Product guide"
width="100%"
height="700"
></iframe>
This embeds the document, but it does not define the toolbar. URL fragments such as #page=2 may be interpreted by some viewers, yet toolbar flags such as toolbar=0 are not a reliable cross-browser HTML or PDF standard. A site cannot reach into a cross-origin viewer and hide its controls with CSS or JavaScript.
CSS applied to the parent page affects the iframe rectangle only:
iframe { border: 0; }
/* This cannot style the viewer inside the iframe. */
3. Adobe PDF Embed API: configure supported controls
If you need predictable controls and can use Adobe’s service, use its documented previewFile configuration rather than native iframe parameters. Adobe requires a client ID. The UI guide documents options including showDownloadPDF, showPrintPDF, showZoomControl, showThumbnails, and showBookmarks; behavior depends on the selected embed mode. See the Adobe PDF Embed API UI options and API overview.
<div id="adobe-dc-view"></div>
<script src="https://acrobatservices.adobe.com/view-sdk/viewer.js"></script>
<script>
document.addEventListener("adobe_dc_view_sdk.ready", function () {
const view = new AdobeDC.View({
clientId: "YOUR_ADOBE_CLIENT_ID",
divId: "adobe-dc-view"
});
view.previewFile({
content: { location: { url: "https://example.com/document.pdf" } },
metaData: { fileName: "document.pdf" }
}, {
embedMode: "SIZED_CONTAINER",
showDownloadPDF: false,
showPrintPDF: false,
showZoomControl: false,
showThumbnails: false,
showBookmarks: false
});
});
</script>
Choose only the controls your users need. Hiding download or print can conflict with accessibility, offline use, records requirements, or user expectations. Verify each setting in the embed mode you deploy.
4. PDF.js: control the viewer you host
PDF.js gives you a viewer application whose source and UI are under your control. Its documented URL options include page, zoom, named destination, sidebar mode, and the PDF file parameter. The options page does not document a toolbar-visibility parameter, so do not rely on toolbar=0. Check the version you deploy because the cited options page is an older wiki entry.
<iframe
title="PDF.js document viewer"
src="/pdfjs/web/viewer.html?file=%2Fdocuments%2Fguide.pdf#page=2&zoom=page-width&pagemode=none"
width="100%"
height="700"
></iframe>
For a toolbar-free experience, fork or configure the PDF.js viewer source and remove or replace the toolbar components, then maintain that customization as PDF.js changes. Keep keyboard access, focus order, zoom, search, text selection, printing, downloading, and screen-reader labels in your design.
Reference: PDF.js viewer options.
5. Adobe Acrobat Read Mode is a user preference
Adobe Acrobat’s browser integration can open PDFs in Read Mode without standard menus, panes, and toolbars, while a floating toolbar can appear on hover. That behavior is configured in the reader’s preferences, not by the embedding website. It therefore cannot provide a consistent cross-browser result. See Adobe’s opening PDFs help.
6. When replacing the native viewer is the right fix
| Approach | Can your site control the toolbar? | What to plan for |
|---|---|---|
| Native PDF iframe | No reliable cross-browser control | Viewer differences and user preferences |
| Adobe PDF Embed API | Yes, through documented options | Client ID, embed mode, service integration |
| Hosted PDF.js customization | Yes, because you own the viewer code | Maintenance, accessibility, search, print, download |
| Custom page renderer | Yes | More implementation work and PDF feature coverage |
Pick the smallest solution that preserves the interactions your readers require. A toolbar may contain the only visible path to search, zoom, print, download, or accessibility features.
7. Troubleshooting
The toolbar is still visible after adding toolbar=0
Cause: the browser’s native viewer ignores the parameter. Fix: use a supported Adobe Embed option or a PDF.js viewer you control.
CSS does not hide buttons inside the iframe
Cause: iframe contents have their own document and, when cross-origin, are protected by the same-origin policy. Fix: style the viewer source itself, or host a controllable viewer on your origin.
Adobe controls do not change
Cause: an invalid client ID, unsupported embed mode, or an option that is not applicable to that mode. Fix: check the browser console, confirm the client ID and allowed origins, and compare your settings with Adobe’s UI guide.
PDF.js opens a blank page
Cause: the file query value was not URL-encoded, or the PDF is blocked by CORS/authentication. Fix: encode the file URL, allow the viewer origin, and verify that the PDF response is reachable with the required credentials.
Removing the toolbar breaks usability
Cause: users depended on search, zoom, print, download, keyboard shortcuts, or assistive technology labels. Fix: replace the hidden controls with accessible page controls and test keyboard and screen-reader flows before release.
8. Performance, reliability, and cost considerations
- Native iframe: simplest integration, but rendering and controls vary by browser and user settings.
- Adobe Embed: reduces viewer maintenance, while adding a service dependency and client configuration.
- PDF.js: gives the most UI control, but your bundle, worker setup, PDF size, and customization affect load time and maintenance.
- Custom rendering: can deliver a focused interface, but implementing text selection, search, accessibility, and pagination increases engineering cost.
For large documents, lazy-load the viewer when it enters the viewport, avoid loading duplicate PDF copies, and provide a normal document URL as a fallback. Measure first paint, time to first page, memory use, and interaction latency with the document sizes your users actually open.
9. Or skip the browser setup
If your goal is to produce a clean image or PDF of a page rather than display an interactive PDF viewer, ScreenshotNeo provides a single screenshot API request. Its capture flow removes cookie banners, newsletter popups, and chat widgets before the shot; bot checks, blank pages, timeouts, failed loads, and cache hits are not billed. Responses identify the page verdict and billing status with X-Page-Verdict and X-Billed headers. An MCP server lets Claude, Cursor, and other MCP clients call take_screenshot, get_page_info, and capture_pdf.
See the ScreenshotNeo documentation for all options. The following requests use the supplied API format:
cURL
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Python
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
Node.js
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' }); const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
Free accounts include 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 shots, and every feature is included on every plan. Create a free ScreenshotNeo account.
FAQ
Can JavaScript access a native PDF toolbar?
No. The toolbar belongs to the viewer document, and cross-origin restrictions prevent a parent page from manipulating it.
Is there a universal iframe attribute for this?
No. HTML defines the iframe container, not a standard PDF viewer toolbar API.
Should I hide download and print?
Only when that matches your product and policy requirements. Explain the available actions and preserve an accessible way to read the document.
Which option gives the most control?
A viewer you host and configure, such as a maintained PDF.js customization, gives direct control. Adobe Embed provides documented configuration without requiring you to own the entire viewer implementation.


