Embed a document inline on a page Free

Embed one document as an always-visible viewer via shortcode, block or Elementor widget — free for PDFs, images and Google Docs links; Pro adds Office and media.

Updated August 16, 2026

The preview lightbox 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.
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.
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.

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 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 gains):

  • Office documents (Word, Excel, PowerPoint) — displayed with the Microsoft Office or Google viewer.
  • 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.
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 (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 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 are served through the same signed, short-lived URLs used for downloads — permission is checked on every request.

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 or a normal library layout 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 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.

Still stuck? Email support@getfiledeck.com.