Where every page of a document sits in a viewer: pages grouped into spreads, spreads in a strip with gaps and padding, each page turned
by its own Rotate plus the user's rotation; and the exact mapping between viewport pixels, layout points and each page's default
user space, the zooms that fit a viewport, and the pages and tiles a viewport shows.
public sealed class PageLayout
ISO 32000-2 §7.7.2 (Table 29, PageLayout), §7.7.3.3 (Rotate), §8.3.2.3 (default user space) and §14.11.2 (the crop box
is the region displayed; UserUnit). Spec #33 story 54 (viewer capability 14).
Layout space is in points with y down, the same at every zoom: a page's box is its crop box turned and scaled by its user unit. A Viewport shows it at Zoom pixels per point; a page's pixels are those of a render of the whole page at that scale and the layout's Rotation (Region), so the mapping here agrees with the tiles a DocumentSession renders. A layout is immutable and safe to use from any thread; the per-frame queries (GetVisiblePages(in Viewport, Span<VisiblePage>, Double), GetVisibleTiles(in Viewport, Int32, Span<Tile>, Double), the mappings) allocate nothing and search the spreads in logarithmic time.
kind:method, kind:property, kind:ctor. Press Esc to clear.ContentHeightGets the height of the content, padding included, in points: the scroll height is this times the zoom.ContentWidthGets the width of the content, padding included, in points: the scroll width is this times the zoom.GapGets the space between spreads and between the pages of a spread, in points.ModeGets the arrangement.PaddingGets the space around the content, in points.PageCountGets the number of pages.RotationGets the user's rotation added to every page's own, in degrees clockwise (Rotation of the tiles).ShowCoverGets whether the first page stands alone on the right (two-up modes only).SpreadCountGets the number of spreads: groups of one or two pages side by side.Anchor(PageLayout, in Viewport)Moves a viewport from an earlier layout of the same pages to this one (real page sizes replacing placeholders, other options) so that it keeps showing what it showed: the current page of previous keeps its top-left corner where it was in the viewport, at the same zoom.Clamp(in Viewport)Keeps a viewport's scroll offsets inside the content: from 0 to the content's size at the zoom less the viewport's. In a paged mode (SinglePage, TwoUp) the range along the strip widens, when the first or last spread is shorter than the viewport, to the offsets that centre it, so the first and last spreads can be shown on their own.Create(ReadOnlySpan<PageMetrics>, PageLayoutOptions?)Lays out pages from their metrics.CreateAsync(DocumentSession, PageLayoutOptions?, CancellationToken)Lays out every page of a session's document, loading the metrics of pages not yet loaded (a remote document fetches them).GetCurrentPage(in Viewport)Returns the page a viewer reports as current: in the spread at the viewport's centre, the page nearest the centre across the strip.GetPageBounds(Int32)Returns a page's box in layout points: its crop box turned by its rotation (GetPageRotation(Int32)) and scaled by its user unit.GetPageMetrics(Int32)Returns the metrics a page was laid out from.GetPagePixels(Int32, Double)Returns the pixels of a whole-page render at a zoom: the rectangle every Region of the page lies in.GetPageRotation(Int32)Returns the rotation a page is shown at: its own Rotate plus Rotation, as 0, 90, 180 or 270.GetPageTransform(in Viewport, Int32)Returns the transform from a page's default user space to viewport pixels: the device transform of RenderOptions at the viewport's zoom and the layout's rotation, moved to where the page shows. Its inverse maps viewport pixels to the page.GetSpread(Int32)Returns the spread a page belongs to.GetSpreadBounds(Int32)Returns the box a spread occupies in layout points: its pages' extent along the strip, and across it the widest page (or, two-up, both slots beside the spine).GetSpreadPages(Int32)Returns the pages of a spread.GetVisiblePages(in Viewport, Span<VisiblePage>, Double)Lists the pages a viewport shows, in order, and the pixels of each that show. A paged mode shows only the spread at the viewport's centre.GetVisibleTiles(in Viewport, Int32, Span<Tile>, Double)Lists the tiles a viewport shows: each visible page cut into a grid of tileSize pixel squares from its pixel origin (the last row and column clipped to the page), at the viewport's zoom and the layout's rotation, page by page in order.GetZoom(ZoomMode, Double, Double, Int32, Double)Computes a zoom for a viewport size: actual size, or the zoom at which a page's spread and its padding fit.PageToViewport(in Viewport, Int32, PdfRectangle)Maps a rectangle in a page's default user space (an annotation's or a link's Rect) to its bounds in viewport pixels.PageToViewport(in Viewport, Int32, Double, Double)Maps a point in a page's default user space to viewport pixels.ScrollTo(in Viewport, Int32)Scrolls a viewport to a page: its spread's leading edge (less the padding) at the viewport's leading edge (in a paged mode a spread shorter than the viewport is centred instead), the page centred across the strip.Snap(in Viewport)Snaps a viewport along the strip to the spread whose leading edge (less the padding) is nearest its leading edge.TryGetPageAt(in Viewport, Double, Double, out PagePoint)Finds the page under a viewport pixel (hit testing) and the point on it in default user space.ViewportToPage(in Viewport, Int32, Double, Double)Maps viewport pixels to a page's default user space, whether or not the point is on the page.ZoomAt(in Viewport, Double, Double, Double)Changes a viewport's zoom keeping the content under one viewport pixel (a pinch's or a wheel's focus) in place.