Embed PDFs as Webifier content pages with normal site navigation, page data, comments, and download/open controls.
webifier.pdf registers content renderers for .pdf files and pdf=...
links. When enabled, a PDF link creates a real Webifier content page instead
of only copying the PDF as a static asset.
config:
webifier:
extensions:
site:
uses: webifier.standard
pdf:
uses: webifier.pdf
The generated page keeps the Webifier header, navigation, footer, optional
comments, and page navigation. The PDF itself is embedded below the page
chrome, with optional Open PDF and Download links.
Use pdf=... when you want Webifier to create a PDF content page:
pdf_example:
label: PDF Example
content: |
Open the [tiny PDF](pdf=pages/user-guide/extensions/examples/tiny.pdf).
Open the tiny PDF.
If webifier.pdf is not enabled, pdf=... falls back to the older behavior:
Webifier copies the PDF file and links directly to it.
Put a page.yml beside the PDF to control the generated page title,
page chrome, PDF controls, and any structured sections that should render
after the embedded document.
papers/
index.pdf
page.yml
title: Efficient Neural Network Encoding
meta:
description: A paper rendered as an embedded PDF page.
config:
pdf:
download: false
toolbar: true
height: min(82vh, 1100px)
comments:
kind: comments
label: false
If no title is provided, Webifier uses the PDF filename and turns dashes into readable words.
config is reserved for renderer controls and is not rendered as content.
Other keys, such as comments, authors, or related, can be rendered by
the normal content-page flow after the PDF.
PDF options live under the pdf config key. Site-wide defaults are normally
set on the PDF extension instance, and per-PDF overrides go in the PDF's
sibling page.yml under config.pdf.
The first-party extension contributes these defaults:
config:
webifier:
extensions:
pdf:
uses: webifier.pdf
height: min(82vh, 1100px)
toolbar: true
download: true
view: FitH
Options:
height: CSS height for the embedded PDF frame.toolbar: show or hide the Open PDF link.download: show or hide the Download link.view: PDF fragment view mode appended to the embedded URL, such as
FitH; set it to an empty value to skip the fragment.Per-page override:
title: Appendix
config:
pdf:
toc: false
download: false
toolbar: false
height: 72vh
view: ""
PDF pages default config.content_pages.toc to false, because the
embedded document usually owns its own structure. You can still opt in from
page.yml if the surrounding page has generated headings you want in a
Webifier table of contents.
A PDF has no page preface inside the file, so its page-local contract lives
in a sibling page.yml.
reports/
index.pdf
page.yml
title: Final Report
header:
title: Final Report
description: Embedded PDF with Webifier page chrome.
config:
pdf:
toc: false
download: true
toolbar: true
height: min(82vh, 1100px)
authors:
kind: people
content:
- name: Dorothy Vaughan
role: Author
comments:
kind: comments
label: false
The config.pdf block controls the embedded document frame, actions, and
PDF page behavior such as toc. The authors and comments keys render
below the embedded PDF.
A PDF content page is still a normal Webifier page. That means other extensions can participate:
webifier.theme controls the surrounding page colors.webifier.comments can add a discussion block below the document.webifier.standard can include back/home/next navigation.Browser PDF viewers vary slightly between Chrome, Safari, Firefox, and
mobile browsers. Webifier embeds the PDF with a plain <iframe> and keeps
direct open/download links available for readers whose browser handles
embedded PDFs differently.
Enable the extension:
config:
webifier:
extensions:
site:
uses: webifier.standard
pdf:
uses: webifier.pdf
Link from Markdown:
[Read the paper](pdf=papers/index.pdf)
Add sibling page controls:
title: Read the Paper
config:
pdf:
toc: false
download: true
toolbar: true
authors:
kind: people
content:
- name: Vahid Zehtab
role: Author
website: https://vahidz.com
Link from a links section:
papers:
kind: links
label: Papers
content:
- text: Read the paper
link: pdf=papers/index.pdf
description: Rendered as a PDF content page.
Override the .pdf or pdf content renderer when you need a different PDF
experience, such as PDF.js, extracted text, thumbnails, annotations, or a
custom document shell.
config:
webifier:
extensions:
pdf:
uses: webifier.pdf
lab_pdf:
uses: my_lab.pdf
override: true