getPagesWidth method
Gets the width of all pages in the document.
Implementation
@override
Future<Int32List?> getPagesWidth(String documentID) async {
int pageCount = _documentRepo[documentID]?.numPages ?? 0;
Int32List pagesWidth = new Int32List(pageCount);
for (int pageNumber = 1; pageNumber <= pageCount; pageNumber++) {
PdfJsPage page = await promiseToFuture<PdfJsPage>(
_documentRepo[documentID]!.getPage(pageNumber));
PdfJsViewport viewport = page.getViewport(_settings);
pagesWidth[pageNumber - 1] = viewport.width.toInt();
}
return pagesWidth;
}