dev-master
9999999-devProvides TCPDF integration for Symfony
LGPL
The Requires
by Gergely Polonkai
by Alessio
by Mohammad Arif Ansari
pdf tcpdf
Provides TCPDF integration for Symfony
Download TCPDF library at http://sourceforge.net/projects/tcpdf/files/ and put it in vendor folder, (*1)
Add this bundle to your vendor/ dir, (*2)
Vendor Mode Add the following lines in your deps file::, (*3)
[IoTcpdfBundle] git=git://github.com/ioalessio/IoTcpdfBundle.git target=/bundles/Io/TcpdfBundle, (*4)
Run the vendor script:, (*5)
./bin/vendors install, (*6)
Add the "Io" namespace to your autoloader:, (*7)
// app/autoload.php $loader->registerNamespaces(array( 'Io' => __DIR__.'/../vendor/bundles', // your other namespaces )); //in same file include tcpdf library require_once __DIR__.'/../vendor/tcpdf/tcpdf.php';
Add the "Io" namespace to your kernel:, (*8)
// app/ApplicationKernel.php public function registerBundles() { return array( // ... new Io\TcpdfBundle\IoTcpdfBundle(), // ... ); }
//in mybundle/controllers/myController.php class MyController extends Controller { /** * @Route("/mypage.pdf") */ public function mypageAction() { $html = $this->renderView('MyBundle:MyController:mypage.pdf.twig', array()); //io_tcpdf will returns Response object return $this->get('io_tcpdf')->quick_pdf($html); } } //in mybundle/Resources/views/myController.pdf.twig put here your html code
Provides TCPDF integration for Symfony
LGPL
pdf tcpdf