Forum


Replies: 10   Views: 454
Upgrade guide from version 5 corporate to 9 advanced
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 admin  · 20-06-2019 - 11:37

Hello,

If the Normal style, that is the default style for paragraphs doesn't have a size value, then default document styles are used.

You can get the default styles from a DOCX using Indexer:

$indexer = new Indexer('document.docx');
$indexerOutput = $indexer->getOutput();

// default run-of-text styles
var_dump($indexerOutput['styles']['docDefaults']['rPrDefault']);
// default paragraph styles
var_dump($indexerOutput['styles']['docDefaults']['pPrDefault']);

You just need to get the w:sz value (the size value is usually found as default run-of-text style).

Regards.