AddPageMeasureViewport

页面属性、测量和坐标单位

描述

按 ISO 32000-1 §12.9 向所选页面追加直线测量视口(/VP),带 /Subtype /RL 测量字典

语法

Delphi

Function AddPageMeasureViewport(Left, Bottom, Right, Top, ScaleRatio: Double; Const UnitLabel, Name: WideString): Integer;

ActiveX

Function PDFlib::AddPageMeasureViewport(Left As Double, Bottom As Double, Width As Double, Height As Double, ScaleRatio As Double, UnitLabel As String, Name As String) As Long

DLL

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

参数

Left视口包围盒的水平坐标
Bottom视口包围盒的垂直坐标
Right视口包围盒在 PDF 用户空间中的绝对右坐标;旧门面参数名为 Width
Top视口包围盒在 PDF 用户空间中的绝对上坐标;旧门面参数名为 Height
ScaleRatio每 PDF 用户空间单位对应的世界单位数(必须为正)
UnitLabel测量单位标签(为空时默认 m)
Name可选的视口名称,写入 /Name

返回值

视口成功追加时返回非零视口句柄;页面不可用或 ScaleRatio 非正时返回 0

备注

DLL 与 ActiveX 的 Width、Height 参数名为兼容而保留,但其值是绝对的 Right 与 Top 坐标,而不是尺寸;本方法不校验尺寸

创建带 /BBox 的 /Type /Viewport 字典,以及 /Subtype /RL 的 /Measure 字典,内含 /R、/X、/D 和 /A 数字格式数组

自动保证文档版本不低于 PDF 1.6

另请参阅

AddLGIDictToPage, GetPageViewPortCount