[WordPress] 外掛分享: Simple PDF Exporter

首頁外掛目錄 › Simple PDF Exporter
WordPress 外掛 Simple PDF Exporter 的封面圖片
400+
安裝啟用
★★★☆☆
3.5/5 分(4 則評價)
1161 天前
最後更新
問題解決
v2.0 上架:2016-03-05

內容簡介

將所有貼文或自訂文章型別匯出到單一 PDF。
您還可以將單獨貼文或所需的正確數量匯出。

重要提示:此外掛需要至少 512MB 可用的空閒 RAM,否則會超時 / 返回錯誤。

此外掛不建議給無技術知識的人使用。
PDF 的版面設計非常基礎,需要懂 HTML、CSS 與 PHP 方面的技術知識以自訂版面:
更多資訊請參閱下方內容。

基本資訊

此外掛會檢查是否已有日期 (ddMonyear) 相同的 PDF,如果有,會傳回現有的 PDF,否則會建立一個新的 PDF。由於 PDF 生成會吃掉許多資源,此功能會避免此外掛運行過多次數而導致伺服器崩潰:
請參考下方範例或 FAQ 來強制生成 PDF。

若貼文數量過多,可能需要幾秒至數分鐘來生成新的 PDF。

若 PDF 未生成,可能是您的伺服器資源不足。這是無法修正的,因為 PDF 函式庫很費資源:
請向您的主機提供商詢問您運行此外掛所需的資源數量,以及您是否能夠在主機限制範圍內採取任何措施,確保此外掛有足夠的 RAM/PHP 設定。

若您不使用自訂網址,因此未向網址添加 post_type 參數,預設匯出的貼文類型將始終為 WP 預設的 post。

PDF 範本

目前,匯出的 PDF 範本和設計非常基礎 (且貼文以表格渲染,因為浮動會與 DOMPDF 函式庫不相容)。

您可以從當前主題中復制外掛的基本結構:wp-content/plugins/simple-pdf-exporter/assets/pdf_layout.php 並進行編輯。
您的版面必須以 PHP 回傳,例如: echo '<div>the content goes here</div>';,否則不會在 PDF 中顯示。

您可以從當前主題中復制外掛的基本樣式表:wp-content/plugins/simple-pdf-exporter/assets/pdf_export.css 並進行編輯。

請勿直接編輯外掛的文件 pdf_layout.php 和 pdf_export.css 避免下次更新時被覆寫。

問題?

在論壇發問新主題之前,請參閱 FAQ!

如需定制外掛版本,需支付費用,請聯繫我 (電子郵件位址在shambix.com 上)。

函式庫和授權

DOMPDF
FPDF
FPDI
FPDI ADDON

外掛標籤

開發者團隊

⬇ 下載最新版 (v2.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Simple PDF Exporter」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Export a single PDF with all posts, or custom post types.
You can also export a single post, or the exact number you need.

IMPORTANT This plugin requires at least 512MB of free RAM available, or it will timeout / return an error.

This plugin is NOT recommended for people with no tech knowledge.
The PDF layout/design is VERY basic and will require html/css/php technical knowledge to customize.
Read more about this below.
The Basics
The plugin checks if a pdf already exists with the same date (ddMonyear), if yes, the existing pdf will be served, otherwise a new will be generated. Since the PDF generation uses up a lot of resources, this will prevent too many runs of the plugin and the crashing of your server.
Check the example below or the FAQ for ways to force the PDF generation anyway.
Depending on how many posts you have, it might take from a few seconds to several minutes for a new PDF to be generated.

If no PDF is generated you probably don’t have enough server resources. This can’t be fixed, as PDF libraries are very resource-hungry.
Ask your hosting to check how many resources you would need to run the plugin and if there is anything you can do, within your hosting limits, to make sure the plugin has enough or appropriate RAM/PHP settings.

If you don’t use a custom url, hence you don’t add the post_type parameter to the url, the default post type exported will always be WP default post.
The PDF Template
Currently, the template and design for the exported pdf, is very basic (and posts are rendered as a table, since floating doesn’t play nicely with the DOMPDF library).
You can copy the plugin’s basic structure from wp-content/plugins/simple-pdf-exporter/assets/pdf_layout.php inside your current theme and edit it.
Your layout must be echoed in php, eg. echo '

the content goes here

'; or it won’t show up in the PDF.
You can copy the plugin’s basic CSS from wp-content/plugins/simple-pdf-exporter/assets/pdf_export.css inside your current theme and edit it.
Do not edit directly the plugin’s files pdf_layout.php and pdf_export.css, they will be overwritten with the next update.
Questions?
Check the FAQ before opening new threads in the forum!

Contact me if you want a custom version of the plugin, for a fee (email on shambix.com).

Libraries & Credits

DOMPDF
FPDF
FPDI
FPDI ADDON

延伸相關外掛

文章
Filter
Apply Filters
Mastodon