AddMeasureLineAnnotation

Annotations and hotspot links, Measurement and coordinate units

Description

Adds a /Subtype /Line annotation with /IT /LineDimension, leader lines (/LL, /LLE), a /Subtype /RL /Measure dictionary, and an automatically synthesised normal appearance stream (/AP /N)

Syntax

Delphi

Function AddMeasureLineAnnotation(X1, Y1, X2, Y2, LeaderLength, ScaleRatio: Double; Const UnitLabel, CustomText: WideString; Red, Green, Blue: Double): Integer;

ActiveX

Function PDFlib::AddMeasureLineAnnotation(X1 As Double, Y1 As Double, X2 As Double, Y2 As Double, LeaderLength As Double, ScaleRatio As Double, UnitLabel As String, CustomText As String, Red As Double, Green As Double, Blue As Double) As Long

DLL

int DLAddMeasureLineAnnotation(int InstanceID, double X1, double Y1, double X2, double Y2, double LeaderLength, double ScaleRatio, const wchar_t* UnitLabel, const wchar_t* CustomText, double Red, double Green, double Blue);
int DLAddMeasureLineAnnotationA(int InstanceID, double X1, double Y1, double X2, double Y2, double LeaderLength, double ScaleRatio, const char* UnitLabel, const char* CustomText, double Red, double Green, double Blue);

Parameters

X1Start horizontal coordinate
Y1Start vertical coordinate
X2End horizontal coordinate
Y2End vertical coordinate
LeaderLengthPerpendicular leader line offset
ScaleRatioWorld units per PDF user-space unit
UnitLabelMeasurement unit label (for example mm or m)
CustomTextOptional custom caption text overriding the computed distance label
RedRed colour component (0.0 to 1.0)
GreenGreen colour component (0.0 to 1.0)
BlueBlue colour component (0.0 to 1.0)

Return values

1 when the measurement line annotation was added to the selected page, or 0 on failure

See also

AddLineAnnotation, AddPageMeasureViewport