Documentation
¶
Index ¶
- type AbstractNum
- type AppProperties
- type AppPropertiesXML
- type ContentTypesWr
- type CoreProperties
- type CorePropertiesXML
- type Document
- type DocumentRelationship
- type Level
- type LevelOverride
- type Num
- type NumberingDefinitions
- type Relationships
- type SaveOptions
- type StylesWr
- type TimeElement
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbstractNum ¶
AbstractNum defines an abstract numbering definition
func (*AbstractNum) GenerateXML ¶
func (an *AbstractNum) GenerateXML() string
GenerateXML generates XML for an abstract numbering definition
type AppProperties ¶
type AppProperties struct {
// contains filtered or unexported fields
}
AppProperties represents the generator for docProps/app.xml
func (*AppProperties) Byte ¶
func (ap *AppProperties) Byte() ([]byte, error)
Byte generates the XML content for docProps/app.xml
func (*AppProperties) Path ¶
func (ap *AppProperties) Path() string
Path returns the ZIP path for app properties
type AppPropertiesXML ¶
type AppPropertiesXML struct {
XMLName xml.Name `xml:"Properties"`
Xmlns string `xml:"xmlns,attr"`
XmlnsVt string `xml:"xmlns:vt,attr"`
Application string `xml:"Application,omitempty"`
AppVersion string `xml:"AppVersion,omitempty"`
DocSecurity int `xml:"DocSecurity"`
Lines int `xml:"Lines"`
Paragraphs int `xml:"Paragraphs"`
Words int `xml:"Words"`
Characters int `xml:"Characters"`
CharactersWithSpaces int `xml:"CharactersWithSpaces"`
Pages int `xml:"Pages"`
Company string `xml:"Company,omitempty"`
Manager string `xml:"Manager,omitempty"`
LinksUpToDate bool `xml:"LinksUpToDate"`
ScaleCrop bool `xml:"ScaleCrop"`
HyperlinksChanged bool `xml:"HyperlinksChanged"`
Template string `xml:"Template,omitempty"`
TotalTime int `xml:"TotalTime,omitempty"`
HiddenSlides int `xml:"HiddenSlides,omitempty"`
MMClips int `xml:"MMClips,omitempty"`
Notes int `xml:"Notes,omitempty"`
Slides int `xml:"Slides,omitempty"`
}
AppPropertiesXML defines the XML structure of docProps/app.xml
type ContentTypesWr ¶
type ContentTypesWr struct {
// contains filtered or unexported fields
}
ContentTypes represents the [Content_Types].xml part in a DOCX package.
func (*ContentTypesWr) Byte ¶
func (ct *ContentTypesWr) Byte() ([]byte, error)
Byte serializes the ContentTypes struct to XML with an XML declaration.
func (*ContentTypesWr) Path ¶
func (ct *ContentTypesWr) Path() string
Path returns the location of the content types file within the DOCX ZIP.
type CoreProperties ¶
type CoreProperties struct {
*CorePropertiesXML
// contains filtered or unexported fields
}
func (*CoreProperties) Byte ¶
func (cr *CoreProperties) Byte() ([]byte, error)
func (*CoreProperties) Path ¶
func (cp *CoreProperties) Path() string
type CorePropertiesXML ¶
type CorePropertiesXML struct {
XMLName xml.Name `xml:"cp:coreProperties"`
XmlnsCp string `xml:"xmlns:cp,attr"`
XmlnsDc string `xml:"xmlns:dc,attr"`
XmlnsDcterms string `xml:"xmlns:dcterms,attr"`
XmlnsDcmitype string `xml:"xmlns:dcmitype,attr"`
XmlnsXsi string `xml:"xmlns:xsi,attr"`
Title string `xml:"dc:title,omitempty"`
Subject string `xml:"dc:subject,omitempty"`
Creator string `xml:"dc:creator,omitempty"`
Keywords string `xml:"cp:keywords,omitempty"`
Description string `xml:"dc:description,omitempty"`
LastModifiedBy string `xml:"cp:lastModifiedBy,omitempty"`
Revision string `xml:"cp:revision,omitempty"`
Created *TimeElement `xml:"dcterms:created"`
Modified *TimeElement `xml:"dcterms:modified"`
Category string `xml:"cp:category,omitempty"`
ContentStatus string `xml:"cp:contentStatus,omitempty"`
Language string `xml:"dc:language,omitempty"`
Version string `xml:"cp:version,omitempty"`
}
type DocumentRelationship ¶
func (*DocumentRelationship) Byte ¶
func (d *DocumentRelationship) Byte() ([]byte, error)
Byte generates the XML content for the document
func (*DocumentRelationship) Path ¶
func (d *DocumentRelationship) Path() string
Path returns the path inside the .docx ZIP file
type Level ¶
type Level struct {
Level int
Start int
NumFormat string // bullet, decimal, upperRoman, lowerRoman, upperLetter, lowerLetter, etc.
LevelText string
LevelJc string // left, center, right, justify
PStyle string
IsLegalNum bool
Suffix string // tab, space, nothing
BulletChar string // For bullet lists
Font string // Font for bullet
IndentLeft int // In twips
IndentHanging int // In twips
}
Level defines a numbering level
func (*Level) GenerateXML ¶
GenerateXML generates XML for a numbering level
type LevelOverride ¶
LevelOverride allows overriding specific levels
type Num ¶
type Num struct {
ID int
AbstractID int
Overrides []LevelOverride
}
Num defines a concrete numbering instance
func (*Num) GenerateXML ¶
GenerateXML generates XML for a concrete numbering instance
type NumberingDefinitions ¶
type NumberingDefinitions struct {
AbstractNums []AbstractNum
Nums []Num
}
NumberingDefinitions contains all numbering definitions for the document
func (*NumberingDefinitions) Byte ¶
func (num *NumberingDefinitions) Byte() ([]byte, error)
func (*NumberingDefinitions) Path ¶
func (num *NumberingDefinitions) Path() string
type Relationships ¶
Relationships represents the _rels/.rels file in a DOCX package.
func (*Relationships) Byte ¶
func (r *Relationships) Byte() ([]byte, error)
Byte returns the full XML content for the _rels/.rels part.
func (*Relationships) Path ¶
func (r *Relationships) Path() string
Path returns the location of the part inside the DOCX ZIP.
type SaveOptions ¶
type SaveOptions struct {
CompressionLevel int
PrettyPrint bool
IncludeCustomProperties bool
UpdateFields bool
Metadata map[string]string
}
SaveOptions provides options for saving documents
func DefaultSaveOptions ¶
func DefaultSaveOptions() SaveOptions
DefaultSaveOptions returns default save options
type TimeElement ¶
type TimeElement struct {
XMLName xml.Name `xml:""`
Type string `xml:"xsi:type,attr"`
Value string `xml:",chardata"`
}
TimeElement represents a time element with xsi:type