PDF Embed Generator

Show a PDF menu, price list or brochure right on your page instead of a download link. Paste the file’s address and copy the free embed code — no sign-up needed.
A direct link to the file, a Google Drive or a Dropbox link, e.g. https://example.com/menu.pdfWant your PDF to turn like a real book?
Works in most desktop browsers; Google Drive ignores it.
Works in Chrome and Edge; other browsers and Google Drive ignore it.

Embed the PDF

<iframe src="https://files.elfsight.com/storage/_assets/pdf-embed/files/embed-pdf-file.pdf" title="PDF document" width="100%" height="800" style="border:0;" loading="lazy"></iframe>
<p style="margin:4px auto 0;text-align:center;font:11px/1.4 -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;color:#a3a7b0;">Created with <a href="https://elfsight.com/tools/pdf-embed-generator/" target="_blank" rel="noopener" style="color:inherit;text-decoration:none;">Elfsight</a></p>

  1. Click Copy code above to copy it.
  2. Open the page’s HTML file or template.
  3. Paste the code inside <body>, where the content should appear.
  4. Save and upload the page, then open it in a browser to check.

Brochure, catalog or magazine? The Flipbook widget turns your PDF into an interactive flipbook that visitors page through like a real one — with search, a table of contents, and download and print buttons. See Flipbook →

Before you go

Brochure, catalog or magazine? The Flipbook widget turns your PDF into an interactive flipbook that visitors page through like a real one — with search, a table of contents, and download and print buttons.

See Flipbook →
Or share this free tool:
Flipbook widget

Turn your PDF into a flipbook

Show brochures, catalogs and magazines as interactive flipbooks right on your site. Upload a PDF, pick a template, and visitors page through it, search the text, jump from the table of contents, download or print it.
  • Pages that turn like a real book

  • Search and a table of contents

  • Download, print and share buttons

Embed code vs a plain link to the PDF

A link is the simplest way to share a PDF, but it sends visitors away from your page. The embed code keeps the document on the page and still gives them the link.
A plain link to the PDF
This generator
Where the document opens
Visitors leave your page, or the PDF opens in a new tab
The PDF shows inside your page
Google Drive and Dropbox files
A share link opens the service’s own page around the file
Turns a Drive link into its /preview address and a Dropbox link into raw=1, so only the document shows
Start page and fit to width
You can add #page= to the link by hand
Adds #page= and #view=FitH for you
If the PDF can’t be shown
Nothing else is needed: the link is the fallback
The <object> variant shows a link to the file in its place
Phones
The phone opens the PDF in its own viewer
Phone browsers handle embedded PDFs differently; the Google Docs viewer shows the pages on phones too

Where the document opens

A plain link to the PDF

Visitors leave your page, or the PDF opens in a new tab

This generator

The PDF shows inside your page

Google Drive and Dropbox files

A plain link to the PDF

A share link opens the service’s own page around the file

This generator

Turns a Drive link into its /preview address and a Dropbox link into raw=1, so only the document shows

Start page and fit to width

A plain link to the PDF

You can add #page= to the link by hand

This generator

Adds #page= and #view=FitH for you

If the PDF can’t be shown

A plain link to the PDF

Nothing else is needed: the link is the fallback

This generator

The <object> variant shows a link to the file in its place

Phones

A plain link to the PDF

The phone opens the PDF in its own viewer

This generator

Phone browsers handle embedded PDFs differently; the Google Docs viewer shows the pages on phones too

Embed options

Every option ends up in plain HTML that you can read and edit. Open parameters go after # in the PDF address; browsers that don’t support one simply ignore it.
Option
What it does
Values
Notes
PDF link
The file to show
A direct .pdf address, a Google Drive file link or a Dropbox shared link
Drive files must be shared as Anyone with the link. The address must start with https:// if your site does.
Embed as
The HTML element that holds the document
<iframe> or <object>
<object> shows the link inside it when the browser can’t display the PDF. Drive links always use <iframe>.
#page=
Opens the document at a given page
A page number, e.g. #page=3
Supported by the built-in viewers in Chrome, Edge, Firefox and Safari on Mac. Ignored by Google Drive’s viewer.
#view=FitH
Fits the page width to the frame
On or off
Works in Chrome and Edge. Firefox and Safari ignore it and use their own zoom.
Height
The height of the frame on your page
Pixels, e.g. 800
The width is 100% of the space you paste the code into.

PDF link

What it does

The file to show

Values

A direct .pdf address, a Google Drive file link or a Dropbox shared link

Notes

Drive files must be shared as Anyone with the link. The address must start with https:// if your site does.

Embed as

What it does

The HTML element that holds the document

Values

<iframe> or <object>

Notes

<object> shows the link inside it when the browser can’t display the PDF. Drive links always use <iframe>.

#page=

What it does

Opens the document at a given page

Values

A page number, e.g. #page=3

Notes

Supported by the built-in viewers in Chrome, Edge, Firefox and Safari on Mac. Ignored by Google Drive’s viewer.

#view=FitH

What it does

Fits the page width to the frame

Values

On or off

Notes

Works in Chrome and Edge. Firefox and Safari ignore it and use their own zoom.

Height

What it does

The height of the frame on your page

Values

Pixels, e.g. 800

Notes

The width is 100% of the space you paste the code into.

PDF Association: PDF fragment identifiers and browser support ↗

If the PDF doesn’t show

A blank frame or a “refused to connect” message

The server that hosts the file doesn’t allow other sites to show it in a frame (the X-Frame-Options header). Upload the PDF to your own site, Google Drive or Dropbox and use that link.

The PDF downloads instead of showing

The server sends the file as an attachment (Content-Disposition: attachment), or the visitor’s browser is set to download PDFs. Host the file where it’s served for viewing, or choose the Google Docs viewer.

On a phone the document is cut off, blank or downloads

Phone browsers handle PDFs in their own viewer, and an embedded PDF may not display fully or at all. Chrome on Android opens PDFs itself only on Android 12 and up and not in Incognito; otherwise the file is downloaded. Choose the Google Docs viewer, which shows the pages on phones too.

Google Drive asks visitors to sign in or request access

In Drive, open Share and set General access to Anyone with the link. On a work or school account your administrator may block this setting.

The page number or fit to width is ignored

Not every viewer supports these parameters: #view=FitH works in Chrome and Edge only, and Google Drive’s viewer ignores both. The document still opens, just at page 1 and the default zoom.

Nothing loads on an https site

A PDF address that starts with http:// is blocked as mixed content on a secure page. Use the https:// address of the file.

Which code to use for your document

Document
Code to choose
Why
Restaurant or café menu
Google Docs viewer
Most guests open menus on a phone, and the Google viewer shows the pages there too
Price list
<object> with the fallback link
A short document; if the browser can’t show it, visitors still see a link in its place
Brochure or catalog
<iframe> with #page= for the section the page is about
Visitors land on the right page instead of the cover
Form to print and fill in
Any variant
People save or print it from the viewer’s own toolbar; the embed is a preview
File kept in Google Drive
Drive link, converted to /preview
Shows the file in Drive’s viewer; set sharing to Anyone with the link; page parameters don’t apply
File kept in Dropbox
Dropbox link, converted to raw=1
Skips Dropbox’s preview page so the browser shows the PDF itself

Restaurant or café menu

Code to choose

Google Docs viewer

Why

Most guests open menus on a phone, and the Google viewer shows the pages there too

Price list

Code to choose

<object> with the fallback link

Why

A short document; if the browser can’t show it, visitors still see a link in its place

Brochure or catalog

Code to choose

<iframe> with #page= for the section the page is about

Why

Visitors land on the right page instead of the cover

Form to print and fill in

Code to choose

Any variant

Why

People save or print it from the viewer’s own toolbar; the embed is a preview

File kept in Google Drive

Code to choose

Drive link, converted to /preview

Why

Shows the file in Drive’s viewer; set sharing to Anyone with the link; page parameters don’t apply

File kept in Dropbox

Code to choose

Dropbox link, converted to raw=1

Why

Skips Dropbox’s preview page so the browser shows the PDF itself

How to embed a PDF

  1. Upload the PDF

    Upload the file to your site, cloud storage or Google Drive and copy its link.

  2. Pick a viewer

    The browser’s viewer is the simplest; the Google viewer looks the same in every browser.

  3. Paste the code

    Add the code to an HTML block on your page.

Frequently asked questions

More Embed Code Generators

iFrame Generator

Build a responsive iframe for any page, form or app.iFrame Generator