salva / pdfjs-bundle
This bundle provides a simple integration of pdfjs from mozilla into Symfony2.
Installs: 6 868
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 2
Open Issues: 0
Language:JavaScript
Type:symfony-bundle
Requires
- php: >=5.3.2
- symfony/framework-bundle: 2.*
This package is auto-updated.
Last update: 2023-10-10 12:54:49 UTC
README
This bundle provides a simple integration of the "PDF.JS library" from mozilla into Symfony2.
Installation
1) Download SalvaPdfJsBundle
Using the vendors script
Add the following lines to the deps
file at the root of your project file:
[SalvaPdfJsBundle]
git=http://github.com/nibsirahsieu/SalvaPdfJsBundle.git
target=bundles/Salva/PdfJsBundle
Next, update your vendors by running:
$ ./bin/vendors install
Using composer
Tell composer to download the bundle by running the command:
$ php composer.phar require salva/pdfjs-bundle:1.0.*@dev
2) Configure the autoloader (no needed for composer)
Add the following entry to your autoloader:
<?php // app/autoload.php $loader->registerNamespaces(array( // ... 'Salva' => __DIR__.'/../vendor/bundles', ));
3) Enable the bundle
Finally, enable the bundle in the kernel:
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Salva\PdfJsBundle\SalvaPdfJsBundle(), ); }
Basic Usage
<?php $file = '/uploads/yourpdf.pdf'; //relative to your website root directory return $this->get('salva_pdf_js.controller')->renderPdf($file);