rasterGeometry
rasterGeometry with the library's default allocation ceiling.
The PdfRasterGeometry for rendering this page at scale device pixels per PDF user-space unit (so scale = dpi / 72.0). maxPixels prevents an untrusted page size, /UserUnit, or accidental scale from requesting an allocation large enough to terminate the host process.
Composes three things a correct rasterizer needs and a naive one skips:
The ROTATED display box (PdfPage.rotatedWidth / rotatedHeight):
/CropBoxintersected with/MediaBox, with/Rotatefolded in (ISO 32000-1 7.7.3.3), not the raw unrotated/MediaBox.PdfPage.pageToDeviceBase, which already maps that box's own origin (wherever
/MediaBoxsits, not necessarily[0 0]) onto a top-left, y-down device box, rather than a plain Y-flip that assumes the page starts at[0 0]./UserUnit(14.11.2, Table 30): a positive multiplier on the 1/72in default user-space unit, e.g./UserUnit 2on a 612-wide page is physically 1224/72in wide, so its rendered output is twice as wide at the same scale. This changes output dimensions for any document that carries/UserUnit, which previously had no effect on rendering at all. A missing, non-positive or non-finite/UserUnitdegrades to the spec default of 1 (lenient salvage) rather than producing a zero, negative or mirrored surface.
scale and /UserUnit both multiply the same way, so they compose into one factor applied once: effective = scale * userUnit.