PDF Resize
approvedby puhhh
Resize embedded PDF files with wiki-link dimensions. - This plugin has not been manually reviewed by Obsidian staff.
PDF Resize
Resize embedded PDFs in Obsidian with the same wiki-link width syntax used for images.
See CHANGELOG.md for release history.
Features
- Uses familiar syntax:
![[file.pdf|500]] - Works in Reading view and Live Preview
- Accepts whole-number widths from
1to4096pixels and enforces a minimum rendered width of100px - Keeps embeds responsive without exceeding the available note width
- Leaves PDFs without a valid width at Obsidian's default size
- Makes no network requests and does not modify vault files
Installation
- Download
main.js,manifest.json, andstyles.css. - Create
.obsidian/plugins/pdf-resize/inside your vault. - Copy all three files into that folder.
- Reload Obsidian.
- Open Settings → Community plugins and enable PDF Resize.
Usage
Add a pixel width after the PDF filename:
![[documents/example.pdf|500]]
The rendered PDF is 500px wide in Reading view and Live Preview. In a narrower pane, it shrinks to fit the available space. Source mode shows the Markdown text, so no resize is applied there.
Widths must be whole numbers from 1 through 4096. Values from 1 through 99 are clamped to the minimum rendered width of 100px; values from 100 through 4096 are used as written. 0, values above 4096, and malformed values are ignored:
![[example.pdf|0]]
![[example.pdf|4097]]
![[example.pdf|wide]]
For example, ![[example.pdf|10]] renders at 100px, while ![[example.pdf|500]] renders at 500px.
![[example.pdf]] keeps Obsidian's default PDF size.
Development
Use Node.js 24 for parity with the reference plugin toolchain.
npm ci
npm run dev
npm run lint
npm test
npm run build
npm ciinstalls the locked dependency set used by CI and release builds.npm installis appropriate when intentionally updating dependencies.npm run devbuilds in watch mode.npm run lintchecks source and tests.npm testruns the Vitest suite.npm run buildcreates productionmain.js.
Do not edit main.js by hand.
Release
GitHub Releases are published by GitHub Actions when a version tag is pushed.
- Update
package.json,package-lock.json,manifest.json,versions.json, andCHANGELOG.md. - Run
npm run lint,npm test,npm run build, andnpm audit --omit=dev --audit-level=high. - Commit the release changes, open a pull request into
main, and merge it. - Create and push a signed version tag from
main:
git tag -s -m "X.Y.Z" X.Y.Z HEAD
git push origin main
git push origin X.Y.Z
The release workflow verifies that the tag version matches package.json, manifest.json, and versions.json, audits production dependencies, runs lint and tests, rebuilds main.js, creates GitHub artifact attestations, and uploads manifest.json, main.js, and styles.css. Obsidian requires the GitHub release tag to match manifest.json exactly, so use 1.0.0, not v1.0.0.
Manual verification
- Check
![[file.pdf|500]]in Reading view and Live Preview. - Switch between both views and edit the width in Live Preview.
- Check two PDF embeds with different widths in the same note.
- Check PDF paths with spaces and subfolders.
- Scroll a long note until an off-screen PDF becomes visible.
- Check
1,10, and99; confirm each renders at100pxwith the toolbar and first PDF page visible. - Check
100,399,500, and4096; confirm each uses the requested width. - Confirm
0,4097, decimals, negative numbers, text, and mixed values are ignored. - Confirm
![[file.pdf]]and non-PDF embeds stay unchanged. - Resize the pane below and above requested width.
- Reload Obsidian and confirm sizing still works without console errors.
Privacy and safety
PDF Resize works locally. It does not make network requests, collect data, write notes, or change PDF files.
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.