hiren / pdfcrowd-bundle
A Symfony2 bundle for working with the PDFCrowd API
Installs: 11
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 1
Type:symfony-bundle
Requires
- pdfcrowd/pdfcrowd-php: 2.6
- symfony/symfony: 2.*
This package is not auto-updated.
Last update: 2024-09-20 19:04:24 UTC
README
This bundle act as a thin wrapper over the PDFCrowd API to ease integration with Symfony.
Installation
Using composer
{
"repositories": [
{
"type": "package",
"package": {
"name": "pdfcrowd/pdfcrowd-php",
"version": "2.6",
"dist": {
"url": "http://pdfcrowd.com/static/clients/php/pdfcrowd-2.6-php.zip",
"type": "zip"
},
"autoload": {
"files": ["pdfcrowd.php"]
}
}
}
],
"require": {
"hiren/pdfcrowd-bundle": "dev-master"
}
}
Add the bundle to your application kernel
// File: app/AppKernel.php public function registerBundles() { return array( // ... new Hiren\PDFCrowdBundle\AmpPDFCrowdBundle(), // ... ); }
Configuration
hiren_pdf_crowd: username: your-username apikey: the-api-key
Usage
Controller
$pdfCrowd = $this->get('hiren_pdf_crowd.api'); $url = $this->generateUrl('route_name', array(), true); $pdfData = $pdfCrowd->convertURI($url); $fileName = $this->container->getParameter('kernel.root_dir') . '/../web/pdfs/example.pdf'; file_put_contents($fileName, $pdfData); // Make sure this directory is writable