当前位置:网站首页>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 同步显示。
边栏推荐
- Gaussdb (for MySQL):partial result cache, which accelerates the operator by caching intermediate results
- C # joint halcon Application - Dahua Camera Collection class
- Easycvr accesses the equipment through the national standard gb28181 protocol. What is the reason for the automatic streaming of the equipment?
- 2022/6/8-2022/6/12
- ORA-01950
- 面试题篇一
- Use of common built-in classes of JS
- Servlet knowledge points
- 上大学后明白了哪些坑人的事?
- Getting started with fastdfs
猜你喜欢

math_ Use differentiation to calculate approximate value

Hls4ml entry method
![[Mysql]安装Mysql5.7](/img/c4/d7fb5ddf8e7be31f7a9ad68409e584.png)
[Mysql]安装Mysql5.7

GaussDB(for MySQL) :Partial Result Cache,通过缓存中间结果对算子进行加速

实例讲解将Graph Explorer搬上JupyterLab

Is Dao safe? Build finance encountered a malicious governance takeover and was looted!

servlet知识点

Cookie和Session的相关概念

Bind this of the current scope for callback functions in other cases such as timers and delayers

Interview question 1
随机推荐
GaussDB(for MySQL) :Partial Result Cache,通过缓存中间结果对算子进行加速
Hls4ml entry method
[research materials] national second-hand housing market monthly report January 2022 - Download attached
开发那些事儿:EasyCVR平台添加播放地址鉴权功能
Install redis under Linux and configure the environment
Review the collection container again
Time series analysis using kibana timelion
Object creation
强大、好用、适合程序员/软件开发者的专业编辑器/笔记软件综合评测和全面推荐
SwiftUI 4 新功能大全之 Toggle与 Mixed Toggle 多个绑定组件
关于元宇宙下一代入口——脑机接口的实现
振弦采集模塊測量振弦傳感器的流程步驟
Related concepts of cookies and sessions
DS Transunet:用于医学图像分割的双Swin-Transformer U-Net
ORA-01950
MySQL reports an error can't create table 'demo01 tb_ Student‘ (errno: 150)*
[exercise] HashSet
Stack Overflow 2022 开发者调查:行业走向何方?
A quietly rising domestic software, low-key and powerful!