rotate property

Gets the number of degrees by which the page should be rotated clockwise when displayed or printed.

//Create a PDF document.
PdfDocument document = PdfDocument();
//Get the rotate angle.
PdfPageRotateAngle angle = document.pageSettings.rotate;
//Set the rotation angle.
document.pageSettings.rotate = PdfPageRotateAngle.rotateAngle90;
//Create page and draw text.
document.pages.add().graphics.drawString(
    'Hello World!', PdfStandardFont(PdfFontFamily.helvetica, 12),
    brush: PdfBrushes.black, bounds: Rect.fromLTWH(0, 0, 0, 0));
//Save and dispose document.
List<int> bytes = await document.save();
document.dispose();

Implementation

PdfPageRotateAngle get rotate => _rotateAngle;
void rotate=(PdfPageRotateAngle value)

Sets the number of degrees by which the page should be rotated clockwise when displayed or printed.

//Create a PDF document.
PdfDocument document = PdfDocument();
//Get the rotate angle.
PdfPageRotateAngle angle = document.pageSettings.rotate;
//Set the rotation angle.
document.pageSettings.rotate = PdfPageRotateAngle.rotateAngle90;
//Create page and draw text.
document.pages.add().graphics.drawString(
    'Hello World!', PdfStandardFont(PdfFontFamily.helvetica, 12),
    brush: PdfBrushes.black, bounds: Rect.fromLTWH(0, 0, 0, 0));
//Save and dispose document.
List<int> bytes = await document.save();
document.dispose();

Implementation

set rotate(PdfPageRotateAngle value) {
  if (!_helper.isPageAdded) {
    _rotateAngle = value;
    _helper.isRotation = true;
  }
}