rotation property Null safety

PdfPageRotateAngle rotation

Gets or sets the rotation of PDF page

This property only works on existing PDF document pages

//Create a new PDF document.
PdfDocument document = PdfDocument(inputBytes: data);
//Rotation of the PDF page
PdfPageRotateAngle rotation = document.pages[0].rotation;
//Save the document.
List<int> bytes = document.save();
//Dispose the document.
document.dispose();

Implementation

PdfPageRotateAngle get rotation {
  _rotation ??= _obtainRotation();
  return _rotation!;
}
void rotation=(PdfPageRotateAngle angle)

Implementation

set rotation(PdfPageRotateAngle angle) {
  if (_isLoadedPage && rotation != angle) {
    _rotation = angle;
    _dictionary[_DictionaryProperties.rotate] =
        _PdfNumber(PdfSectionCollection._rotateFactor * angle.index);
  }
}