docx

package
v0.0.0-...-30cd6d4 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DOCX2Text

func DOCX2Text(file io.ReaderAt, size int64) (string, error)

DOCX2Text extracts text of a Word document Size is the full size of the input file.

Types

type Docx

type Docx struct{}

func (Docx) Parse

func (d Docx) Parse(filepath string) (string, error)

type WordDocument

type WordDocument struct {
	Paragraphs []WordParagraph
}

WordDocument is a full word doc

func WordParse

func WordParse(doc string) (WordDocument, error)

WordParse parses a word file

func (WordDocument) AsText

func (w WordDocument) AsText() string

AsText returns all text in the document

type WordParagraph

type WordParagraph struct {
	Style WordStyle `xml:"pPr>pStyle"`
	Rows  []WordRow `xml:"r"`
}

WordParagraph is a single paragraph

type WordRow

type WordRow struct {
	Text string `xml:"t"`
}

WordRow ...

type WordStyle

type WordStyle struct {
	Val string `xml:"val,attr"`
}

WordStyle ...

Jump to

Keyboard shortcuts

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