What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

To embed a PDF in HTML, set an <iframe> element’s src to the PDF’s URL, give the frame a useful title and height, and place a separate link to the PDF beside it. The browser—not your page’s JavaScript—usually supplies the PDF viewer. A direct link remains important because an iframe has no HTML fallback content for a PDF that a browser cannot display.

Embed a PDF with an iframe

Use the PDF’s reachable URL as the frame’s src. For a file stored in your site’s files directory, a basic example is:

<iframe
  src="/files/example.pdf"
  title="Example PDF"
  width="100%"
  height="600"
  loading="lazy">
</iframe>

<p>
  <a href="/files/example.pdf">Open or download the PDF</a>
</p>

Replace /files/example.pdf with the actual path or full URL of your PDF. The src attribute identifies the resource loaded in the iframe. The title should identify the document in context—for example, “2026 product manual” rather than the generic “PDF.” The separate link lets visitors open or download the document if the embedded viewer is unavailable or inconvenient.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What the browser does

When the URL serves a PDF, modern browsers commonly display it in their built-in PDF viewer inside the frame. The page itself is not converting the PDF into HTML. Display behavior depends on the browser, its PDF support, and the server’s response. MDN notes that an iframe can display a PDF using the browser’s built-in PDF viewer.

#1 Best Overall
Amazon Kindle 16 GB (2024 model) - Light and compact, with fast page turns, and high contrast ratio - Matcha
  • The lightest and most compact Kindle - Now with a brighter front light at max setting, higher contrast ratio, and faster page turns for an enhanced reading experience.
  • Effortless reading in any light - Read comfortably with a 6“ glare-free display, adjustable front light—now 25% brighter at max setting—and dark mode.
  • Escape into your books - Tune out messages, emails, and social media with a distraction-free reading experience.
  • Read for a while - Get up to 6 weeks of battery life on a single charge.
  • Take your library with you – 16 GB storage holds thousands of books.

Give the frame usable dimensions

Set a width and height, either as HTML attributes or with CSS. A width of 100% allows the frame to fill its containing block; a height such as 600 pixels provides a starting viewport, not a guarantee that an entire multipage document will be visible at once. Visitors use the PDF viewer’s own scrolling controls to move through the document.

The parent page generally cannot discover the embedded PDF’s dimensions and automatically size the iframe to its pages. Choose a height that suits the surrounding layout, then test it at desktop and narrow viewport widths. A very short frame forces extra scrolling within the viewer; an excessively tall one can push the rest of the page far below the fold.

Make the iframe fit responsive layouts

An iframe with width="100%" can follow the width of its parent, but the parent still needs room to display it and the height remains your decision. CSS gives you more control over the frame’s dimensions:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
ECOPAD 10.1 Inch Tablet, Android 15 Tablets 12GB(4+8) RAM / 64GB ROM / 1TB SD Card Expansion, 1280x800 IPS HD Touchscreen, 6000mAh Battery, Bluetooth 5.0, Dual Cameras, GMS, Dual Band WiFi, Black
  • Latest Android Tablet - This android tablet features a quad-core processor, android 15 OS and a 10.1" IPS screen, its smooth operation enables seamless video playback, gaming, and multitasking.
  • 12GB RAM/64GB ROM + 1TB Expand - With ample storage capacity that can be expanded up to 1TB via SD card (sold separately), you can confidently store all your photos, videos and files without concerns.
  • IPS Display & Dual Camera - Equipped with 10.1" IPS 1280x800 HD screen, 2.0MP front camera/8.0MP rear camera, this android 15 tablet offers you a delightful experience while watching movies, reading books, or making video calls.
  • Long Battery Life - Built-in 6000mAh lithium battery, this android tablet provides up to 8 hours of uninterrupted video playback, enabling you to use it for longer periods without any interruptions.
  • Worry-Free Service - We offer comprehensive support to put your mind at ease. Our warranty lasts for 1 year. If you have any questions, please don't hesitate to contact us. We will respond promptly and assist you in resolving any issues.
.pdf-frame {
  display: block;
  width: 100%;
  height: 75vh;
  min-height: 24rem;
  border: 0;
}

Apply the class to the iframe:

<iframe
  class="pdf-frame"
  src="/files/example.pdf"
  title="Example PDF"
  loading="lazy">
</iframe>

This example makes the height track the viewport while preserving a minimum height. Adjust those values to your design and verify the result on a small screen. Responsive width does not make PDF pages themselves reflow like ordinary webpage text; readers may need to zoom or open the file separately.

Add loading and accessibility details

Use a specific title

The iframe’s title describes the embedded content to people using assistive technology and helps distinguish the frame from other frames on the page. Make it meaningful and concise. The title does not replace a visible heading or link if visitors need to understand what the document is.

Consider lazy loading

loading="lazy" lets the browser defer loading the iframe until it is near the visible area. This can be useful when the PDF is lower down a long page. If the embedded document is immediately visible and central to the page, test whether delaying its appearance is desirable. Lazy loading does not change whether the browser can render the PDF.

Rank #3
HNVHNV Android Tablet 7 Inch Tablet, E-Reader, 6GB RAM 32GB ROM 1TB Expansion, Quad-core Processor, Dual Camera, WiFi, Bluetooth, Parental Control (Pink)
  • 【Android Tablet】Equipped with the latest Android system, it has stronger compatibility, faster response speed and smoother operation. It is GMS certified, pre-installed with Google Play, and supports social applications such as Facebook, Twitter, YouTube, and TikTok. It is very suitable for watching videos, online chatting, reading e-books, etc.
  • 【Smooth Performance】This tablet is equipped with a 1024x600 IPS touch screen, Unisoc SC7731E quad-core processor, 6GB memory (2GB + 4GB virtual memory), 32GB ROM, and the tablet storage space can be expanded to 1TB using an SD card, which can store everything you need.
  • 【Powerful Function】This is a cost-effective tablet. Affordable price and excellent configuration. Equipped with 2MP+5MP dual cameras, Bluetooth, 5G/2.4G dual-band WiFi, FM radio, speakers, 3.5mm headphone jack, etc. Suitable for reading, photography, video, music, etc., meeting most of your daily needs.
  • 【Child-friendly functions and parental control】Pre-installed Google Kids Space application, providing rich content suitable for different age groups. Equipped with a parental control mode, it allows you to filter content, set educational goals, and manage screen time limits based on your child's age, providing a safe use environment that does not require constant supervision.
  • 【Portable & Lightweight & Protective Case】​​- The tablet body is slim and lightweight, easy to carry. It can be easily put into a bag, backpack or even back pocket. In addition, the durable and environmentally friendly protective case can effectively protect your tablet from drops, scratches and dust. You can use it anywhere you want.

Keep the direct link visible

Do not rely on text placed between the iframe’s opening and closing tags as a fallback for a PDF that fails to load. For this use, provide an ordinary anchor outside the iframe. The link should point to the same PDF and describe the action, such as “Open or download the report.” This also gives mobile users a straightforward way to open the document outside the constrained frame.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check the PDF URL and server response

The browser must be able to reach the URL in src, and the server response affects what happens next. Confirm that the address serves the intended PDF rather than an error page, login screen, or unrelated HTML response. A server’s Content-Disposition header can influence whether a response is displayed inline or treated as an attachment download. If it is sent as an attachment, the browser may download the file instead of showing it in the iframe.

When you control the server, configure the PDF response for inline display if that behavior is appropriate for your site. Do not assume that changing HTML alone can override the response headers. Keep the direct link available either way: downloading may be the correct behavior for some documents or user preferences.

Rank #4
Amazon Kindle Scribe Colorsoft 64GB (newest model) — 11” paper-like color display — Write in notebooks, docs, and books. Read in any light. Pen included - Graphite
  • Our most advanced Kindle Scribe – Features an 11” Colorsoft display with front light, built-in notebook, AI tools, and support for popular cloud services.
  • Bring ideas to life in color – The custom-built Colorsoft display delivers high-contrast, paper-like color that’s easy on the eyes without distracting flashes when writing.
  • Get a pen-on-paper feel: The textured surface and responsive display create a smooth, paper-like writing experience. Plus, the included pen never needs charging and has a built-in eraser and shortcut button for tools like the highlighter.
  • More room to read, write, and think – Just 5.4mm thin and 400g light, with fluid performance and a large 11" display that gives you space to work comfortably.
  • Get more out of your notes – Take notes in the built-in notebook, then use AI to find information, ask questions about what you’ve written, and generate summaries. You can also clean up handwriting or convert it to text.

Handle cross-origin PDFs and security policies

A PDF hosted on another origin can often be embedded if that host permits it and its response is accessible to the browser. However, the same-origin rules restrict a parent page’s JavaScript from inspecting a cross-origin iframe document. Do not build a feature that assumes your page can read the PDF viewer’s internal DOM or determine its page state.

If your site uses Content Security Policy (CSP), check the directive that applies to the embedding element. The iframe’s source is controlled by frame-src; an origin omitted from the policy can be blocked even when the URL itself works when opened directly. The object-src directive applies to <object> and <embed> instead.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Be cautious with the sandbox attribute

Adding sandbox to an iframe can restrict embedded content, but it can also prevent a browser’s built-in PDF viewer from loading correctly. If the viewer is blank after you add sandboxing, remove the attribute temporarily to determine whether it is the cause, then review the security requirement and browser behavior before choosing a policy. Do not assume sandbox is a harmless default for a native PDF viewer; the viewer already has its own protections for executable content.

Best Value
Sale
Gleeso Tablet, 2026 Latest 10 Inch Android 16 Tablet, 24GB+64GB+1TB TF, 6000mAh Battery, Fast Charging, HD Display, Widevine L1, Dual Camera, Face ID, Split Screen, Light, Portable
  • 【High Performance Android 16 Tablet for Smooth Work & Entertainment】:Looking for a responsive daily electronics computer? This Android 16 tablet is exactly the ideal tablet for adults you need. Powered by upgraded hardware and the newest android 16 system, this 10 inch tablet runs extremely smoothly. It loads apps fast, plays games without lag, and handles multitasking effortlessly. Whether for office work, web browsing or casual entertainment, this steady Android tablet always performs well. It’s a solid and budget-friendly tablet for your daily use.
  • 【24GB+64GB Large Storage & 1TB Expandable Memory Tablet】:Storage issues are totally gone with this 10 inch tablet! Equipped with 24GB RAM and 64GB internal storage, this robust Android tablet can run multiple apps and games simultaneously without slowing down. You can expand the memory up to 1TB with a TF card (not included) to store countless photos, videos and documents. Functional and user-oriented, this tablet for adults is a perfect daily electronics computer for work, study and entertainment.
  • 【6000mAh Long-Lasting Battery & Fast Charging 10 Inch Tablet】:This 10 inch tablet packs a 6000mAh large battery to support your all-day use! It keeps running steadily for video streaming, office work and web browsing, no need to charge frequently. The fast charging feature also saves your precious time, letting you get fully powered up quickly. Lightweight and sturdy, this trust-worthy tablet is a must-have daily electronics computer, and the reliable tablet fits both indoor and outdoor use perfectly.
  • 【10-Inch HD Display & Widevine L1 Certified Android Tablet】:Get a great watching experience on this tablet! The 10-inch 1280*800 HD screen delivers bright and clear visuals for reading, scrolling and video watching. Certified with Widevine L1, this premium tablet supports true full HD streaming on Netflix, Prime Video and other mainstream platforms, no more fuzzy compressed images. As a practical daily electronics computer, this 10 inch tablet brings you crisp, high-quality viewing anytime at home.
  • 【Dual Camera & Stereo Speaker Tablet for Multi-Scenario Use】:Designed for daily adult life, this all-round tablet comes with dual cameras, fast Face ID unlock and dual stereo speakers. The dual cameras support clear video calls and daily photography, and Face ID lets you unlock your device in seconds safely. Matched with immersive stereo sound, this Android tablet greatly upgrades your experience of watching movies, listening to music and chatting online. This versatile android 16 tablet is your perfect portable electronics computer for home, office and travel.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Iframe, object, or embed?

Element PDF fallback behavior Relevant controls and policy
<iframe> Does not provide child HTML fallback for a PDF that cannot be displayed. Put a direct link outside it. Supports controls such as loading="lazy" and referrerpolicy; source permission is governed by CSP frame-src.
<object> Can contain fallback HTML. Its embedded resource is governed by CSP object-src.
<embed> Does not offer the same child fallback pattern as <object>. Its embedded resource is governed by CSP object-src.

An iframe is a practical choice when you want browser-native display plus iframe controls such as lazy loading. If fallback markup inside the embedding element is a priority, consider <object>, but keep a separate direct PDF link as a useful escape route regardless of element choice. PDFs can be awkward on small screens, so let visitors open the file independently.

Troubleshoot a PDF iframe

  • The frame is blank: Open the src URL directly and verify it returns the intended PDF. Check browser developer tools and server logs for a failed request, then review any sandbox attribute and your CSP frame-src policy.
  • The PDF downloads instead of displaying: Inspect the response’s Content-Disposition header. An attachment disposition can cause download behavior; configure inline delivery if you control the server and want an in-browser viewer.
  • The frame shows an error or unexpected page: Check for a typo, redirect, access restriction, expired URL, or authentication requirement. A URL that works only in your logged-in session may not work for your visitors.
  • The PDF is clipped or difficult to use: Increase the iframe height, test the page at narrow widths, and keep the direct link visible so the reader can open the document separately.
  • The parent page cannot inspect the document: If the PDF is cross-origin, this is expected under same-origin restrictions. Do not rely on parent-page JavaScript to read the embedded viewer’s document.
  • The site’s policy blocks the frame: Allow the relevant PDF origin in CSP frame-src. For an object or embed alternative, check object-src instead.

Or skip the browser setup

If you need an image or PDF capture of a webpage rather than an embedded PDF viewer, ScreenshotNeo offers a one-call screenshot API. For example, this cURL request captures a page as WebP:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request options. ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are never billed. It also provides an MCP server so AI agents can take screenshots. The Free plan includes 1,000 screenshots per month with no card required; paid plans start at $5 for 3,000 screenshots. ScreenshotNeo is a webpage screenshot service, not a way to embed an existing PDF URL in an iframe. Learn about ScreenshotNeo or sign up for 1,000 free screenshots a month with no card.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Browser support

MDN labels the iframe element “Baseline: Widely available” and records cross-browser availability since July 2015. That describes iframe support, not a guarantee that every browser, device, or embedded PDF URL will display identically. The browser’s PDF viewer and the server response determine the document experience, so test the actual PDF in the browsers and layouts your audience uses.

Frequently Asked Questions

Can I use a relative URL for the PDF iframe?

Yes. A path such as /files/example.pdf is appropriate when the PDF is served from your own site at that path.

Does an iframe convert a PDF into webpage text?

No. The browser’s PDF viewer renders the PDF inside the frame; the iframe does not convert it to HTML.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.