shopline / oro-pdfdesigner

使用 wkhtmltopdf 创建 Oro 平台 PDF 模板的 PDF Designer Bundle

dev-master / 1.0.x-dev 2015-03-04 18:06 UTC

This package is not auto-updated.

Last update: 2020-08-03 06:57:50 UTC


README

##注意:此项目仍在积极开发中,尚未准备好用于生产。

使用 Oro 平台wkhtmltopdf 创建 PDF 模板的 PDF Designer Bundle。

SensioLabsInsight

Scrutinizer Code Quality

Build Status

安装

首先确保正确安装了 wkhtmltopdf。在 Ubuntu 上推荐使用 xvfb 和包装脚本来安装,以避免需要 X 服务器来运行。

示例

apt-get install wkhtmltopdf
apt-get install xvfb
echo 'xvfb-run --server-args="-screen 0, 1024x768x24" /usr/bin/wkhtmltopdf $*' > ./wkhtmltopdf.sh
chmod a+x wkhtmltopdf.sh
sudo mv wkhtmltopdf.sh /usr/bin/wkhtmltopdf.sh
sudo ln -s /usr/bin/wkhtmltopdf.sh /usr/local/bin/wkhtmltopdf
wkhtmltopdf http://www.google.com output.pdf

然后添加到 composer.json

"require": {
  "shopline/oro-pdfdesigner": "dev-master"
}

或者运行

composer require shopline/oro-pdfdesigner

并在 composer.json 中添加以下行

作为 composer post-install/update 脚本运行 pdf designer

要作为 composer post-install 或 post-update 脚本运行 pdf designer,只需将

"Shopline\Bundle\PDFDesignerBundle\Composer\DesignerHandler::InstallDesigner"

ScriptHandler 添加到 composer.json 的 post-install-cmd / post-update-cmd 命令部分

"scripts": {

"post-install-cmd": [
    "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
    "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
    "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
    "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
    "Shopline\\Bundle\\PDFDesignerBundle\\Composer\\DesignerHandler::InstallDesigner"
],
"post-update-cmd": [
    "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
    "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
    "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
    "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
    "Shopline\\Bundle\\PDFDesignerBundle\\Composer\\DesignerHandler::InstallDesigner"
]

},