Documentation
¶
Index ¶
- func ExtractRawTextFromDoc(docPath string) (string, error)
- func ExtractRawTextFromDocx(docxPath string) (string, error)
- func ExtractTextFromDoc(docPath string) (string, error)
- func ExtractTextFromDocCGO(docPath string) (string, error)
- func IsDocFile(filename string) bool
- func IsDocxFile(filename string) bool
- type AbstractNum
- type AbstractNumIdVal
- type ContentElement
- type Document
- type DocumentOutput
- type IlvlVal
- type JcVal
- type Metadata
- type Num
- type NumFmtVal
- type NumIdVal
- type NumPr
- type Numbering
- type NumberingLevel
- type PStyleVal
- type Paragraph
- type ParagraphProperties
- type Run
- type RunProperties
- type Table
- type TableCell
- type TableRow
- type Text
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractRawTextFromDoc ¶
ExtractRawTextFromDoc extracts plain text from a .doc file
func ExtractRawTextFromDocx ¶
ExtractRawTextFromDocx extracts plain text from a DOCX file
func ExtractTextFromDoc ¶
ExtractTextFromDoc extracts plain text from a .doc file
func ExtractTextFromDocCGO ¶
func IsDocxFile ¶
IsDocxFile checks if a file has a .docx extension
Types ¶
type AbstractNum ¶
type AbstractNum struct {
AbstractNumID int `xml:"abstractNumId,attr"`
Levels []NumberingLevel `xml:"lvl"`
}
AbstractNum represents an abstract numbering definition
type AbstractNumIdVal ¶
type AbstractNumIdVal struct {
Val int `xml:"val,attr"`
}
AbstractNumIdVal represents the value of an abstractNumId element
type ContentElement ¶
type DocumentOutput ¶
type DocumentOutput struct {
Metadata Metadata `json:"metadata"`
Content []ContentElement `json:"content"`
}
func ExtractFromDoc ¶
func ExtractFromDoc(docPath string) (*DocumentOutput, error)
ExtractFromDoc extracts content from a .doc file and returns it in the same format as DOCX
func ExtractFromDocx ¶
func ExtractFromDocx(docxPath string) (*DocumentOutput, error)
type Num ¶
type Num struct {
NumID int `xml:"numId,attr"`
AbstractNumId AbstractNumIdVal `xml:"abstractNumId"`
}
Num maps a numId to an abstractNumId
type NumFmtVal ¶
type NumFmtVal struct {
Val string `xml:"val,attr"`
}
NumFmtVal represents the value of a numFmt element
type Numbering ¶
type Numbering struct {
AbstractNums []AbstractNum `xml:"abstractNum"`
Nums []Num `xml:"num"`
}
Numbering contains all numbering definitions
func (*Numbering) GetNumberFormat ¶
GetNumberFormat returns the number format for a given numId and level
type NumberingLevel ¶
type NumberingLevel struct {
Level int `xml:"ilvl,attr"`
NumFormat NumFmtVal `xml:"numFmt"` // "decimal", "bullet", "lowerLetter", etc.
}
NumberingLevel represents a level in a numbering definition
type Paragraph ¶
type Paragraph struct {
Properties ParagraphProperties `xml:"pPr"`
Runs []Run `xml:"r"`
}
type ParagraphProperties ¶
type Run ¶
type Run struct {
Properties RunProperties `xml:"rPr"`
Texts []Text `xml:"t"`
}