[WordPress] 外掛分享: PDF or image generator

首頁外掛目錄 › PDF or image generator
WordPress 外掛 PDF or image generator 的封面圖片
⚠ 此外掛已下架 — 不再更新維護,建議勿安裝。
10+
安裝啟用
尚無評分
3071 天前
最後更新
問題解決
WordPress 4.0+ PHP 5.5+ v1.0 上架:2017-09-15

內容簡介

此外掛提供以下功能:

將網頁內容、HTML 字串或檔案轉換為圖像。
將網頁內容、HTML 字串或檔案轉換為 PDF。

開始使用
配置

透過設定選單或插件名稱下的設定連結,進入插件設定頁面。
從這裡下載 wkhtmltox。
執行可執行檔,然後它將創建wkhtmltox資料夾。輸入 wkhtmltox->bin 檔案內文件的絕對路徑。

使用

我們需要使用以下帶有指定參數的函數,它將返回生成的 PDF/圖像路徑。

PDFIG_generate($src, $src_type, $dest_file_name, $conversion_type);

$src 為必填參數,預期為字串。例如:“http://osmosys.asia”,“home/osmosys/test.php” 等。
$src_type 為必填參數,預期為字串。它指定源類型是什麼,可能是指定的 3 個值之一。可能的值:“TEMPLATE_PATH”,“HTML_STRING”,“URL”。
$dest_file_name 為選填參數,預期為字串。它是要下載的檔案。例如:“test”等。
$conversion_type 為選填參數,預期為字串。它指定要將給定的源轉換為哪種格式,可能是指定的 2 個值之一。可能的值:“PDF”,“IMG”。

只需在 demo 頁面中插入以下簡碼 [PDFIG_generator_demo]。

外掛標籤

開發者團隊

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

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「PDF or image generator」→ 直接安裝(推薦)

原文外掛簡介

It provides the following functionalities

Converting webpage content, HTML string or file into image.
Converting webpage content, HTML string or file into PDF.

Getting Started
Configuration

Go to plugin settings page through settings menu or settings link under plugin name in the plugins page.
Download wkhtmltox from here.
Run that executable file then it will create wkhtmltox folder. Enter the absolute path of the files inside wkhtmltox->bin files.

Usage

We have to call the following function with specified paramters and it will return the generated PDF/image path.
PDFIG_generate($src, $src_type, $dest_file_name, $conversion_type);

$src is required, expected string. Ex: “http://osmosys.asia”, “home/osmosys/test.php” etc.
$src_type is required, expected string. It specifies what is the source type, It can be one of the 3 values which are specified in the possible values. Possible values: “TEMPLATE_PATH”, “HTML_STRING”, “URL”.
$dest_file_name is optional, expected string. It is the file with which file will get downloaded. Ex: “test” etc.
$conversion_type is optional, expected string. It specifies to which format we have to convert the given source, it can be one among the 2 values which are specified in the possible values. Possible values: “PDF”, “IMG”.

Simply insert the following shortcode [PDFIG_generator_demo] for a demo page.

延伸相關外掛

文章
Filter
Mastodon