AddPageMeasureViewportA

Page properties, Measurement and coordinate units

Description

The trailing A denotes the ANSI (char) DLL entry point; the ActiveX/COM surface exposes only the Unicode form. Behaviour is identical to AddPageMeasureViewport and string arguments are interpreted using the current SetAnsiMode code page

Appends a rectilinear measurement viewport (/VP) with a /Subtype /RL measure dictionary to the selected page per ISO 32000-1 §12.9

Syntax

Delphi

Function DLAddPageMeasureViewportA(InstanceID: Integer; Left, Bottom, Width, Height, ScaleRatio: Double; UnitLabel, Name: PAnsiChar): Integer;

DLL

int DLAddPageMeasureViewportA(int InstanceID, double Left, double Bottom, double Width, double Height, double ScaleRatio, const char* UnitLabel, const char* Name);

Parameters

LeftHorizontal coordinate of the viewport bounding box
BottomVertical coordinate of the viewport bounding box
RightAbsolute right coordinate of the viewport bounding box in PDF user space; legacy facade parameter name Width
TopAbsolute top coordinate of the viewport bounding box in PDF user space; legacy facade parameter name Height
ScaleRatioWorld units per PDF user-space unit (must be positive)
UnitLabelMeasurement unit label (defaults to m when empty)
NameOptional viewport name written to /Name

Return values

A nonzero viewport handle when the viewport was appended, or 0 when the page is unavailable or ScaleRatio is non-positive

Remarks

The DLL and ActiveX Width and Height labels are retained for compatibility, but their values are absolute Right and Top coordinates, not extents; dimensions are not validated by this method

Creates a /Type /Viewport dictionary with /BBox and a /Measure dictionary of /Subtype /RL containing /R, /X, /D and /A number format arrays

Automatically ensures the document version is at least PDF 1.6

See also

AddLGIDictToPage, GetPageViewPortCount