# Obsidian - Linking to PDFs
![[images/Obsidian-Linking-to-PDFs.webp]]
[Watch on YouTube](https://www.youtube.com/watch?v=jANKIv5CV9k) · 14:41 · Josh Plunkett · 2023-02-11
> [!info] Written from the video's English automatic captions (fetched with yt-dlp on the first try) plus 1080p video frames, using the creator's chapter list as section anchors. File names, settings, and code are taken from what's on screen. The Dataview snippets are shown below as plain JavaScript blocks so they don't run inside this note.
## Outline
### 0:00 - Introduction to PDFs
- **0:00 - Tonight's topic.** After the series intro ("let's learn how to use the tool"), Josh says PDFs are a big part of the TTRPG world: a common format for adventures and rules. That's less true if you come from **D&D 5th Edition**, because **Wizards of the Coast** doesn't sell PDFs, but **Paizo** does. He's "swimming in PDFs" now that he plays **Pathfinder Second Edition**, since Paizo sells PDFs of all its content.
- **0:50 - Free RPG Day.** The demo uses PDFs Paizo releases for free through **Free RPG Day**, when several companies put out a free adventure or supplement to bring new people into the hobby. He gives the date as 17 June, the day before his birthday (18 June), and says his group used to celebrate with a free one-shot. That used to be from Paizo, and he recommends **We Be Goblins** ("a good laugh, especially with a few drinks around the table").
### 1:40 - The example note
- **1:40 - Where it lives.** He works in the **ObsidianTTRPGVault**, the tutorial vault he gives patrons, under *Tutorials / YouTube Series / Working with PDFs*.
![[images/Obsidian-Linking-to-PDFs-t0140.webp]]
*His "Working with PDFs" tutorial note: the drag-in explanation, the three link syntaxes (`[[PZO9500-18E - LTiBA]]`, `![[PZO9500-18E - LTiBA]]`, and `[[PZO9500-18E - LTiBA#page=5]]`), and an Example section embedding Little Trouble in Big Absalom on page 5 of 20, with the YouTube Series folder list (Advanced Tables, Buttons, Call Out Boxes, Dataview, Dice Roller, Excalidraw, Leaflet, TTRPG Statblocks, and more) in the sidebar.*
### 2:02 - Importing and viewing PDFs
- **2:02 - Drag them in.** PDFs are simple: drag one from another folder straight into the vault's file tree. He skips doing it again to avoid duplicating files.
- **2:30 - The attachment folder.** Drag a PDF into a note instead and Obsidian puts it in your attachment folder. Right-click any folder and choose **Set as attachment folder** to tell Obsidian where all external files (images, PDFs, and so on) should go. His three PDFs all landed in `z_Assets`.
- **2:55 - Free adventures.** Obsidian shows rendered previews of the adventures. All three are free: create a Paizo account and download them from Paizo's website.
- **3:17 - The setting to check.** In **Settings > Files & Links**, turn on **Detect all file extensions** so you can see these file types in the vault. He isn't sure it's still required but turns it on anyway. He also spots **Excluded files** ("I've never even looked into here") and notes it for later.
![[images/Obsidian-Linking-to-PDFs-t0205.webp]]
*Settings > Files & Links: Use [[Wikilinks]] and Detect all file extensions ("Show files with any extension even if Obsidian can't open them natively...") both on, Default location for new attachments set to "In the folder specified below," Attachment folder path `z_Assets`, and the Excluded files Manage button. The z_Assets folder behind it lists pasted images and the three PZO9500 PDFs.*
### 3:54 - Native PDF viewer features
- **3:54 - A quick tour.** Opening a PDF gives a page-by-page view that moves quickly. You can highlight text, and he checks that copying works ("yep, you can copy").
- **4:15 - Chapter mode.** An outline view lists the book's chapters and sections so you can jump around.
![[images/Obsidian-Linking-to-PDFs-t0290.webp]]
*Obsidian's built-in viewer on PZO9500-18E.pdf (page 5 of 20, 59%) in two-page view, with the outline panel open on Little Trouble in Big Absalom > Chapter 1: The Tomb (A1. Crypt Entrance through A7. Camilla's Lair, then Conclusion, Chapter 2: Upstairs!, Adventure Toolbox, and the OGL & Paizo Inc. Roster).*
- **4:25 - Toolbar.** Zoom, page count, **fit to page**, **rotate anticlockwise**, download, and a **two-page view** he thinks could be handy.
- **4:45 - Annotations.** There's a toggle to show or hide annotations, which only matters if you've already annotated the PDF in another program.
- **4:55 - Plugins he skipped.** Plugins exist for annotating and highlighting PDFs, but he didn't find any he loved. One was paid, the first paid Obsidian plugin he'd come across. This video sticks to native features.
### 5:32 - Linking and embedding PDFs
- **5:15 - Why bother?** You could keep the PDF open on another screen in Adobe Reader or any other viewer, so what does Obsidian add? Links.
- **5:32 - Plain link.** Link to a PDF just like a note or image: `[[PZO9500-18E - LTiBA.pdf]]`. Anyone who knows Obsidian will recognise the format.
- **6:03 - Embed.** Put `!` in front to show a rendered preview of the PDF in your note: `![[PZO9500-18E - LTiBA.pdf]]`.
- **6:15 - Jump to a page.** Add `#page=5` to open on a specific page: `[[PZO9500-18E - LTiBA.pdf#page=5]]`. His note's advice: "Instead of trying to remember this; make a template!"
![[images/Obsidian-Linking-to-PDFs-t0375.webp]]
*The tutorial note in reading view: plain link, `!` preview, and `#page=5` syntax, each wrapped in backticks so they display as code, above the Example section.*
- **6:35 - Put it together.** `![[PZO9500-18E - LTiBA.pdf#page=5]]` embeds Little Trouble in Big Absalom and skips straight to page five. In reading mode it briefly loads page one, then jumps to the page you set.
- **6:58 - About the backticks.** The backticks in his note mark code examples. Remove them when you use the syntax, or it won't render.
- **7:40 - Run straight from the PDF.** This saves the data entry of putting an adventure into your vault. Paizo's PDFs are good, so you don't have to transcribe every adventure word for word into your campaign manager. He does: he transcribes "the whole damn thing" into Obsidian, swaps in statblocks and encounter blocks, makes changes, and links magic items. But dropping in the PDF and linking related pages or chapters from your notes is much quicker.
- **8:48 - No `!`, just a link.** Without the exclamation mark it renders as a link you can hover over for a preview or click to open.
- **9:15 - Rename the link.** He renames it live with a pipe, `[[PZO9500-18E - LTiBA.pdf#page=5|Renamed Link]]`, and suggests a name like "Little Trouble page five." The hover preview is too small to read, but clicking opens the PDF on the right page.
### 9:55 - Automating with Dataview
- **9:55 - A PDF catalogue.** Dataview, which he's covered before, lists things in your vault, and it works on PDFs too. He found this **Dataview JS** snippet on a forum. It gets every file whose extension is `pdf` and lists each one as a link:
```javascript
// dataviewjs: list every PDF in the vault
const pdfFiles = app.vault.getFiles().filter(file => file.extension === 'pdf')
dv.list(pdfFiles.map(file => dv.fileLink(file.path)))
```
![[images/Obsidian-Linking-to-PDFs-t0625.webp]]
*The PDF Catalogue and PDF Catalogue with Folder sections in edit mode, each a short `dataviewjs` block. The Example link above now reads `[[PZO9500-18E - LTiBA.pdf#page=5|Renamed Link]]`.*
- **10:27 - The result.** Rendered, it lists A Fistful of Flowers, Threshold of Knowledge, and Little Trouble in Big Absalom ("see how quick that was"). On screen the vault-wide list also picks up a fourth file, `Aurora's Whole Realms Catalogue.pdf`.
- **11:00 - Limit it to a folder.** A second query adds a path filter so only PDFs in `z_Assets` are listed:
```javascript
// dataviewjs: list PDFs in one folder (z_Assets)
const pdfFiles = app.vault.getFiles().filter(file => file.extension === 'pdf' && file.path.includes('z_Assets'))
dv.list(pdfFiles.map(file => dv.fileLink(file.path)))
```
![[images/Obsidian-Linking-to-PDFs-t0650.webp]]
*Both catalogues rendered: the vault-wide list shows PZO9500-22E - AFoF.pdf, PZO9500-20E - ToK.pdf, PZO9500-18E - LTiBA.pdf, and Aurora's Whole Realms Catalogue.pdf; the z_Assets list shows only the three PZO9500 adventures. The Example section now shows the "Renamed Link."*
- **11:35 - Uses.** Make a landing page of all your PDFs that updates itself as you add more. He guesses smarter people could go further, perhaps by tagging PDFs.
### 13:01 - Final tips and conclusion
- **12:15 - His own approach.** He does use PDFs, but he copies them into notes, and he may make a (long) video on that later. For most people this is a quick way to keep everything in one place instead of hunting through another folder. You could link to magic items or monsters the same way.
- **12:55 - No plugins needed.** PDF linking is "out of the box support." Only the catalogue snippets need Dataview, and he adds a "requires Dataview" note to the example so nobody gets confused.
- **13:20 - Template it.** The notes will be in the patron vault. He recommends saving the snippets as a template you can insert with a hotkey (his is Alt+T), named something like "Insert PDF Catalogue."
- **13:44 - Wrap-up.** "PDFs are easy to work with." Like and subscribe. Patrons get his Discord, where people chat about Obsidian daily and help each other up the learning curve, plus the vault with every tutorial and code to copy and paste.
## Things mentioned
### Obsidian features (built in)
- **Built-in PDF viewer**: page thumbnails, chapter/outline view, text selection and copy, zoom, page count, fit to page, rotate anticlockwise, download, print, two-page view, and an annotations toggle
- **Settings > Files & Links**: **Detect all file extensions**, **Use [[Wikilinks]]**, **Default location for new attachments** ("In the folder specified below"), **Attachment folder path** (`z_Assets`), and **Excluded files**
- **Set as attachment folder**: right-click a folder to make it the default home for dropped images and PDFs
- **Drag-and-drop import**: drop files into the file tree or into a note
- **Link syntax for PDFs**:
- `[[file.pdf]]`: plain link
- `![[file.pdf]]`: embedded preview
- `[[file.pdf#page=5]]`: open on page 5
- `[[file.pdf#page=5|Display text]]`: renamed link
- **Hover preview** and click-through on PDF links
- **Edit mode vs reading mode** and backtick code formatting
- **Templates and a hotkey** (his is Alt+T) for inserting saved snippets
### Plugins
- **Dataview** (community plugin, free): runs the `dataviewjs` PDF catalogue queries using `app.vault.getFiles()`, `file.extension`, `file.path.includes()`, `dv.list()` and `dv.fileLink()`
- **PDF annotation and highlighter plugins**: mentioned but not shown or named. One was paid, the first paid Obsidian plugin he'd seen.
- Other tutorials in his YouTube Series folder: Advanced Tables, Buttons, Call Out Boxes (Admonitions), Custom CSS Files, Custom Frames, Dataview, Default New Tab Page, Dice Roller, Excalidraw, Front Matter (YAML) and Tags, JSON CSV Importer, Leaflet (Maps), Timelines, TTRPG Statblocks
### PDFs and games
- **Little Trouble in Big Absalom** (`PZO9500-18E - LTiBA.pdf`, 20 pages): Paizo Pathfinder 2e Free RPG Day adventure, used for every example. Chapter 1: The Tomb (A1. Crypt Entrance to A7. Camilla's Lair), Chapter 2: Upstairs!, and Adventure Toolbox show in the outline.
- **Threshold of Knowledge** (`PZO9500-20E - ToK.pdf`): free Paizo Pathfinder 2e adventure
- **A Fistful of Flowers** (`PZO9500-22E - AFoF.pdf`): free Paizo Pathfinder 2e adventure
- **Aurora's Whole Realms Catalogue.pdf**: a fourth PDF in his vault that only appears in the vault-wide catalogue
- **We Be Goblins**: the Paizo Free RPG Day adventure he recommends
- **Free RPG Day**: the yearly event when publishers release free adventures and supplements (he gives 17 June)
- **Pathfinder Second Edition**: the system he's playing now
- **D&D 5th Edition** and **Wizards of the Coast**: his example of a publisher that doesn't sell PDFs
- **Adobe Reader**: an external viewer you could use instead
### Links
- [Obsidian](https://obsidian.md/)
- [Official Obsidian Discord](https://discord.gg/obsidianmd)
- [Obsidian TTRPG Users Facebook group](https://www.facebook.com/groups/obsidianttrpgusers)
- [Josh's Patreon](https://www.patreon.com/JPlunkett)
- [Paizo](https://paizo.com/), where you get the free Pathfinder PDFs with a free account
### Free vs paid (quick)
- Free: Obsidian, the built-in PDF viewer and linking, the Dataview plugin, the Free RPG Day PDFs (with a Paizo account)
- Paid: Paizo's other PDFs, the paid PDF annotation plugin he mentions, and Josh's Patreon (tutorial vault, private Discord, and support)
## Bios
- **Josh Plunkett**: Australian game master and YouTuber behind the "Obsidian for Tabletop RPGs" tutorials, ObsidianTTRPGTutorials.com, and a Patreon that gives members his ObsidianTTRPGVault, a private Discord, and personal support. By this video he was playing Pathfinder Second Edition, and he usually transcribes whole adventures into Obsidian rather than running them from PDFs.
- **Paizo**: The US publisher of Pathfinder and Starfinder. It sells PDFs of its products and gives away Free RPG Day adventures such as the three Josh uses here.
- **Michael Brodeur** (blacksmithgu on GitHub): Developer of the Dataview community plugin, whose JavaScript API (`dataviewjs`) powers the PDF catalogue queries.