mPDF Manual – mPDF functions


`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

  • `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 [blank for normal]|i|b|bi
  • `fontsize` Maximm font size in points (pt) Default = 72