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 LongDLL
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