lineLimit property
Gets and sets whether entire lines are laid out in the formatting rectangle only or not.
//Create a new PDF document.
PdfDocument document = PdfDocument()
..pages.add().graphics.drawString(
'Hello World!', PdfStandardFont(PdfFontFamily.helvetica, 12),
bounds: Rect.fromLTWH(0, 0, 200, 100),
format: PdfStringFormat(
alignment: PdfTextAlignment.center,
lineAlignment: PdfVerticalAlignment.middle,
characterSpacing: 1,
lineSpacing: 1.1,
measureTrailingSpaces: true,
paragraphIndent: 2.1,
wordSpacing: 1.5,
wordWrap: PdfWordWrapType.word,
subSuperscript: PdfSubSuperscript.subscript)
..clipPath = true
..noClip = true
//Set line limit.
..lineLimit = true);
//Save the document.
List<int> bytes = await document.save();
//Close the document.
document.dispose();
Implementation
bool lineLimit = true;