/** * @Template() */ public function etiquetteAction() { $action = $this->_action(); /** @var $request \Symfony\Component\HttpFoundation\Request */ $request = $this->get('request'); if ($request->getMethod() == 'POST') { $page = $this->render('ApplicationSonataClientBundle:Impression:etiquette_pdf.html.twig', array_merge($action, array('post' => $request->request->all()))); $mpdf = new mPDF('c', 'A4', 0, '', 0, 0, 0, 0, 9, 2); //$mpdf->SetDisplayMode('fullpage'); $mpdf->WriteHTML($page->getContent()); $mpdf->Output(); exit; } return $action; }
public function virementAction($amount, $coordonnees, $facture) { $client = $this->getClient(); $coordonneesId = (int) $coordonnees; $amountEuro = $this->amountToEuro($amount); $amount = $this->amountToInt($amount); $em = $this->getDoctrine()->getManager(); $coordonnees = $em->getRepository('ApplicationSonataClientBundle:Coordonnees')->find($coordonneesId); $page = $this->render('ApplicationSonataClientBundle::virement.html.twig', array('client' => $client, 'amount' => $amountEuro, 'amountWords' => $this->amountToWords($amount), 'coordonnees' => $coordonnees, 'facture' => $facture)); if (isset($_GET['d'])) { echo $page->getContent(); } else { $mpdf = new mPDF('c', 'A4', 0, '', 15, 15, 13, 13, 9, 2); $mpdf->WriteHTML($page->getContent()); $mpdf->Output(); } exit; }
/** * @return \Symfony\Component\HttpFoundation\Response */ public function attestationAction() { $debug = isset($_GET['d']); $page = $this->render('ApplicationSonataClientOperationsBundle::attestation.html.twig', array('info' => array('time' => strtotime($this->_year . '-' . $this->_month . '-01'), 'month' => $this->_month, 'year' => $this->_year, 'quarter' => floor(($this->_month - 1) / 3) + 1), 'debug' => $debug)); if (!$debug) { $mpdf = new mPDF('c', 'A4', 0, '', 5, 10, 13, 13, 9, 2); //$mpdf->SetDisplayMode('fullpage'); $mpdf->WriteHTML($page->getContent()); $mpdf->Output(); exit; } return $page; }