# Embed a document inline on a page

*Collection: Displaying Libraries · Category: Configuration · Availability: FileDeck Free · Canonical URL: https://www.getfiledeck.com/docs/inline-document-embed/*

The [preview lightbox](https://www.getfiledeck.com/docs/document-preview/) opens a document in an overlay when a visitor clicks a button. Sometimes you want the document to be **always visible** in the page instead — a datasheet on a product page, a menu, a report embedded directly in your content. FileDeck's inline embed does exactly that, and it is a free feature.

## The shortcode

Embed a single document by its ID:

```
[filedeck_embed id="123" height="600"]
```

| Attribute | Default | What it does |
| --- | --- | --- |
| `id` | — | The document's ID (shown in the Documents list). Required. |
| `height` | `600` | Viewer height in pixels (120–4000). |
| `width` | full width | Viewer width — `640px` or `80%` (a bare number means pixels). |
| `engine` | site default | Viewer engine for PDF/Office files: `native`, `office`, `google`, or Pro's `pdfjs` — see below. |
| `page` | — | Start a PDF at this page: `page="5"`. Works with the [FileDeck viewer](https://www.getfiledeck.com/docs/pdf-viewer/#linking-to-a-page) and, in Chrome, Edge and Firefox, the browser's own viewer. |
| `download` | off | Set `download="1"` to show a download link under the viewer. |
| `fullscreen` | on | Set `fullscreen="0"` to remove the full-screen button. |
| `mode` | inline | Set `mode="popup"` (Pro) for a View button that opens the document in an overlay, loading it only when opened — see [the FileDeck viewer](https://www.getfiledeck.com/docs/pdf-viewer/). |
| `title` | off | Set `title="1"` to show the document title as a caption below the viewer. |

## The block and the Elementor widget

In the block editor, add the **FileDeck: Document Embed** block. Search for the document in the block sidebar, then set the height, width, viewer engine, download link, full-screen button and title caption. The editor preview matches the front end.

Using Elementor? The same viewer is the **FileDeck Document Embed** widget, with the same controls — see [Elementor integration](https://www.getfiledeck.com/docs/elementor-integration/).

## Which file types embed

**Free:**

- **PDFs** — rendered by the browser's built-in PDF viewer.
- **Images** — shown directly.
- **Google Docs, Sheets, Slides and Drive links** — add the pasted share link as an [external document](https://www.getfiledeck.com/docs/external-files/) and it embeds as a live document. FileDeck swaps the share link for Google's embeddable form automatically, so you don't need to publish-to-web first (the file's own sharing settings still apply — visitors can only see what the link lets them see).

**Pro** widens the set (the same types the [preview lightbox](https://www.getfiledeck.com/docs/document-preview/) gains):

- **Office documents** (Word, Excel, PowerPoint) — displayed by default with the Microsoft Office or Google viewer, or from your own site with [Office previews](https://www.getfiledeck.com/docs/office-previews/).
- **Audio and video** — played with an inline player.

A file type that cannot be shown (an archive, for example) falls back to a normal download button, so a visitor is never shown a broken viewer.

## Viewer engines

PDF and Office files can render through different engines. Each embed can choose one (`engine="…"`), and **Settings → Features → Document viewer** sets the site-wide default:

| Engine | What renders it | Notes |
| --- | --- | --- |
| `native` | The browser's built-in viewer | PDFs only. No external services are contacted — the privacy mode. An Office file under `native` falls back to a download button, because browsers cannot render Office formats themselves, unless [Office previews](https://www.getfiledeck.com/docs/office-previews/) has made a PDF of it. | 
| `office` | Microsoft Office web viewer | Office files. The file must be publicly reachable, because Microsoft's servers fetch it. |
| `google` | Google Docs viewer | PDFs and Office files. Same public-fetch requirement. |
| `pdfjs` | The [FileDeck viewer](https://www.getfiledeck.com/docs/pdf-viewer/) (Pro) | PDFs. Self-hosted — zoom, find, print, and it renders protected, signed and watermarked files no external viewer can. |

**Protected files never use an external viewer.** The Microsoft and Google viewers download the file from their own servers, which would hand a protected document to a third party. A protected PDF or image previews through its signed URL instead; a protected Office file that [Office previews](https://www.getfiledeck.com/docs/office-previews/) hasn't converted falls back to a download button. (Developers can restore the old behaviour with the `filedeck_external_viewer_for_protected` filter if that disclosure is acceptable.) 

## Access rules

The embed honours the same access rules as every other FileDeck surface. A visitor who is not allowed to view a document sees a padlock instead of the viewer, and protected files load through a signed link that expires after 15 minutes, made only for a visitor who passed the permission check. Download gates such as lead capture and terms apply to the embed's download link, not to the viewer.

Because an inline viewer loads as soon as the page opens, embedding is best suited to documents you are happy to show any visitor who can reach the page. For anything gated, the [preview lightbox](https://www.getfiledeck.com/docs/document-preview/) or a normal [library layout](https://www.getfiledeck.com/docs/shortcode-reference/) with access control is usually the better fit.

## FAQ

### How do I find a document's ID?

Open **Documents** in wp-admin and hover a document — the ID appears in the row, and in the URL when you edit it. The block's search picker sets the ID for you.

### Can I embed several documents on one page?

Yes — add as many `[filedeck_embed]` shortcodes or Document Embed blocks as you like. For a browsable set of documents, use a [library layout](https://www.getfiledeck.com/docs/shortcode-reference/) instead.

### My Google Doc shows "You need access".

The embed can only show what the link itself grants. Open the document's Share settings in Google and set it to "Anyone with the link can view" (or publish it to the web) — FileDeck embeds the link, it cannot change its permissions.
