当前位置:网站首页>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 同步显示。
边栏推荐
- Mo Tianlun salon | Tsinghua qiaojialin: Apache iotdb, originated from Tsinghua, builds an open source ecological road
- STC 32位8051单片机开发实例教程 三 程序编译设置与下载
- 2022/5/23-2022/5/30
- 【多线程】 实现单例模式 ( 饿汉、懒汉 ) 实现线程安全的单例模式 (双重效验锁)
- 优质笔记软件综合评测和详细盘点(一) Notion、Obsidian、RemNote、FlowUs
- Review the collection container again
- [untitled]
- ModSim基本使用(Modbus模拟器)
- New window open page -window open
- switch 有四样写法你知道么
猜你喜欢
Example explanation: move graph explorer to jupyterlab
Procédure de mesure du capteur d'accord vibrant par le module d'acquisition d'accord vibrant
Oracle physical architecture
[AI server setup] CUDA environment
【多线程】 实现单例模式 ( 饿汉、懒汉 ) 实现线程安全的单例模式 (双重效验锁)
3D全景模型展示可视化技术演示
由浅入深学会白盒测试用例设计
毕业季 | 华为专家亲授面试秘诀:如何拿到大厂高薪offer?
Interview question 1
数据分析师听起来很高大上?了解这几点你再决定是否转型
随机推荐
servlet知识点
Unreal Engine packaging project
为定时器和延时器等其它情况的回调函数绑定当前作用域的this
Process steps of vibrating wire acquisition module for measuring vibrating wire sensor
EURA欧瑞E1000系列变频器使用PID实现恒压供水功能的相关参数设置及接线
Win11暂停更新点不了怎么办?Win11暂停更新是灰色的如何解决?
EasyCVR集群视频广场页面切换时,请求流未能终止的问题优化
1592 例题1 国王(Sgu223 LOJ10170 LUOGU1896 提高+/省选-) 暴力思考 状压DP 01背包
Interesting! Database is also serverless!
Bind this of the current scope for callback functions in other cases such as timers and delayers
How to add transactions in JDBC
docker ubuntu容器中安装mysql遇到的问题
毕业季 | 华为专家亲授面试秘诀:如何拿到大厂高薪offer?
Easycvr accesses the equipment through the national standard gb28181 protocol. What is the reason for the automatic streaming of the equipment?
Modsim basic use (Modbus simulator)
Install redis under Linux and configure the environment
Arduino stepper library drive 28byj-48 stepper motor test program
list分割成满足和不满足条件的集合(partitioningBy)
PHP获取微信小程序和小程序商店外链地址
Difference between redo and undo