Title: Embed PDF Viewer
Author: Andy Fragen
Published: <strong>2016 年 3 月 31 日</strong>
Last modified: 2026 年 2 月 21 日

---

搜索插件

![](https://ps.w.org/embed-pdf-viewer/assets/banner-772x250.png?rev=2560197)

![](https://ps.w.org/embed-pdf-viewer/assets/icon.svg?rev=2883712)

# Embed PDF Viewer

 作者：[Andy Fragen](https://profiles.wordpress.org/afragen/)

[下载](https://downloads.wordpress.org/plugin/embed-pdf-viewer.2.4.8.zip)

 * [详情](https://cn.wordpress.org/plugins/embed-pdf-viewer/#description)
 * [评价](https://cn.wordpress.org/plugins/embed-pdf-viewer/#reviews)
 * [开发进展](https://cn.wordpress.org/plugins/embed-pdf-viewer/#developers)

 [支持](https://wordpress.org/support/plugin/embed-pdf-viewer/)

## 描述

Embed a PDF from the Media Library or elsewhere via oEmbed or as a block into an`
iframe` tag. The URL only has to be world reachable link. Chrome uses Google Doc
Viewer as Chrome seems to automatically rendered embedded JS in PDFs automatically.
Uses Google Doc Viewer with mobile.

灵感来自 [Embed PDF](https://wordpress.org/plugins/dirtysuds-embed-pdf/) 和 [RV Embed PDF](https://wordpress.org/plugins/rv-embed -pdf/)。

非常感谢 [Alex Kirk](https://github.com/akirk) 使嵌入 PDF 查看器与新的块编辑器兼容。

在 [GitHub](https://github.com/afragen/embed-pdf-viewer) 上开发。欢迎针对 `develop`
分支提出请求。

### Known Issues

Occasionally Google Doc Viewer will not correctly load the PDF. Reloading the page
should correct the issue, though this may need to be done several times.

## 屏幕截图

 * [[
 * 嵌入PDF Viewer 区块
 * [[
 * 选择PDF
 * [[
 * PDF 区块以及属性

## 区块

该插件提供了 1 个区块.

 *   PDF

## 评价

![](https://secure.gravatar.com/avatar/2c70c3a93b5c86a6c741a8f87e00743a7b3e1581878b5792760d784e954549c2?
s=60&d=retro&r=g)

### 󠀁[Amazing plugin](https://wordpress.org/support/topic/amazing-plugin-2614/)󠁿

 [Abdul qadir](https://profiles.wordpress.org/hajiabdul/) 2024 年 7 月 31 日

This plugin save my 2 days coding task. If this plugin is not there i have to code
this.

![](https://secure.gravatar.com/avatar/215457ed6ea4c4c72b0299070fe0682ae59d4d7a1255037d9e911c3f24309954?
s=60&d=retro&r=g)

### 󠀁[Works Great but no preview on mobile](https://wordpress.org/support/topic/works-great-but-no-preview-on-mobile/)󠁿

 [yu4nf3n](https://profiles.wordpress.org/yu4nf3n/) 2024 年 3 月 12 日 1 回复

Works great on web but when I try to access the website via mobile browser, the 
pdf has no preview available. BTW, I’m using Wordpress 6.4.3. Thank you for your
effort with this PDF plugin it is a big help and easy to use.

![](https://secure.gravatar.com/avatar/ca3f78c2506a1c61e67fc02fdc4113d6a3dcbcd2de7f0b51ac877fc448e70783?
s=60&d=retro&r=g)

### 󠀁[Perfect!](https://wordpress.org/support/topic/perfect-10126/)󠁿

 [melissajclark](https://profiles.wordpress.org/melissajclark/) 2023 年 11 月 20
日

Love how easy it is to embed a PDF using the Block Editor and this plugin. It’s 
perfect.

![](https://secure.gravatar.com/avatar/7dbb5c54a04617bb06e1e2ca533c15e008403f33626538d79d67da14c29aa4ea?
s=60&d=retro&r=g)

### 󠀁[This is the one!](https://wordpress.org/support/topic/this-is-the-one-47/)󠁿

 [grunk1905](https://profiles.wordpress.org/grunk1905/) 2023 年 5 月 6 日

Having tried with a few other PDF embed viewers, this was the one that didn’t add
a watermark (EmbedPress), require some sort of paid upgrade (3d flipbook), add an
unnecessary ‘Download” button (wordpress inbuilt viewer), or involve technical skills
using the shortcode feature (PDF Viewer and PDF.js Viewer). Really glad to have 
found it, and thanks to those who developed it!

![](https://secure.gravatar.com/avatar/7a0fd818983c9497fbe45adcf0dd9c4250850da0e036e48a6e668f112ce24cec?
s=60&d=retro&r=g)

### 󠀁[Fantastic](https://wordpress.org/support/topic/fantastic-3181/)󠁿

 [Masum Billah](https://profiles.wordpress.org/masumwp/) 2023 年 4 月 24 日

Very Useful

![](https://secure.gravatar.com/avatar/16563fa6d316c0cc07da8669e4a1f380a78b8335515d260014ff872e9ede2305?
s=60&d=retro&r=g)

### 󠀁[Works great](https://wordpress.org/support/topic/works-great-8632/)󠁿

 [pwhenderson](https://profiles.wordpress.org/pwhenderson/) 2023 年 1 月 14 日

Simple is what we were looking for. Simple is what we got. Works great. Tku

 [ 阅读所有19条评价 ](https://wordpress.org/support/plugin/embed-pdf-viewer/reviews/)

## 贡献者及开发者

「Embed PDF Viewer」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Andy Fragen ](https://profiles.wordpress.org/afragen/)
 *   [ Alex Kirk ](https://profiles.wordpress.org/akirk/)
 *   [ Colin Stewart ](https://profiles.wordpress.org/costdev/)

「Embed PDF Viewer」插件已被翻译至 10 种本地化语言。 感谢[所有译者](https://translate.wordpress.org/projects/wp-plugins/embed-pdf-viewer/contributors)
为本插件所做的贡献。

[帮助将「Embed PDF Viewer」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/embed-pdf-viewer)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/embed-pdf-viewer/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/embed-pdf-viewer/)，或通过[RSS](https://plugins.trac.wordpress.org/log/embed-pdf-viewer/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/embed-pdf-viewer/)。

## 更新日志

#### 2.4.8 / 2025-02-21

 * use `wp_safe_remote_get()`

#### 2.4.7 / 2025-02-05

 * validate destination URL for oEmbed
 * add `max-height: 500px;` to PDF display

#### 2.4.6 / 2024-11-01

 * remove `load_plugin_textdomain()`

#### 2.4.5 / 2024-10-7

 * escape block parameters

#### 2.4.4 / 2024-08-16

 * refactor `$description` in `dynamic_render_callback()`, who knew the title attribute
   could be not set
 * update requirements, PHP 7.4+, WP 6.0

#### 2.4.1 – 2.4.3 / 2024-08-08

 * more sanitizing of URL
 * fix typos and update readme
 * use media file description for title if present
 * escape description in render

#### 2.4.0 / 2024-08-06

 * convert to only use `iframe`
 * use Google Doc Viewer for Chrome and mobile
 * dynamically render `iframe` in block based on browser
 * mitigate [Chromium issue](https://issues.chromium.org/issues/40063550) by rendering
   PDF with Google Doc Viewer
 * thanks to @costdev for helping with dynamic block rendering

#### 2.3.1 / 2023-09-10

 * update GA
 * 更新测试到

#### 2.3.0 / 2021-07-07

 * 为 WordPress SVN 添加 @10up GitHub Actions 集成

#### 2.2.0 / 2021-03-05

 * 更新Toolbar到 ToolbarGroup 以及 ToolbarButton
 * 添加对块对齐工具栏的有限支持
 * 修复i18n在区块中
 * 从 `composer.json` 中的 `make-pot` 中排除 `/build`，不适用于最小化的 JS

#### 2.1.2 / 2020-09-15

 * 对 oembed 使用相同的_块名称_
 * 添加额外的依赖到序列

### 2.1.1 / 2020-07-20

 * 更新区块用于不推荐使用的项目和小错误
 * 仅更新 PDF 的媒体选择器

#### 2.1.0 / 2020-07-20

 * 更新区块构建过程
 * 添加标题和描述属性用于a11y
 * 添加PDF svg 用于区块

#### 2.0.5 / 2020-03-09

 * GitHub 上插件结构的小更新
 * 更新测试到

#### 2.0.4 / 2019-10-05

 * 修复了 [PDF上传带有区块](https://wordpress.org/support/topic/uploading-from-within-block-doesnt-work/)

#### 2.0.3 / 2019-04-25

 * 移动区块注册到它自身的函数和hook
 * WPCS updates

#### 2.0.2 / 2019-02-03

 * 更新WordPress需求

#### 2.0.1 / 2019-01-11

 * 添加 `composer.json` 以及自动的创建带有`composer 更新`的POT
 * 添加了对 WP 4.9.x 及以下版本的 `register_block_type()` 的检查

#### 2.0.0 / 2018-12-20 🎂

 * 在 [Alex Kirk](https://github.com/akirk) 的大力帮助下添加了适当的 PDF 块，非常
   感谢

#### 1.6.1 / 2018-11-25

 * 正确的初始化`load_plugin_textdomain()`

#### 1.6.0 / 2018-07-22

 * 添加filter `embed_pdf_viewer_pdf_attributes`
 * 升级 `readme.txt` 到包括 `Requires PHP ` 头部
 * 在PDF周围的链接中添加段落标签

#### 1.5.0 / 2016-12-17

 * 添加 CSS 以回退到 iOS 上的 `iframe`，因为 `object` 不可滚动：P

#### 1.4.0

 * 切换到使用 `object` 标签，使用 `iframe` 作为后备显示方法

#### 1.3.0

 * 插入除了PDF以外的任何Media Library 现在都可以按照预期完成.

#### 1.2.1

 * 修复一些PHP警告

#### 1.2.0

 * 从媒体库插入 PDF 现在只需插入 oEmbed 的 URL
 * 从任何源嵌入一个PDF

#### 1.1.2

 * 简化 `instance()`只需要多一点点

#### 1.1.1

 * 重新命名实例变量到`$instance` 并且让其隐私
 * 更新DocBlocks
 * 确保` $atts` 是一个数组

#### 1.1

 * 当不是 PDF 时不返回媒体项目的错误修正，坏安迪 🙁

#### 1.0.1

 * 添加到DocBlocks

#### 1.0

 * 重构以将嵌入的代码放入到一个函数中
 * 添加资产

#### 0.1

 * 初始化提交

## 额外信息

 *  版本 **2.4.8**
 *  最后更新：**2 月前**
 *  活跃安装数量 **20,000+**
 *  WordPress 版本 ** 6.0 或更高版本 **
 *  已测试的最高版本为 **7.0**
 *  PHP 版本 ** 7.4 或更高版本 **
 *  语言
 * [Chinese (China)](https://cn.wordpress.org/plugins/embed-pdf-viewer/) 、 [Chinese (Taiwan)](https://tw.wordpress.org/plugins/embed-pdf-viewer/)、
   [Danish](https://da.wordpress.org/plugins/embed-pdf-viewer/) 、 [Dutch](https://nl.wordpress.org/plugins/embed-pdf-viewer/)、
   [English (US)](https://wordpress.org/plugins/embed-pdf-viewer/) 、 [Italian](https://it.wordpress.org/plugins/embed-pdf-viewer/)、
   [Japanese](https://ja.wordpress.org/plugins/embed-pdf-viewer/) 、 [Russian](https://ru.wordpress.org/plugins/embed-pdf-viewer/)、
   [Spanish (Spain)](https://es.wordpress.org/plugins/embed-pdf-viewer/) 、 [Swedish](https://sv.wordpress.org/plugins/embed-pdf-viewer/)
   和 [Ukrainian](https://uk.wordpress.org/plugins/embed-pdf-viewer/).
 *  [翻译成简体中文](https://translate.wordpress.org/projects/wp-plugins/embed-pdf-viewer)
 * 标签
 * [block](https://cn.wordpress.org/plugins/tags/block/)[embed](https://cn.wordpress.org/plugins/tags/embed/)
   [oembed](https://cn.wordpress.org/plugins/tags/oembed/)[pdf](https://cn.wordpress.org/plugins/tags/pdf/)
   [viewer](https://cn.wordpress.org/plugins/tags/viewer/)
 *  [高级视图](https://cn.wordpress.org/plugins/embed-pdf-viewer/advanced/)

## 评级

 4.7 星（最高 5 星）。

 *  [  16 条 5 星评价     ](https://wordpress.org/support/plugin/embed-pdf-viewer/reviews/?filter=5)
 *  [  1 条 4 星评价     ](https://wordpress.org/support/plugin/embed-pdf-viewer/reviews/?filter=4)
 *  [  2 条 3 星评价     ](https://wordpress.org/support/plugin/embed-pdf-viewer/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/embed-pdf-viewer/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/embed-pdf-viewer/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/embed-pdf-viewer/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/embed-pdf-viewer/reviews/)

## 贡献者

 *   [ Andy Fragen ](https://profiles.wordpress.org/afragen/)
 *   [ Alex Kirk ](https://profiles.wordpress.org/akirk/)
 *   [ Colin Stewart ](https://profiles.wordpress.org/costdev/)

## 支持

最近两个月解决的问题：

     总计 1，已解决 1

 [查看支持论坛](https://wordpress.org/support/plugin/embed-pdf-viewer/)