前言介紹
- 這款 WordPress 外掛「Vanilla PDF Embed」是 2013-12-06 上架。
- 目前有 4000 個安裝啟用數。
- 上一次更新是 2016-11-08,距離現在已有 3107 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.0.1 以上版本才可以安裝。
- 有 32 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
_doherty |
外掛標籤
內容簡介
基本使用
若要嵌入你已經上傳至 WordPress 網站媒體庫中的 PDF,僅需在文章中單獨的一行中輸入該附件頁面的 URL,PDF 將嵌入該位置並且按照預設設定使用 oEmbed。
範例:
文章短網址:
http://localhost/?p=9
附件預設網址:
http://localhost/?attachment_id=9
附件美化網址:
http://localhost/test/report1/
媒體檔案直接網址:
點擊以存取 report1.pdf
不適用於托管在其他網站上的 PDF,或如果你需要更改參數。
使用 [pdf] 簡短標籤
如果 PDF 不在你的 WordPress 網站媒體庫中,或者如果你要自訂嵌入的任何參數,則使用 [pdf]...[/pdf] 簡短標籤。在標籤之間,將提供 PDF 的 URL 以進行嵌入。如果 PDF 在你的 WordPress 網站媒體庫中,你可以提供附件頁面的 URL 或者 PDF 檔案的直接 URL。
[pdf] 簡短標籤接受幾個可選參數:
width - 設置 PDF 嵌入框架的寬度。預設為 100%。
height - 設置 PDF 嵌入框架的高度。預設為未設置。
title - 設置 PDF 標題,用於後備鏈接文本。
open_params - 設置 PDF 開啟參數,控制 PDF 文件在嵌入框架中的顯示方式。在瀏覽器中支援度不高。
範例:
文章短網址:[pdf width="200px"]http://localhost/?p=9[/pdf]
附件預設 URL:[pdf height="500em"]http://localhost/?attachment_id=9[/pdf]
附件美網址:[pdf title="Report 1"]http://localhost/test/report1/[/pdf]
媒體檔案直接網址:[pdf]http://localhost/wp-content/uploads/2013/11/report1.pdf[/pdf]
更改 PDF 開啟參數:[pdf open_params="page=10&view=Fit"]http://localhost/?p=9[/pdf]
相容性
PDF 應該在頁面中嵌入,文件應按比例縮放以水平填滿嵌入框架。很不幸,嵌入 PDF 的支援度並不好。
自動載入嵌入的 PDF
與圖像不同,網頁瀏覽器可能在頁面載入時不會自動下載和顯示嵌入的 PDF。出於安全原因,一些使用者會選擇除非信任 PDF 來源網站,否則不允許 PDF 外掛程式運行。這通常會留下一個灰色的矩形,使用者可以點擊以允許下載和顯示 PDF。
PDF 開啟參數
從 v0.0.8 版本開始,可以通過在簡寫中設置 open_params 來設置 PDF 開啟參數,如上所示。瀏覽器中PDF 開啟參數的支援度較低。但你可以試試看!提供查詢字串作為參數:page=1&view=Fit。有關可用參數的詳細信息,請參閱 Adobe 的文檔。
原文外掛簡介
Basic use
To embed a PDF you’ve uploaded to your WordPress site’s media
library, simply put the URL for the attachment page in your
post on its own line. The PDF will be embedded with the
default settings at that location, as if it were using oEmbed.
Examples:
Post short URL:
http://localhost/?p=9
Attachment default URL:
http://localhost/?attachment_id=9
Attachment pretty URL:
http://localhost/test/report1/
Media direct URL:
Click to access report1.pdf
This doesn’t work for PDFs hosted on other websites, or if you
need to change the parameters.
Using the [pdf] shorttag
If the PDF isn’t in your WordPress site’s media library, or if
you want to customize any parameters for the embed, then use
the [pdf]...[/pdf] shorttag. Between the tags, you’ll provide
the URL for the PDF to embed. If the PDF is in your WordPress
site’s media library, you can either give the attachment page
URL, or the URL to the PDF file directly.
The [pdf] shorttag accepts several optional parameters:
width – sets the width of the frame the PDF is embedded in.
By default, this is set to 100%.
height – sets the height of the frame the PDF is embedded
in. By default, this is unset.
title – sets the title of the PDF, for use in the fallback
link text.
open_params – sets the PDF open params
which control how the PDF file is displayed in the embed frame.
These are poorly supported in browsers.
Examples:
Post short URL: [pdf width="200px"]http://localhost/?p=9[/pdf]
Attachment default URL: [pdf height="500em"]http://localhost/?attachment_id=9[/pdf]
Attachment pretty URL: [pdf title="Report 1"]http://localhost/test/report1/[/pdf]
Media direct URL: [pdf]http://localhost/wp-content/uploads/2013/11/report1.pdf[/pdf]
Change PDF open params: [pdf open_params="page=10&view=Fit"]http://localhost/?p=9[/pdf]
Compatibility
The PDF should be embedded in the page, with the document scaled so it fills the
embed frame horizontally. Unfortunately, embedding PDFs is not well-supported.
Auto-loading embedded PDFs
Unlike with images, web browsers may not automatically download and display
embedded PDFs when the page is loaded. For security reasons, some users prefer
not to allow the PDF plugin to run unless they trust the website the PDF comes
from. This generally leaves a grey rectangle that the user may click on to allow
the PDF to be downloaded and displayed.
PDF open parameters
As of v0.0.8, you can set the PDF open parameters
by setting open_params in the shortcode, as shown above. This is unlikely to actually
anything, since PDF open parameters are poorly supported in browsers. But you can try!
Provide the parameters as a query string: page=1&view=Fit. Refer to the Adobe
documentation on what parameters are available.
Chrome
The PDF should be scaled/zoomed within the embed frame so that the full
horizontal width of the paper fills the frame. This is not
supported in
Chrome’s default PDF viewer, so the document will probably be scaled to 100%,
which may either mean the document doesn’t fill the frame, or, more likely, the
document is too wide for the frame, and the right-hand side of the document is
hidden.
Internet Explorer
Internet Explorer requires a PDF plugin to render embedded PDFs. Generally,
that’s Adobe Reader. Without such a plugin, the fallback download link will be
used.
Mobile browsers
In particular, mobile browsers may show a grey box instead of the embedded PDF,
and will download the file when it is clicked. Other mobile browsers might embed
the PDF, but won’t allow it to scroll.
Alternatives
Your best alternative is to not embed PDFs. PDFs are bad for many reasons:
not easily indexed by search engines, not easily accessible by readers who use
assistive technologies, poorly supported by web browsers (as seen above) and so
on. They’re just bad and you should avoid embedding PDFs if you can.
If you really can’t, then you might consider using another solution like
https://pdfobject.com/ or PDF.js.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Vanilla PDF Embed」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
PDF Invoices & Packing Slips for WooCommerce 》這個 WooCommerce 外掛可以自動為您的客戶在訂單確認電子郵件中添加 PDF 發票。包括一個基本模板(額外的模板可從 WP Overnight 購買),以及修改/建立自己的...。
PDF Embedder 》這款外掛程式可以上傳 PDF 檔案,並將它們直接嵌入到您網站的文章和頁面中。添加圖像一樣簡單!您的 PDF 檔案會自動調整到其自然大小和形狀。您還可以指定寬...。
PDF Viewer for Elementor 》此外掛可協助您快速且簡易地在 Elementor 中嵌入 PDF 文件。, 我們支援的 Elementor 版本為 v3+ 🙂。
Gravity PDF 》Gravity PDF 是使用 Gravity Forms 和 WordPress 創建動態數字 PDF 文件的最佳自助式解決方案。, 高度自定義的 PDF, 開箱即用的版本提供了四種高度自定義的 P...。
Google Doc Embedder 》Google Doc Embedder 允許您使用免費的 Google Docs Viewer 在您的 WordPress 頁面中嵌入多種文件類型,並允許行內檢視(並可選擇下載)各種流行的文件類型,...。
Print, PDF, Email by PrintFriendly 》GDPR(一般性資料保護條例), PrintFriendly Pro符合GDPR。 隱私政策。我們正在努力使免費版本符合GDPR,但目前因為嚴格的Cookie同意要求而不能符合。如果您...。
PDF.js Viewer 》透過 Gutenberg 區塊或簡單的縮略語,將 Mozilla 的 PDF.js Viewer 整合到您的網頁或文章中。PDF.js 是一個用於在瀏覽器中顯示 PDF 頁面的 JavaScript 函式庫...。
PDF Poster – PDF Embedder Plugin 》這個外掛可在文章、頁面、小工具區、頁面塊和主題模板中嵌入 PDF 檔案。非常易於使用、使用者友好且非常輕量的外掛。Gutenberg PDF Viewer 塊可用, 查看實況...。
Embed PDF Viewer 》透過oEmbed或以區塊的方式,將來自媒體庫或其他地方的PDF嵌入至object標籤或Google Doc Viewer當作備用選項。URL只需要是可以讓全球使用的連結即可。, 靈感來...。
WP Photo Album Plus 》此外掛不僅僅是一個相簿外掛,更是一個完整且高度自訂的多媒體內容管理和展示系統。, 特色包括:, , 任意數量的相簿,包含任意類型的多媒體檔案,以及子相簿,...。
Send PDF for Contact Form 7 》此外掛可在[Contact Form 7]中添加條件邏輯。, 使用此「透過聯絡表單發送 PDF 擴充套件」,您可以透過表單恢復資料,並將其插入您自行建立和準備的 PDF 中。,...。
PDF viewer for Elementor & Gutenberg 》「PDFjs Viewer for Elementor」外掛是一個強大的工具,可輕鬆將 PDF 檔案嵌入到您的 Elementor 頁面建構器頁面中。它專為 Elementor 設計,因此您可以輕鬆在...。
PDF Viewer Block for Gutenberg 》一個簡單、具有響應式設計且完全免費使用的古騰堡區塊,可以在您的網站上顯示 PDF 閱讀器。, 您可以輕鬆地即時配置該閱讀器的寬度、高度和對齊方式。, 相容性...。
PDF Viewer 》PDF Viewer 是一個 WordPress 外掛,允許您在網站上嵌入 PDF 文件,無需使用 Flash 外掛程式,僅依賴 JavaScript 來運作。這將使您的網站符合 HTML5 標準。此...。
PDF Image Generator 》這個外掛可以透過上傳 PDF 附件,將封面轉換為 JPEG,並作為文章縮略圖檔案附加。它還允許顯示縮略圖標誌和插入 PDF 鏈接與封面圖像到編輯器。, , 僅支援 Wor...。