THPDFPage.AddRectilinearViewport Method

Adds a /Type /Viewport dictionary with a rectilinear (/Subtype /RL) /Measure to the page’s /VP array, so conforming viewers can measure distances and areas on the page in real-world units (ISO 32000-1 ยง12.9, Tables 260–263)

Declaration

function AddRectilinearViewport(const Name: AnsiString; Left, Bottom, Right, Top: Double; const ScaleRatio: AnsiString; ConversionFactor: Double; const UnitLabel: AnsiString; const AreaUnitLabel: AnsiString= ''; OriginX: Double= 0.0; OriginY: Double= 0.0; CYX: Double= 1.0): Integer;

Unit

HPDFDoc

Parameters

NamePurpose
NamePDF resource name, packet name, profile name, or caller-defined identifier
LeftPage coordinate or size value expressed in the current HotPDF coordinate space
BottomPage coordinate or size value expressed in the current HotPDF coordinate space
RightPage coordinate or size value expressed in the current HotPDF coordinate space
TopPage coordinate or size value expressed in the current HotPDF coordinate space
ScaleRatioScale ratio text written as /R, for example '1 pt = 0.01 m'; when empty, a ratio is generated from ConversionFactor and UnitLabel
ConversionFactorFactor converting default user space units to UnitLabel units along the x axis (and the y axis when no separate /Y is given). Per ISO 32000-1 Table 262 the first /D and /A number formats convert from the x units (squared for area), and the viewer applies the axis factor first, so this simple overload writes their conversion factors as 1: distance is measured in UnitLabel and area in its square
UnitLabelUnit label (/U) for the x axis and for distance, for example 'm'
AreaUnitLabelUnit label for area; defaults to 'sq ' + UnitLabel
OriginXx coordinate of the measurement origin (/O) in default user space; written when either origin coordinate is non-zero
OriginYy coordinate of the measurement origin (/O) in default user space
CYXRatio of y axis units to x axis units (/CYX); meaningful when the axes use different scales

Return value

The zero-based index of the new viewport in the page’s /VP array, suitable for SetViewportPointDataCloud

Usage notes

Related APIs