CoreDocx

package
v5.1.46 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CoreDocx2Type

type CoreDocx2Type struct {
}

CoreDocx2Type 第二代word处理模块 该模块将交给py完成处理操作,并将文件换回临时存储目录

func (*CoreDocx2Type) PutDoc

func (t *CoreDocx2Type) PutDoc(templateSrc string, replaceData ReplaceDataType) (newFileSrc string, err error)

type CoreDocxType

type CoreDocxType struct {
	////文件结构
	//DocFile *docx.ReplaceDocx
	////编辑文档引用
	//DocData *docx.Docx
	DocData *docx.Document
}

CoreDocxType 数据结构

func (*CoreDocxType) Close

func (t *CoreDocxType) Close() (err error)

Close 关闭文件操作

func (*CoreDocxType) LoadDocx

func (t *CoreDocxType) LoadDocx(src string) (err error)

LoadDocx 读取文件

func (*CoreDocxType) OpenEdit

func (t *CoreDocxType) OpenEdit()

OpenEdit 打开编辑模式

func (*CoreDocxType) QuickReplaceAll

func (t *CoreDocxType) QuickReplaceAll(replaceData map[string]interface{}) (err error)

QuickReplaceAll 批量替换数据

func (*CoreDocxType) SaveDocx

func (t *CoreDocxType) SaveDocx(src string) (err error)

SaveDocx 保存文件

type ReplaceDataImgType

type ReplaceDataImgType struct {
	//路径
	Src string `json:"src"`
	//尺寸 毫米
	// 可以通过word生成指定尺寸后设置
	Width  int `json:"width"`
	Height int `json:"height"`
}

type ReplaceDataType

type ReplaceDataType struct {
	//替换普通文本
	ReplaceText map[string]string `json:"replaceText"`
	//替换图片
	ReplaceImage map[string]ReplaceDataImgType `json:"replaceImage"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL