prg/portabledocument-bundle
Composer 安装命令:
composer require prg/portabledocument-bundle
包简介
This bundle to generate PDFs optionally with css styling.
README 文档
README
PortableDocumentBundle is a PHP (5.3+) wrapper for the mPDF Library. It allows you to generate pdfs from html.
Installation
With composer, add:
{
"require": {
"prg/portabledocument-bundle": "dev-master"
}
}
Then enable it in your kernel:
// app/AppKernel.php public function registerBundles() { $bundles = array( //... new PRG\PortableDocumentBundle\PRGPortableDocumentBundle(), //...
Render a pdf document as response from a controller
$pdfGenerator = $this->get('pguso.mpdf'); $html = $this->renderView('YourBundle:Folder:file.html.twig', array( 'args' => $args )); return new Response( $pdfGenerator->generateFromView($html, array( 'stylesheet' => '/pdf/style.css' //optional )) );
统计信息
- 总下载量: 52
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-07-23