Determine the current layout mode
It’s possible to determine the current LayoutMode. NutrientViewer.ViewState#layoutMode has three possible values: SINGLE, DOUBLE, or AUTO. You can query the current value from the ViewState at any time.
In the case of NutrientViewer.LayoutMode.AUTO, you can query the DOM to determine if a single page or two pages are being rendered per spread:
const firstSpread = instance.contentDocument.querySelector( ".PSPDFKit-Spread");const count = firstSpread.querySelectorAll(".PSPDFKit-Page").length;This has been tested on Nutrient Web SDK 2021.5.2.