mPDF Manual – mPDF functions

AutosizeText()

Description

void AutosizeText( string $text, float $width, string $font, string $style [, float $fontsize ])

Writes a single line of text directly to the PDF document at the current position. Font size will be automatically reduced to fit width (but is not increased).

NB Does not reverse RTL text

Parameters

$text

UTF-8 encoded text to write. Single line only.

$width

Width of text in millimeters. The font size will be reduced if required to fit this size.

$font

Font family to use

$style

Font style used

Values

  • [blank for normal]
  • 'i' - italic
  • 'b' - bold
  • 'bi' - italic and bold
$fontsize

Maximum font size in points (pt)

Default: 72

Fork me on GitHub