rotatePage method

Future<void> rotatePage(
  1. int index,
  2. int degrees
)

Implementation

Future<void> rotatePage(int index, int degrees) async {
  final UPdfDict? page = await mutablePage(index);
  if (page == null) return;
  final Object? current = await document.resolve(page["Rotate"]);
  final int base = current is num ? current.toInt() : 0;
  page["Rotate"] = ((base + degrees) % 360 + 360) % 360;
}