odtxt

package
v0.0.0-...-688d651 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 License: Unlicense Imports: 5 Imported by: 0

Documentation

Overview

Package odtxt extracts text from .odt documents

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToStr

func BytesToStr(data []byte) (string, error)

BytesToStr converts a []byte representation of .odt document file to string

func ToStr

func ToStr(filename string) (string, error)

ToStr converts a .odt document file to string

Types

type Body

type Body struct {
	Text []Text `xml:"text"`
}

type Odt

type Odt struct {
	Files        []*zip.File
	FilesContent map[string][]byte
	Content      string
	// contains filtered or unexported fields
}

Odt zip struct

func Open

func Open(path string) (*Odt, error)

func OpenReader

func OpenReader(bytesReader *bytes.Reader) (*Odt, error)

OpenDocx open and load all files content

func (*Odt) CloseZip

func (d *Odt) CloseZip() error

func (*Odt) GetTxt

func (d *Odt) GetTxt() (content string, err error)

type Query

type Query struct {
	XMLName xml.Name `xml:"document-content"`
	Body    Body     `xml:"body"`
}

type Text

type Text struct {
	P []string `xml:"p"`
}

Jump to

Keyboard shortcuts

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