Forum


Replies: 7   Views: 2386
Can't pass 'pstyle' from one wordfragment to another
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 Siegfried  · 12-08-2019 - 09:27

Thank you admin for your reply,

but how do i know if a importet style like

$docx->importStyles($this->templateName, 'merge', array('Heading3'));

is actually a paragraph-style oder a character-style?

How can I import a style like 'Heading3' (see above), and use it as a character-style like:

$wordfragment = new WordFragment($docx);
$text = array();
$text[] = array(
  'text' => 'Sample Text',
  'rStyle' => 'Heading3',
);
$wordfragment->addText($text);

I don't want to create a new Style from scratch, I like to use a pre-defined style from a word-template, so the user can change this style without changing the code...

 

... ok, I see it in the parseStyle-document if it is a pStyle or a rStyle...

So ... is it right, that if I would import some styles, only could use pStyles as pStyles and rStyles as rStyles... in my example I have to create a rStyle in my word-template which afterwards could be reused as a rStyle?