Snippets
- Learn phpdocx in 5 minutes
- Tutorial
- API quick guide
- HTML to Word
- HTML Extended
- Conversion plugin
- Word to HTML
- DOCXPath
- Bulk processing
- DOCXCustomizer
- Digital signature
- Cryptophpdocx
- Right to left languages
- phpdocx CLI command
- Tracking
- Artificial Intelligence
- Blockchain for documents
- JavaScript API
- Compiled mode
Get font size from a content
DOCX applies cascade styles: the more specific the style, the more priority it has.
This way, inline styles take precedence over custom styles. Next, custom styles have priority over content default styles, and those take precedence over document default styles.
phpdocx allows to get all the styles of a document, e.g., to obtain the font size of a paragraph:
An almost identical code can be run to obtain other properties like font family, colors, spacingsā¦ just checking the relevant tag.