Versions in this module Expand all Collapse all v1 v1.0.0 Jan 29, 2022 Changes in this version + const LEFT + const RIGHt + var NUM = [10]string + var TEMP_BASE_DIR = path.Join("/tmp", "/docx_temp") + var UNIT = [5]string + func CopyFile(dstFileName string, srcFileName string) (written int64, err error) + func GenerateFileName(fName, suffix string, replace bool) (tempName string) + func GenerateId(sid, suffix, separation string) (toId string) + func GetBreakPage() (tag *yaxml.Element) + func GetChunkContenDom(filename string) (dom *yaxml.Element) + func GetChunkDom(rid string) (dom *yaxml.Element) + func GetChunkRelationDom(filename, rid string) (dom *yaxml.Element) + func GetImageDom(rid string, width int, height int, align string) (dom *yaxml.Element) + func GetImageRelationshipDom(rid, filename string) (dom *yaxml.Element) + func GetJpgContenttype() (dom *yaxml.Element) + func GetPngContenttype() (dom *yaxml.Element) + func GetTextDom(text, align string) (dom *yaxml.Element) + func MergeFiles(filelist []string, filename string, page bool) (err error) + func NumToHans(num int) string + func Parser(text string) *yaxml.Element + func PathExists(path string) (bool, error) + func ReadAll(filePth string) (string, error) + func Unzip(zipFile string, destDir string) error + type ContentTypes struct + Content *yaxml.Element + Extension map[string]bool + Types []string + func GenerateContentTypes(content *yaxml.Element) (ct *ContentTypes) + func (c *ContentTypes) AppendDocx(filename string) + func (c *ContentTypes) AppendExtension(suffix string) + func (c *ContentTypes) AppendJpeg() + func (c *ContentTypes) AppendPng() + func (c *ContentTypes) GetDom() *yaxml.Element + func (c *ContentTypes) GetTypes() []string + func (c *ContentTypes) GetTypesDom() (types []*yaxml.Element) + func (c *ContentTypes) ToString() string + type Document struct + Docu *yaxml.Element + func GenerateDocument(document *yaxml.Element) *Document + func (d *Document) AppendChunk(rid string) + func (d *Document) AppendContent(dom *yaxml.Element) + func (d *Document) AppendPageBreak() + func (d *Document) AppendParagraph(text string, align string) + func (d *Document) AppendPicture(rid string, width int, height int, align string) + func (d *Document) ClearContent() + func (d *Document) ClearContentWithoutHeader() + func (d *Document) GetContent() (par []*Paragraph) + func (d *Document) GetDom(dom *yaxml.Element) *yaxml.Element + func (d *Document) ToString() string + type Docx struct + BaseDir string + ContentTypes *ContentTypes + CurrentIdTarget map[string]bool + Document *Document + FilePath string + Numbering string + Relationships *Relationships + RelsDict map[string]string + RelsFiles map[string]bool + ReplaceMap map[string]string + Styles string + func MakeNewDocument() (doc *Docx, err error) + func NewDocx(zipPath string, clearContent bool) (docx *Docx, err error) + func (d *Docx) AppendParagraph(text, align string) + func (d *Docx) AppendPicture(srcfilepath, align string) (err error) + func (d *Docx) Close() + func (d *Docx) GetDocument() (*Document, error) + func (d *Docx) GetRelationships(refresh bool) (*Relationships, error) + func (d *Docx) Merge(filelist []string, page bool, remove bool) (err error) + func (d *Docx) Replace(src, des string) + func (d *Docx) Save(name string) (err error) + func (d *Docx) Zip(destZip string) error + type IdAble struct + Id string + Num int + Part int + func GenerateIdAble() (ia *IdAble, err error) + func (id *IdAble) GetIdAndInc() int + type Paragraph struct + Dom *yaxml.Element + func GenerateParagraph(dom *yaxml.Element) *Paragraph + func (p *Paragraph) GetContent() (text []string) + func (p *Paragraph) GetDom() *yaxml.Element + type Relationships struct + FileMapping map[string]string + Relation *yaxml.Element + StartId int + func GenerateRelationships(relationships *yaxml.Element) *Relationships + func (r *Relationships) AppendChunk(filename string) string + func (r *Relationships) AppendRelationship(suffix string) (res map[string]string) + func (r *Relationships) GenerateId() string + func (r *Relationships) GetDom() (dom *yaxml.Element) + func (r *Relationships) GetFileMapping() map[string]string + func (r *Relationships) GetRelationships() (ralation []*yaxml.Element) + func (r *Relationships) ToString() string