dev-master
9999999-dev https://github.com/hubertperron/AmpPDFCrowdBundleA Symfony2 bundle for working with the PDFCrowd API
MIT
The Requires
- pdfcrowd/pdfcrowd-php 2.5
- symfony/symfony 2.*
by Hubert Perron
pdf pdfcrowd
A Symfony2 bundle for working with the PDFCrowd API
This bundle act as a thin wrapper over the PDFCrowd API to ease integration with Symfony., (*1)
{ "repositories": [ { "type": "package", "package": { "name": "pdfcrowd/pdfcrowd-php", "version": "2.5", "dist": { "url": "http://pdfcrowd.com/static/clients/php/pdfcrowd-2.5-php.zip", "type": "zip" }, "autoload": { "files": ["pdfcrowd.php"] } } } ], "require": { "amp/pdfcrowd-bundle": "dev-master" } }
``` php // File: app/AppKernel.php public function registerBundles() { return array( // ... new Amp\PDFCrowdBundle\AmpPDFCrowdBundle(), // ... ); }, (*3)
## Configuration ``` yaml amp_pdf_crowd: username: your-username apikey: the-api-key
``` php $pdfCrowd = $this->get('amp_pdf_crowd.api'); $url = $this->generateUrl('route_name', array(), true);, (*4)
$pdfData = $pdfCrowd->convertURI($url); $fileName = $this->container->getParameter('kernel.root_dir') . '/../web/pdfs/example.pdf';, (*5)
file_put_contents($fileName, $pdfData); // Make sure this directory is writable, (*6)
### Command ``` bash $ app/console pdfcrowd:convert https://github.com/hubertperron/AmpPDFCrowdBundle web/pdfs/example.pdf
A Symfony2 bundle for working with the PDFCrowd API
MIT
pdf pdfcrowd