THPDFViewer Region Snapshots
Renders only a selected PDF page rectangle so memory use depends on the region rather than the full page
Declarations
function CreatePageRegionSnapshot(PageIndex: Integer;
const PageRect: THPDFRectangle; DPI: Integer= 150): TBitmap;
function CreateCurrentPageRegionSnapshot(const PageRect: THPDFRectangle;
DPI: Integer= 150): TBitmap;
Region handling
- The input rectangle uses PDF points and a lower-left origin
- Reversed left/right or bottom/top values are ordered automatically
- The region is intersected with the visible page box, the CropBox clipped to the MediaBox, before rendering
- An empty intersection or invalid page returns
nil - DPI values are clamped from 12 through 2400
- The returned bitmap includes both the PDF page rotation and current
ViewRotation
Example
Region.Left := 72;
Region.Bottom := 72;
Region.Right := 288;
Region.Top := 216;
Bitmap := Model.CreateCurrentPageRegionSnapshot(Region, 300);