From d0ce4f800af46e219df4a2af5f76975427bbfc89 Mon Sep 17 00:00:00 2001 From: DerStoffel Date: Tue, 14 Feb 2012 12:02:42 +0100 Subject: [PATCH] added download option and w3 css3 hints to documentation --- README.markdown | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/README.markdown b/README.markdown index 89d9443..11b6a46 100644 --- a/README.markdown +++ b/README.markdown @@ -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] @@ -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 \ No newline at end of file