alignment property

PdfAlignmentStyle alignment

Gets or sets the alignment of the page template element.

//Create a new pdf document
PdfDocument document = PdfDocument();
//Set margins.
document.pageSettings.setMargins(25);
//Create the page template with specific bounds
PdfPageTemplateElement custom = PdfPageTemplateElement(
    Rect.fromLTWH(0, 0, 100, 100), document.pages.add());
document.template.stamps.add(custom);
//Gets or sets  dock style.
custom.dock = PdfDockStyle.right;
//Gets or sets  alignment style.
custom.alignment = PdfAlignmentStyle.middleCenter;
//Draw template into pdf page.
custom.graphics.drawRectangle(
    pen: PdfPen(PdfColor(255, 165, 0), width: 3),
    brush: PdfSolidBrush(PdfColor(173, 255, 47)),
    bounds: Rect.fromLTWH(0, 0, 100, 100));
//Save the document.
List<int> bytes = await document.save();
//Dispose the document.
document.dispose();

Implementation

PdfAlignmentStyle get alignment => _helper._alignmentStyle;
void alignment=(PdfAlignmentStyle value)

Implementation

set alignment(PdfAlignmentStyle value) {
  if (_helper._alignmentStyle != value) {
    _setAlignment(value);
  }
}