PDF Reader
About 237 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, use the page option. The shorthand @[pdf 2](url) is also supported for backward compatibility.
@[pdf page="2"](url)Additional options can be added to @[pdf ] for more flexible control:
@[pdf page="2" width="100%" ratio="16:9"](url)page- Page number, defaults to1width- Width, defaults to100%height- Height, defaults toautoratio- Aspect ratio, defaults to1:0.9, only effective whenheightis not specified
Examples
Default
Input:
@[pdf](https://plume.pengzhanbo.cn/files/sample-1.pdf)Output:
Set Page Number to 2
Input:
@[pdf page="2"](https://plume.pengzhanbo.cn/files/sample-1.pdf)Output:
Fixed Height
Input:
@[pdf height="400px"](https://plume.pengzhanbo.cn/files/sample-1.pdf)Output:
21:29 Aspect Ratio
Input:
@[pdf ratio="21:29"](https://plume.pengzhanbo.cn/files/sample-1.pdf)Output:
