当前位置:网站首页>RichView RichEdit SRichViewEdit PageSize 页面设置与同步
RichView RichEdit SRichViewEdit PageSize 页面设置与同步
2022-07-01 18:57:00 【lyhoo163】
RichView RichEdit SRichViewEdit PageSize 页面设置与同步
使用RichView,创建Doc文件时,通过设置好TRVDocParameters设置好页面后,生成的Doc文件或Rtf文件时,文件是保存了Page的设置,但创建的文件,需要导入DBSRichViewEdit保存后,末能导入Page设置数据,同时通过DBSRichViewEdit,显示不能同步Page的设置。
通常我们文档的Page设置,通过TRVDocParameters设置:



参考上述参数,设置:
procedure SetDocParameters(DP: TRVDocParameters;sPage:string);
begin
if sPage='A4' then
begin
DP.PageWidth := 210; // 单位是毫米
DP.PageHeight := 297;
DP.LeftMargin := 40;
DP.RightMargin := 25;
DP.TopMargin := 30;
DP.BottomMargin := 30;
DP.HeaderY := 10;
DP.FooterY := 10;
end;
if sPage='A5' then
begin
DP.PageWidth := 148;
DP.PageHeight := 210;
DP.LeftMargin := 30;
DP.RightMargin := 20;
DP.TopMargin := 20;
DP.BottomMargin := 20;
DP.HeaderY := 10;
DP.FooterY := 10;
end;
end;
这样,我们就能通过代码,设置指定页面的DOC文档了。
例如:过程 procedure Generate(sPage:string); 就是创建文本的过程,具体代码略。
当执行 Generate(‘A4')和 Generate(‘A5')时,由于SRichViewEdit默认什是A4,屏幕显示的都是A4的页面。

上图A4界面,下图A5界面。

经研究TSRichViewEdit类,修改或设置Page页面的数据,只能通过PageProperty属性创建或修改。
在procedure Generate(sPage:string);,代码中,通过流导入文档时,加入代码:
if sPage='A4' then
begin
RV.PageProperty.PageWidth := 21; // 单位是厘米
RV.PageProperty.PageHeight := 29.7;
RV.PageProperty.LeftMargin := 4;
RV.PageProperty.RightMargin := 2.5;
RV.PageProperty.TopMargin := 3;
RV.PageProperty.BottomMargin := 3;
RV.PageProperty.HeaderY := 1;
RV.PageProperty.FooterY := 1;
end;
if sPage='A5' then
begin
RV.PageProperty.PageWidth := 14.8;
RV.PageProperty.PageHeight := 21;
RV.PageProperty.LeftMargin := 3;
RV.PageProperty.RightMargin := 2;
RV.PageProperty.TopMargin := 2;
RV.PageProperty.BottomMargin := 2;
RV.PageProperty.HeaderY := 1;
RV.PageProperty.FooterY := 1;
end;
实现RichEdit SRichViewEdit PageSize 同步显示。
边栏推荐
- Graduation season | Huawei experts teach the interview secret: how to get a high paying offer from a large factory?
- 渗透工具-TrustedSec 公司的渗透测试框架 (PTF)
- 2022/5/23-2022/5/30
- 较真儿学源码系列-InheritableThreadLocal(逐行源码带你分析作者思路)
- 3D全景模型展示可视化技术演示
- What if the win11 shortcut key switching input method doesn't respond? Shortcut key switching input method does not respond
- 2022/5/23-2022/5/30
- windows环境 redis安装和启动(后台启动)
- Class loading mechanism
- 振弦采集模塊測量振弦傳感器的流程步驟
猜你喜欢

振弦采集模塊測量振弦傳感器的流程步驟

Hls4ml reports an error the board_ part definition was not found for tul. com. tw:pynq-z2:part0:1.0.

Example explanation: move graph explorer to jupyterlab

Interview questions shared in today's group

运动捕捉系统原理
![Leetcode 1380 lucky numbers in matrix [array] the leetcode path of heroding](/img/56/0c7f39406814b5bf92eca5f6670e10.jpg)
Leetcode 1380 lucky numbers in matrix [array] the leetcode path of heroding

What if the win11 shortcut key switching input method doesn't respond? Shortcut key switching input method does not respond

JS的Proxy

GC garbage collection

JS 之 常用内置类的使用
随机推荐
Is Dao safe? Build finance encountered a malicious governance takeover and was looted!
Difference between redo and undo
Install redis under Linux and configure the environment
EasyCVR集群视频广场页面切换时,请求流未能终止的问题优化
C#联合halcon应用——大华相机采集类
list分割成满足和不满足条件的集合(partitioningBy)
为定时器和延时器等其它情况的回调函数绑定当前作用域的this
Wechat applet realizes keyword highlighting
C # joint Halcon application - Dahua camera acquisition class
uniapp使用腾讯地图选点 没有window监听回传用户的位置信息,怎么处理
走进如心小镇,数智化变革连接“未来社区”
Iframe 父子页面通信
list大集合等比分割成多个小list集合
Use of common built-in classes of JS
Realize pyramids through JS (asterisk pyramid, palindrome symmetric digital pyramid)
再回顾集合容器
实例讲解将Graph Explorer搬上JupyterLab
PowerDesigner设计Name和Comment 替换
Modsim basic use (Modbus simulator)
GaussDB(for MySQL) :Partial Result Cache,通过缓存中间结果对算子进行加速