mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-04-23 10:58:13 +08:00
1.9 KiB
1.9 KiB
title, icon, createTime, permalink
| title | icon | createTime | permalink |
|---|---|---|---|
| PDF Reader | teenyicons:pdf-outline | 2025/10/08 13:30:53 | /en/guide/embed/pdf/ |
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.
export default defineUserConfig({
theme: plumeTheme({
markdown: {
pdf: true, // [!code ++]
},
})
})
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 toautoratio- 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-1.pdf)
Output:
Set Page Number to 2
Input:
@[pdf 2](https://plume.pengzhanbo.cn/files/sample-1.pdf)
Output:
Hide Toolbar
Input:
@[pdf no-toolbar](https://plume.pengzhanbo.cn/files/sample-1.pdf)
Output:
90% Zoom Level
Input:
@[pdf zoom="90"](https://plume.pengzhanbo.cn/files/sample-1.pdf)
Output:
21:29 Aspect Ratio
Input:
@[pdf zoom="95" ratio="21:29"](https://plume.pengzhanbo.cn/files/sample-1.pdf)
Output: