PdfStringFormat class
Represents the text layout information on PDF
//Create a new PDF document.
PdfDocument document = PdfDocument()
..pages.add().graphics.drawString(
'Hello World!', PdfStandardFont(PdfFontFamily.helvetica, 12),
//Create a new PDF string format instance.
format: PdfStringFormat(
alignment: PdfTextAlignment.left,
lineAlignment: PdfVerticalAlignment.top,
textDirection: PdfTextDirection.leftToRight,
characterSpacing: 0.5,
wordSpacing: 0.5,
lineSpacing: 0.5,
subSuperscript: PdfSubSuperscript.superscript,
paragraphIndent: 10,
measureTrailingSpaces: true,
wordWrap: PdfWordWrapType.word));
//Save the document.
List<int> bytes = await document.save();
//Close the document.
document.dispose();
Constructors
- PdfStringFormat({PdfTextAlignment alignment = PdfTextAlignment.left, PdfVerticalAlignment lineAlignment = PdfVerticalAlignment.top, PdfTextDirection textDirection = PdfTextDirection.none, double characterSpacing = 0, double wordSpacing = 0, double lineSpacing = 0, PdfSubSuperscript subSuperscript = PdfSubSuperscript.none, double paragraphIndent = 0, bool measureTrailingSpaces = false, PdfWordWrapType wordWrap = PdfWordWrapType.word})
- Initializes a new instance of the PdfStringFormat class with horizontal alignment and vertical alignment of text.
Properties
- alignment ↔ PdfTextAlignment
-
Gets and sets Horizontal text alignment.
getter/setter pair
- characterSpacing ↔ double
-
Gets and sets Character spacing value.
getter/setter pair
- clipPath ↔ bool
-
Gets and sets if the text should be a part of the current clipping path.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- lineAlignment ↔ PdfVerticalAlignment
-
Gets and sets Vertical text alignment.
getter/setter pair
- lineLimit ↔ bool
-
Gets and sets whether entire lines are laid out in the
formatting rectangle only or not.
getter/setter pair
- lineSpacing ↔ double
-
Gets and sets Text leading or Line spacing.
getter/setter pair
- measureTrailingSpaces ↔ bool
-
Gets and sets whether spaces at the end of the line should be
left or removed.
getter/setter pair
- noClip ↔ bool
-
Gets and sets whether the text region should be clipped or not.
getter/setter pair
- paragraphIndent ↔ double
-
Gets or sets the indent of the first line in the paragraph.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- subSuperscript ↔ PdfSubSuperscript
-
Gets and sets whether the text is in subscript or superscript mode.
getter/setter pair
- textDirection ↔ PdfTextDirection
-
Gets and sets text rendering direction.
getter/setter pair
- wordSpacing ↔ double
-
Gets and sets Word spacing value.
getter/setter pair
- wordWrap ↔ PdfWordWrapType
-
Gets and sets text wrapping type.
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited