2026-01-20 23:34:40 +08:00

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 toolbar
  • width - Width, defaults to 100%
  • height - Height, defaults to auto
  • ratio - Aspect ratio, defaults to 16:9, only effective when height is not specified
  • zoom - Zoom level, percentage

Examples

Default

Input:

@[pdf](https://plume.pengzhanbo.cn/files/sample-1.pdf)

Output:

@pdf

Set Page Number to 2

Input:

@[pdf 2](https://plume.pengzhanbo.cn/files/sample-1.pdf)

Output:

@pdf 2 zoom="95"

Hide Toolbar

Input:

@[pdf no-toolbar](https://plume.pengzhanbo.cn/files/sample-1.pdf)

Output:

@pdf no-toolbar

90% Zoom Level

Input:

@[pdf zoom="90"](https://plume.pengzhanbo.cn/files/sample-1.pdf)

Output:

@pdf zoom="90"

21:29 Aspect Ratio

Input:

@[pdf zoom="95" ratio="21:29"](https://plume.pengzhanbo.cn/files/sample-1.pdf)

Output:

@pdf zoom="95" ratio="21:29"