PDF Reader
About 247 wordsLess than 1 minute
2025-10-08
Overview
The theme supports embedding PDF files in markdown, enabling direct PDF reading within the page.
This feature is powered by vuepress-plugin-md-power.
Configuration
This feature is disabled by default. You need to enable it in the theme configuration.
.vuepress/config.ts
export default defineUserConfig({
theme: plumeTheme({
markdown: {
pdf: true,
},
})
})
Syntax
The simplest syntax is as follows:
@[pdf](url)
To open a specific page, add a page number after pdf
:
@[pdf 2](url)
Additional options can be added to @[pdf ]
for more flexible control:
@[pdf 2 no-toolbar width="100%" height="400px" ratio="16:9" zoom="100"](url)
no-toolbar
- Hide the toolbarwidth
- Width, defaults to 100%height
- Height, defaults toauto
ratio
- Aspect ratio, defaults to16:9
, only effective when height is not specifiedzoom
- Zoom level, percentage
Examples
Default
Input:
@[pdf](https://plume.pengzhanbo.cn/files/sample.pdf)
Output:
Set Page Number to 2
Input:
@[pdf 2](https://plume.pengzhanbo.cn/files/sample.pdf)
Output:
Hide Toolbar
Input:
@[pdf no-toolbar](https://plume.pengzhanbo.cn/files/sample.pdf)
Output:
90% Zoom Level
Input:
@[pdf zoom="90"](https://plume.pengzhanbo.cn/files/sample.pdf)
Output:
21:29 Aspect Ratio
Input:
@[pdf zoom="95" ratio="21:29"](https://plume.pengzhanbo.cn/files/sample.pdf)
Output: