This commit is contained in:
csh 2023-10-16 17:35:16 +08:00
parent 8cd87118d5
commit de0af521bc
7 changed files with 213 additions and 381 deletions

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
// Version 1.4.8
// Version 1.4.9
Type TSDocxFile = Class
///Version: V1.0 2022-09-20
@ -381,6 +381,25 @@ Type TSDocxFile = Class
return nil;
End;
///复制Word内容
///alias: string文件目录别名
///fileName: string文件名
///posOpt: 段落位置0 在DOCX文件开头-1 文件尾N 在第N段之后XmlNode节点对象或DocObject对象 在posOpt之后新添加图片
///返回: [err, TDocxCopy对象]
///TDocxCopy.GetCopiedTable() 返回复制的对象表格数组
///TDocxCopy.GetCopiedParagraph() 返回复制对象的段落数组
///TDocxCopy.GetCopiedDrawing() 返回复制对象的图表数组
Function InsertFile(alias, fileName, posOpt);overload;
Begin
docxObj := new TSDocxFile();
[err, msg] := docxObj.OpenFile(alias, fileName);
if err then return array(err, msg);
copy_obj := new TDocxCopy(self, docxObj);
copy_obj.Init();
copy_obj.Copy(posOpt);
return array(0, copy_obj);
End;
///复制Word内容
///docxObj: TSDocxFile对象
///posOpt: 段落位置0 在DOCX文件开头-1 文件尾N 在第N段之后XmlNode节点对象或DocObject对象 在posOpt之后新添加图片
@ -388,11 +407,8 @@ Type TSDocxFile = Class
///TDocxCopy.GetCopiedTable() 返回复制的对象表格数组
///TDocxCopy.GetCopiedParagraph() 返回复制对象的段落数组
///TDocxCopy.GetCopiedDrawing() 返回复制对象的图表数组
Function InsertFile(alias, fileName, posOpt);
Function InsertFile(docxObj, posOpt);overload;
Begin
docxObj := new TSDocxFile();
[err, msg] := docxObj.OpenFile(alias, fileName);
if err then return array(err, msg);
copy_obj := new TDocxCopy(self, docxObj);
copy_obj.Init();
copy_obj.Copy(posOpt);

View File

@ -1,4 +1,4 @@
// Version 1.4.8
// Version 1.4.9
Type TSExcelFile = Class
///Version: V1.0 2022-08-08

View File

@ -23,21 +23,13 @@ public
if ifObj(RootObj) then Begin
arr := Marshal();
if length(arr['attributes']) or length(arr['children']) then Begin
curNode := class(TSXml).GetNode(RootObj, NodeUri);
curNode := class(TSXml).GetNode(RootObj, NodeUri, 'end');
if ifObj(curNode) then
class(TSXml).UpdateNode(curNode, arr['attributes'], arr['children']);
End;
End;
End;
Function HandleAttrs(); virtual;
Begin
End
Function HandleChildren(); virtual;
Begin
End
Function GetAttrs(); virtual;
Begin
return ExtAttr;
@ -258,7 +250,6 @@ public
NodeName;
ExtAttr;
ExtNodes;
//Parent;
ReplaceArr;
RootObj; // xml node
NodeUri:string;

View File

@ -1,5 +1,14 @@
# 更新日志
## 2023-10-16
### V1.4.9
#### word
1. 新增`TSDocxFile.InsertFile`重载方法
2. 新增`Table.SetStyle`方法
## 2023-9-27
### V1.4.8