rotation property

PdfPageRotateAngle get 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 = await document.save();
//Dispose the document.
document.dispose();

Implementation

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

Implementation

set rotation(PdfPageRotateAngle angle) {
  if (_helper.isLoadedPage && rotation != angle) {
    _rotation = angle;
    _helper.dictionary![PdfDictionaryProperties.rotate] =
        PdfNumber(PdfSectionCollectionHelper.rotateFactor * angle.index);
  }
}