Forum


Replies: 8   Views: 3998
Importstyles issues
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by Alain DIAS  · 19-11-2015 - 10:18

Ok I finally succeed to generate the template. Now how can I apply my custom styles that are generate in my template (if I understood) ? Have I to load it the template (if so how ? With CreateDocFromTemplate or other?) ?

 

public function generate() {
      $this->generateTemplate();
    // Create a new document
        $docx = new \Phpdocx();
}
private function generateTemplate()
    {
        // Create a new document
        $docx = new \Phpdocx();
        // Imports style from the template
        $path = $this->container->getParameter('kernel.root_dir') . '/../web/bundles/rffconcertationsrest/templates/report.docx';
        $docx->parseStyles($path);
        $uploadPath = $this->container->getParameter('kernel.root_dir') . '/../web/uploads/';
        $docx->createDocx($uploadPath.'templateParseStyles');
    }