/**
 * Sets the global document direction declaration. Default is left-to-right (ltr).
 *
 * @param   string  $dir  The language direction to be set
 *
 * @return  Document instance of $this to allow chaining
 *
 * @since   1.7.0
 */
public function setDirection($dir = 'ltr')
{
    $this->direction = strtolower($dir);
    return $this;
}