mPDF Manual – What Else Can I Do

# Text Justification

## Justifying text & Spacing

### Character and Word spacing

When text-alignment is set to Justify (i.e. aligning to both right and left margins), word spacing and character spacing are normally used to justify text.

The default is to use a mix of character and word spacing. The ratio is set by variables defined at the top of the mpdf.php file:

### Justification before line-breaks

In a justified text block, an inline <img>, <textarea>, <input>, or <select> element which causes a new line, force the previous line to be justified. However, a <hr> or <br> do not force justification of the preceeding text.

This behaviour matches most browsers. To allow optional compliance with the bahaviour of MS Word, which also justifies text before a <br> you can set the configurable variable justifyB4br to true.