Page Viewports and Measurement

ISO 32000-1/2 12.9 Tables 260 through 269 define page /VP viewports carrying /Subtype /RL rectilinear or /Subtype /GEO geospatial measure dictionaries, optionally with a /PtData /Subtype /Cloud point-data table

Rectilinear viewports

THPDFPage.AddRectilinearViewport(Name, Left, Bottom, Right, Top, ScaleRatio, ConversionFactor, UnitLabel, ...) is the one-call form — one linear and one derived area unit, defaulting the scale ratio text from the factor — and THPDFPage.AddRectilinearViewportEx(Name, ..., Measure) takes the full THPDFRectilinearMeasureInfo record with per-axis, distance, area, angle and slope number-format arrays of THPDFNumberFormatEntry records in THPDFNumberFormatEntryArray values, an origin and a change-rate-of-y factor

THotPDF.AddPageRectilinearViewport and THotPDF.AddPageRectilinearViewportEx are the page-index counterparts for a document the caller addresses by number; both require PDF 1.6

THPDFPage.AddGeospatialViewport(Name, Left, Bottom, Right, Top, Measure) and THPDFPage.SetViewportPointDataCloud(ViewportIndex, AttributeNames, FlatPointValues) are the current-page variants of the geospatial and point-data writers for code that already holds the page instance

Geospatial viewports and point clouds

THotPDF.AddPageGeospatialViewport(PageIndex, Name, BBox..., Measure) writes a PDF 2.0 geospatial measure from the THPDFGeoMeasureInfo record — a THPDFCoordinateSystemInfo coordinate system of THPDFCoordinateSystemType GEOGCS or PROJCS identified by EPSG or WKT, optional datum shift, linear, area and angular units, bounds, and the paired GIS and page-space tie points

THotPDF.SetPageViewportPointDataCloud(PageIndex, ViewportIndex, AttributeNames, FlatPointValues) attaches the /PtData /Subtype /Cloud dictionary of measured per-point attributes to an existing viewport, with the flat values arranged as rows of the attribute list

Reading measures back

THotPDF.GetLoadedPageViewports(PageIndex) returns every viewport of a loaded page as a THPDFViewportInfo record in a THPDFViewportInfoArray — name, bounding box, measure subtype, the parsed rectilinear or geospatial measure record, and the point-data cloud as a THPDFPointDataCloudInfo whose THPDFPointDataAttributeRow rows carry the measured values

THotPDF.GetLoadedAnnotationMeasure(PageIndex, AnnotationIndex, Subtype, Rectilinear, Geospatial) parses the measure dictionary of the annotation at the given index, for dimensioning and scaling annotations such as measurement lines and polygons

THotPDF.AttachLoadedAnnotationMeasure attaches a measure to an annotation