/**
  * Stream document for object
  *
  * @param CCompteRendu $compte_rendu Document
  * @param CMbObject    $object       Object
  * @param string       $factory      Factory name
  *
  * @return void
  */
 static function streamDocForObject($compte_rendu, $object, $factory = null)
 {
     ob_clean();
     $template = new CTemplateManager();
     $source = $compte_rendu->getFullContentFromModel();
     $object->fillTemplate($template);
     $template->renderDocument($source);
     $htmltopdf = new CHtmlToPDF($factory);
     $htmltopdf->generatePDF($template->document, 1, $compte_rendu, new CFile());
     CApp::rip();
 }