docx

package module
v0.0.0-...-de05063 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Docx

type Docx struct {
	Document wDocument
	// contains filtered or unexported fields
}

Docx is the base for the module

func Open

func Open(path string) (Docx, error)

Open is to open a docx file

func (*Docx) Save

func (d *Docx) Save() error

Save file overwriting the original file

func (*Docx) SaveAs

func (d *Docx) SaveAs(path string) error

SaveAs reconstruct zip and save in path

func (*Docx) SaveToMemory

func (d *Docx) SaveToMemory() ([]byte, error)

SaveToMemory return docx file in a Byte Slice

type TextStyle

type TextStyle struct {
	Document *xmldom.Node
	// contains filtered or unexported fields
}

TextStyle contains the style of the run or paragraph

func (*TextStyle) Clone

func (t *TextStyle) Clone(T TextStyle)

Clone copy every settings of input

func (*TextStyle) GetBold

func (t *TextStyle) GetBold() bool

GetBold Return true if TextStyle has Bold

func (*TextStyle) GetCaps

func (t *TextStyle) GetCaps() bool

GetCaps Return true if TextStyle has Caps

func (*TextStyle) GetColor

func (t *TextStyle) GetColor() string

GetColor if has color return Color in hex else return empty string

func (*TextStyle) GetDstrike

func (t *TextStyle) GetDstrike() bool

GetDstrike Return true if TextStyle has Double Strike

func (*TextStyle) GetEmboss

func (t *TextStyle) GetEmboss() bool

GetEmboss Return true if TextStyle has Emboss

func (*TextStyle) GetFont

func (t *TextStyle) GetFont(attribute string) (string, error)

GetFont input attribute possible attributes (ascii,hAnsi,cs) return font name

func (*TextStyle) GetFonts

func (t *TextStyle) GetFonts() (string, string, string)

GetFonts return (ascii, hAnsi, cs)

func (*TextStyle) GetImprint

func (t *TextStyle) GetImprint() bool

GetImprint Return true if TextStyle has Imprint

func (*TextStyle) GetItalic

func (t *TextStyle) GetItalic() bool

GetItalic Return true if TextStyle has Italic

func (*TextStyle) GetSize

func (t *TextStyle) GetSize() int

GetSize Return Size in half-points (half-poits = fontsize*2)

func (*TextStyle) GetUnderline

func (t *TextStyle) GetUnderline() (bool, string, string)

GetUnderline return (has underline , pattern , color)

func (*TextStyle) GetVanish

func (t *TextStyle) GetVanish() bool

GetVanish Return true if TextStyle has Vanish

func (*TextStyle) GetVertAlign

func (t *TextStyle) GetVertAlign() string

GetVertAlign Return value of VertAlign can be: basline, subscript, superscript

func (*TextStyle) IsEqual

func (t *TextStyle) IsEqual(T TextStyle) bool

IsEqual Check if has the sames settings as input

func (*TextStyle) SetBold

func (t *TextStyle) SetBold(value bool)

SetBold Set bold value to TextStyle

func (*TextStyle) SetCaps

func (t *TextStyle) SetCaps(value bool)

SetCaps Set value to Caps

func (*TextStyle) SetColor

func (t *TextStyle) SetColor(value string)

SetColor Set string to Color. value must be in hex RRGGBB or auto

func (*TextStyle) SetDstrike

func (t *TextStyle) SetDstrike(value bool)

SetDstrike set value to Dstrike

func (*TextStyle) SetEmboss

func (t *TextStyle) SetEmboss(value bool)

SetEmboss set value to Emboss

func (*TextStyle) SetFont

func (t *TextStyle) SetFont(attribute string, FontName string) error

SetFont input attribute possible attributes (ascii,hAnsi,cs) return font name

func (*TextStyle) SetFonts

func (t *TextStyle) SetFonts(ascii string, hAnsi string, cs string)

SetFonts input (ascii,hAnsi,cs)

func (*TextStyle) SetImprint

func (t *TextStyle) SetImprint(value bool)

SetImprint set value to Imprint

func (*TextStyle) SetItalic

func (t *TextStyle) SetItalic(value bool)

SetItalic Set Italic value to TextStyle

func (*TextStyle) SetSize

func (t *TextStyle) SetSize(value int)

SetSize set value to Size value in half-points (half-poits = fontsize*2)

func (*TextStyle) SetUnderline

func (t *TextStyle) SetUnderline(pattern string, color string)

SetUnderline set value to Underline (pattern , color) if color is empty default value is auto possible values for pattern http://officeopenxml.com/WPtextFormatting.php

func (*TextStyle) SetVanish

func (t *TextStyle) SetVanish(value bool)

SetVanish set value to Vanish

func (*TextStyle) SetVertAlign

func (t *TextStyle) SetVertAlign(value string)

SetVertAlign set value to VertAlign can be: basline , subscript , superscript

Jump to

Keyboard shortcuts

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