Documentation ¶
Index ¶
- type Body
- type CTSectPr
- type CoreProperties
- type DocGrid
- type Document
- type DocumentChild
- type ExtendedProperties
- type FormProtection
- type HeadingPairs
- type PageMargins
- type PageNumbering
- type PageSize
- type Relationship
- type Relationships
- type RootDoc
- func (rd *RootDoc) AddEmptyParagraph() *elements.Paragraph
- func (rd *RootDoc) AddHeading(text string, level uint) (*elements.Paragraph, error)
- func (rd *RootDoc) AddParagraph(text string) *elements.Paragraph
- func (rd *RootDoc) Close() error
- func (rd *RootDoc) Save() error
- func (rd *RootDoc) SaveTo(fileName string) error
- func (rd *RootDoc) Write(w io.Writer) error
- func (rd *RootDoc) WriteTo(w io.Writer) (int64, error)
- type SectionType
- type Table
- type TextDirection
- type TitlesOfParts
- type Variant
- type Vector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Body ¶
type Body struct { XMLName xml.Name `xml:"http://schemas.openxmlformats.org/wordprocessingml/2006/main body"` Children []*DocumentChild `xml:",any"` SectPr *CTSectPr }
func (*Body) MarshalXML ¶
func (*Body) UnmarshalXML ¶
type CTSectPr ¶
type CTSectPr struct { Type *SectionType `xml:"type,omitempty"` PgSz *PageSize `xml:"pgSz,omitempty"` PgMar *PageMargins `xml:"pgMar,omitempty"` PgNumType *PageNumbering `xml:"pgNumType,omitempty"` FormProt *FormProtection `xml:"formProt,omitempty"` TextDir *TextDirection `xml:"textDirection,omitempty"` DocGrid *DocGrid `xml:"docGrid,omitempty"` // Add DocGrid field }
func (*CTSectPr) MarshalXML ¶
type CoreProperties ¶
type CoreProperties struct { Category string ContentStatus string Created string Creator string Description string Identifier string Keywords string LastModifiedBy string Modified string Revision string Subject string Title string Language string Version string }
func LoadDocProps ¶
func LoadDocProps(fileBytes []byte) (cp *CoreProperties, err error)
type DocGrid ¶
type DocGrid struct { Type string `xml:"type,attr,omitempty"` LinePitch int `xml:"linePitch,attr,omitempty"` CharSpace int `xml:"charSpace,attr,omitempty"` }
func (*DocGrid) MarshalXML ¶
type Document ¶
type Document struct { Body *Body // contains filtered or unexported fields }
func (*Document) MarshalXML ¶
func (*Document) UnmarshalXML ¶
type DocumentChild ¶
type ExtendedProperties ¶
type FormProtection ¶
type FormProtection struct {
Val string `xml:"val,attr,omitempty"`
}
func (*FormProtection) MarshalXML ¶
func (formProt *FormProtection) MarshalXML(e *xml.Encoder, start xml.StartElement) error
type HeadingPairs ¶
type HeadingPairs struct {
Vector Vector `xml:"HeadingPairs"`
}
type PageMargins ¶
type PageMargins struct { Left int `xml:"left,attr,omitempty"` Right int `xml:"right,attr,omitempty"` Gutter int `xml:"gutter,attr,omitempty"` Header int `xml:"header,attr,omitempty"` Top int `xml:"top,attr,omitempty"` Bottom int `xml:"bottom,attr,omitempty"` // Add Bottom attribute }
func (*PageMargins) MarshalXML ¶
func (pgMar *PageMargins) MarshalXML(e *xml.Encoder, start xml.StartElement) error
type PageNumbering ¶
type PageNumbering struct {
Fmt string `xml:"fmt,attr,omitempty"`
}
func (*PageNumbering) MarshalXML ¶
func (pgNumType *PageNumbering) MarshalXML(e *xml.Encoder, start xml.StartElement) error
type PageSize ¶
func (*PageSize) MarshalXML ¶
type Relationship ¶
type Relationships ¶
type Relationships struct { RelativePath string `xml:"-"` XMLName xml.Name `xml:"Relationships"` Xmlns string `xml:"xmlns,attr"` Relationships []*Relationship `xml:"Relationship"` }
type RootDoc ¶
type RootDoc struct { Path string FileMap sync.Map Document *Document RootRels Relationships DocRels Relationships // contains filtered or unexported fields }
func NewRootDoc ¶
func NewRootDoc() *RootDoc
func (*RootDoc) AddEmptyParagraph ¶
func (*RootDoc) AddHeading ¶
Return a heading paragraph newly added to the end of the document. The heading paragraph will contain text and have its paragraph style determined by level. If level is 0, the style is set to Title. The style is set to Heading {level}. if level is outside the range 0-9, error will be returned
type SectionType ¶
type SectionType struct {
Val string `xml:"val,attr,omitempty"`
}
func (*SectionType) MarshalXML ¶
func (st *SectionType) MarshalXML(e *xml.Encoder, start xml.StartElement) error
type TextDirection ¶
type TextDirection struct {
Val string `xml:"val,attr,omitempty"`
}
func (*TextDirection) MarshalXML ¶
func (textDir *TextDirection) MarshalXML(e *xml.Encoder, start xml.StartElement) error
type TitlesOfParts ¶
type TitlesOfParts struct {
Vector Vector `xml:"TitlesOfParts"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.