Forum


Replies: 6   Views: 3516
Style import
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 jean-sylvain  · 19-04-2012 - 15:51


Hi,

I try to import the styles from a docx file.
I use importStyles to get them and when I use AddText the style is not applied.
Here is the code :


$docx = new CreateDocx();

$fichier_template = "../" . DOSSIER_BROCHURE . "/plaquette.docx";

echo "<p>Ajout du fichier $fichier_template</p>";
$docx->importStyles($fichier_template, "merge", array("Titre 1", "Titre 2", "Titre 3", "Titre 4", "Titre 5", "Titre 6", "Titre 7", "Titre 8", "Titre 9"));
$docx->addDocX($fichier_template);


$paramsText = array(

'font' => 'Arial'
);

$text = "Hello World!";
$docx->addText($text, array("pStyle" => "Titre 5"));


$docx->createDocx("../" . DOSSIER_BROCHURE . "/brochure_enseignement_" . annee_scolaire_intitule($annee_scolaire));

Can you help me?

thanks