THPDFPage.Height Property

 

THPDFPage.Height

THPDFPage

 

顶部  上一页  下一页

指定页面的垂直和水平尺寸

 

Delphi 语法:

property Height: Single;

 

C++ syntax:

__property float Height;

 

说明

使用 Height 属性读取或更改页面高度

Height 以 point 为单位,新值也按 point 解释。绘图坐标以 1/THotPDF.Resolution inch 为单位,因此 Resolution 不是 72 时,请读 UserHeight 来获得与绘图单位一致的页面高度。设置 Height 会把页面变为 UserDefined,而 UserDefined 页面以 point 绘制

页面从文件载入时,设置 Height 会写入页面自己的 MediaBox:与其他页面共享的 MediaBox,或数值存放在独立对象中的 MediaBox,会先替换为本页面专属的副本,因此其他页面对象保持原值。对画布已关闭的页面设置 Height 会抛出 EHPDFPageClosedError

 

代码示例

// Creating multi-size pages in a single PDF document
HPDF.AddPage( A4, poPortrait );
Label1.Caption := 'Page 1 = ' + IntToStr( HPDF.CurrentPage.Width ) + 'x' + IntToStr( HPDF.CurrentPage.Height );

HPDF.AddPage( Letter, poLandscape );
Label2.Caption := 'Page 2 = ' + IntToStr( HPDF.CurrentPage.Width ) + 'x' + IntToStr( HPDF.CurrentPage.Height );

 

另请参阅: UserHeight, Width, Size