Skip to content

Commit

Permalink
added download option and w3 css3 hints to documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
DerStoffel committed Feb 14, 2012
1 parent 6cccfa4 commit d0ce4f8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions README.markdown
Expand Up @@ -9,10 +9,10 @@ Installation

*If your are using git and manages your vendors as submodules, use the following commands to add this bundle to your Symfony project.*

Copy the SpraedPDFGeneratorBundle into the `vendor/bundles/Spraed/PDFGeneratorBundle` directory:
Copy the SpraedPDFGeneratorBundle into the `vendor/bundles/Spraed/PDFGeneratorBundle` directory:

git submodule add https://github.com/stedekay/SpraedPDFGeneratorBundle.git vendor/bundles/Spraed/PDFGeneratorBundle

Or use deps file:

[SpraedPDFGeneratorBundle]
Expand Down Expand Up @@ -41,10 +41,15 @@ Usage
There is a service registered in the services.yml to generate pdf files.
Just call the PDF generator from the service class and call the generatePDF()-method
with the XHTML and the url of the PDF:

$html = $this->renderView('AcmeDemoBundle:Default:index.html.twig');
$pdfGenerator = $this->get('spraed.pdf.generator');
$pdfGenerator->generatePDF($html, 'out.pdf');

Also you are able to set an download option (true/false), standard is false

$pdfGenerator->generatePDF($html, 'out.pdf', true);

To define proper print css you might want to read into the w3.org's hints on that
[w3.org]: http://www.w3.org/TR/css3-page/
[flyingsaucer]: http://code.google.com/p/flying-saucer/
[spraed]: http://www.spraed.com

0 comments on commit d0ce4f8

Please sign in to comment.