当前位置:网站首页>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 同步显示。
边栏推荐
- Understand the structure in C language in one article
- 一个悄然崛起的国产软件,低调又强大!
- Leetcode 1380 lucky numbers in matrix [array] the leetcode path of heroding
- Hls4ml/vivado HLS error reporting solution
- EasyCVR集群视频广场页面切换时,请求流未能终止的问题优化
- GaussDB(for MySQL) :Partial Result Cache,通过缓存中间结果对算子进行加速
- DS Transunet:用于医学图像分割的双Swin-Transformer U-Net
- 面试题篇一
- The large list set is divided into multiple small list sets in equal proportion
- Unreal Engine packaging project
猜你喜欢

Object creation

基于图的 Affinity Propagation 聚类计算公式详解和代码示例

毕业季 | 华为专家亲授面试秘诀:如何拿到大厂高薪offer?

math_利用微分算近似值

1592 example 1 King (sgu223 loj10170 luogu1896 increase + / provincial election -) violent thinking pressure DP 01 Backpack

解决VSCode下载慢或下载失败的问题

Graduation season | Huawei experts teach the interview secret: how to get a high paying offer from a large factory?

Powerful, easy-to-use, professional editor / notebook software suitable for programmers / software developers, comprehensive evaluation and comprehensive recommendation

【多线程】 实现单例模式 ( 饿汉、懒汉 ) 实现线程安全的单例模式 (双重效验锁)

JS 之 常用内置类的使用
随机推荐
Arduino Stepper库驱动28BYJ-48步进电机测试程序
今日群里分享的面试题
Interview question 1
Solve the problem of slow or failed vscode download
Mo Tianlun salon | Tsinghua qiaojialin: Apache iotdb, originated from Tsinghua, builds an open source ecological road
全国职业院校技能大赛网络安全“splunk“详细配置
简单但现代的服务器仪表板Dashdot
Cookie和Session的相关概念
[research materials] iResearch tide Watching: seven major trends in the clothing industry - Download attached
HLS4ML进入方法
Remove line breaks from MySQL query results
MySQL signale une erreur can 't create table' demo01. TB Étudiant '(errno: 150)
一个程序员如何快速成长
Powerful, easy-to-use, professional editor / notebook software suitable for programmers / software developers, comprehensive evaluation and comprehensive recommendation
How can a programmer grow rapidly
Gaussdb (for MySQL):partial result cache, which accelerates the operator by caching intermediate results
[AI server setup] CUDA environment
Procédure de mesure du capteur d'accord vibrant par le module d'acquisition d'accord vibrant
基于图的 Affinity Propagation 聚类计算公式详解和代码示例