setRotation method
Set the rotation angle of the current page.
Rotation on a page. Must be 0, 90, 180 or 270 (negative rotations will be "normalized" to one of 0, 90, 180 or 270).
Some PDF's have an inherent rotation and so -rotation may be non-zero when a PDF is first opened.
example:
bool result = await page.setRotation(90);
Implementation
Future<bool> setRotation(int rotation) async {
const validRotations = [0, 90, 180, 270];
if (rotation == 360) {
rotation = 0;
}
if (!validRotations.contains(rotation)) {
throw ArgumentError(
'Invalid rotation value: $rotation. Must be one of 0, 90, 180, or 270.');
}
return await _channel.invokeMethod(
'set_page_rotation', {'page_index': pageIndex, 'rotation': rotation});
}