<span class="mw-page-title-namespace">Template</span><span class="mw-page-title-separator">:</span><span class="mw-page-title-main">Pdf</span>
Fabrice P. Lauss𝕪’s ℤebuine Web

Links to an uploaded PDF, and on request shows it on the page.

Example

Lw-HPM-2026-Abstract-Laussy-0D8wU.pdf 

Use

{{pdf|Lw-HPM-2026-Abstract-Laussy-0D8wU.pdf}} — the file name followed by the icon, both linked to the file itself (not to its description page), so that a click opens the PDF.

{{pdf|Lw-HPM-2026-Abstract-Laussy-0D8wU.pdf|The abstract}} — the same with words of your own in place of the file name. |label= does the same thing by name.

{{pdf|Lw-HPM-2026-Abstract-Laussy-0D8wU.pdf|view}} — a preview of the document, 600 px wide, with the link beneath it. The box takes the shape of the document's own first page (A4, US Letter, landscape), so a one-page abstract shows whole and exactly, with no scroll bar; a longer document is one page tall and scrolls through the others.

{{pdf|Lw-HPM-2026-Abstract-Laussy-0D8wU.pdf|view|400px}} — the width, like image syntax. A size by itself implies the preview, so {{pdf|name.pdf|400px}} is the same thing. 400x300px fixes the height as well, and the box then scrolls through whatever does not fit. |size= or |width= by name also work.

{{pdf|name.pdf|view|align=left}} — the preview is centred unless you say left or right.

{{pdf|https://example.org/paper.pdf|view}} — a PDF elsewhere, by its address.

The old forms

{{pdf}} is the icon alone, with the tooltip PDF file., and {{pdf|File:name.pdf}} or {{pdf|https://…}} the small icon alone linked there — which is how the bibliography templates use it. Both are exactly as before. It is the name without File: that gives the link with the name; put File: in front and add view, and that works too.

Notes

The link is made by Module:Pdf, and the preview is Widget:Pdf, which draws the pages itself with pdf.js at exactly the width of the box. It does not use the browser's own PDF viewer, which Chrome zooms a second time by the page's own zoom, so that it came out overzoomed with scroll bars. This way the preview also works on phones. A PDF on another site can be drawn only if that site allows it (CORS); otherwise the preview falls back to the browser's viewer. A file that is not on the wiki gives a red link, to upload it, and no preview.