| 开发者 |
strands
LordFren |
|---|---|
| 更新时间 | 2026年6月5日 02:19 |
| PHP版本: | 8.1 及以上 |
| WordPress版本: | 7.0 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
prefers-color-scheme)[pdf_embed] shortcode[pdf_embed id="123" sizing="responsive" download="yes" navigation="yes" zoom="yes"]
All attributes are optional except id. Per-embed attrs override the global defaults on the Sizing and Appearance tabs.
pdf-embed/ folder to wp-content/plugins/Yes. Copy wp-content/plugins/pdf-embed/templates/viewer.php to wp-content/themes/your-theme/pdf-embed/viewer.php and edit.
It mirrors WordPress's own permission model. The viewer only renders for visitors who have permission to read the underlying post (current_user_can('read_post', $id)). In practice that means:
Drop a .po / .mo / .l10n.php file into the plugin's languages/ folder using the pdf-embed text domain.
Yes. Activation seeds defaults per site, and uninstall cleans options on each site (including the legacy pdfembed_source from older versions). No network-wide tables, no add_site_option use; per-site settings stay independent.
In Enfold's Advanced Layout Builder, look for PDF Embed under the Media Elements tab. If your Enfold runs in a non-English language, Enfold groups elements by localized tab name and ours stays in English — so PDF Embed may show up in its own auto-created group instead. The element itself works identically either way.
The viewer renders PDFs safely via PDF.js (canvas pixels, no PDF-side JS executes). The Print button, however, hands the raw PDF to the browser's native PDF renderer; that's the only way to get a browser's print dialog. Don't rely on Print for security-sensitive documents.
Yes. PDF Embed ships PDF.js 5.7.284, well past the 4.2.67 patch.
download="no", can visitors still save the PDF?Yes, technically. The Download button is removed from the toolbar, but the PDF bytes are loaded into the browser by PDF.js to render the document, so a visitor with browser developer tools can still extract them. Use download="no" to remove the button as a UX choice (e.g. on pages where you don't want to encourage downloads), not as a security boundary. The same applies to navigation="no" and zoom="no": they remove buttons; they don't prevent a determined visitor from re-enabling those interactions in their browser. To actually keep a PDF private, restrict the post that embeds it (private/draft, role-restricted, members-only plugin).