Ver Mensaje Individual
  #2 (permalink)  
Antiguo 16/12/2014, 09:41
Avatar de DeivisAndres
DeivisAndres
 
Fecha de Ingreso: febrero-2012
Ubicación: Colombia
Mensajes: 305
Antigüedad: 12 años, 2 meses
Puntos: 41
Respuesta: Symfony y PHPWord !Problemas¡

Excelente, ya pude solucionar el pequeño error.

Aquí se las muestro para el que le salga o no sepa como solucionarlo:

Código PHP:
 public function getReportDocsAction() 
 {            
     
define("DOMPDF_ENABLE_AUTOLOAD"false);
    include(
'/var/www/html/project/vendor/dompdf/dompdf/dompdf_config.inc.php');

        
$phpWord = new PhpOfficePhpWordPhpWord();
    
    
$section $phpWord->addSection();
    
    
$fontStyle = new PhpOfficePhpWordStyleFont();
    
$fontStyle->setBold(true);
    
$fontStyle->setName('Tahoma');
    
$fontStyle->setSize(22);
    
    
$myTextElement $section->addText('Word!');
    
$myTextElement->setFontStyle($fontStyle);

    
$section->addPageBreak();
        
    
$myTextElement $section->addText('Hello Word!');
    
$myTextElement->setFontStyle($fontStyle);

    
$header $section->addHeader();    
    
$header->addText('This is the header with ');
    
$header->addLink('http://google.com''link to Google');

    
$footer $section->addFooter();    
    
$footer->addPreserveText('Page {PAGE} of {NUMPAGES}.');
    
$footer->addLink('http://google.com''Direct Google');

    
$section->addPageBreak();

    
$myTextElement $section->addText('Some text...');
    
$myTextElement->setFontStyle($fontStyle);

    
$objWriter PhpOfficePhpWordIOFactory::createWriter($phpWord'Word2007');
    
$objWriter->save('HelloWorld.docx');
    
    
$rendererName PhpOfficePhpWordSettings::PDF_RENDERER_DOMPDF;    
    
$rendererLibraryPath '/var/www/html/project/vendor/dompdf/dompdf';    

    
PhpOfficePhpWordSettings::setPdfRendererPath($rendererLibraryPath);
    
PhpOfficePhpWordSettings::setPdfRendererName($rendererName);

    
$PHPWord PhpOfficePhpWordIOFactory::load('/var/www/html/project/web/HelloWorld.docx'); 
    
    
$objWriter PhpOfficePhpWordIOFactory::createWriter($PHPWord'PDF');
    
$objWriter->save('HelloWorld.pdf');    

Ahora si me realiza la creación del archivo PDF al 100%, pero ahora se me presento el otro problema con este mismo ya que no esta creando el Footer y Header y las paginas que deberían salir en el PDF que están en el archivo DOCX, pero eso es otra historia, lo importante es que pude dar con el problema que era que esta dando render a la ruda del path equivocada.