format

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package format contains format handling types. Each ooxml format that can be handled by the library has its own type plus there is a generic XML-handling type that forms the basis for the operations on ooxml files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Docx

type Docx struct {
	Text      string
	Links     []string
	Footnotes []string
	Headers   []string
	Footers   []string
	// contains filtered or unexported fields
}

Docx handles docx documents. Its fields contain the textual information corresponding to the different elements of the document: Text contains the document text, Links is a list of links that appear in the document (the text part contains references to the links), Footnotes contains the list of footnotes, and Headers and Footers are also lists and contain the headers and footers of the document.

func MakeDocx

func MakeDocx(path string) (*Docx, error)

MakeDocx creates a Docx that parses the document given by its path. The returned instance contains the valid contents of the document if there was no error while processing it. If there was an error, it is reported in the returned error value).

func MakeDocxFromUrl added in v1.0.4

func MakeDocxFromUrl(url string) (*Docx, error)

MakeDocxFromUrl creates a Docx that parses the document given by an URL. The returned instance contains the valid contents of the document if there was no error while processing it. If there was an error, it is reported in the returned error value).

type Pptx

type Pptx struct {
	Text  []string
	Links []string
	// contains filtered or unexported fields
}

Pptx handles pptx documents. The Text member is a list of strings where each element corresponds to a slide in the presentation.

func MakePptx

func MakePptx(path string) (*Pptx, error)

MakePptx creates a Pptx from the path to a presentation. The returned instance contains the valid contents of the document if there was no error while processing it (which is then reported in the returned error value).

func MakePptxFromUrl added in v1.0.4

func MakePptxFromUrl(url string) (*Pptx, error)

MakePptxFromUrl creates a Pptx from an URL to a presentation. The returned instance contains the valid contents of the document if there was no error while processing it (which is then reported in the returned error value).

type Xlsx

type Xlsx struct {
	Text  []string
	Links []string
	// contains filtered or unexported fields
}

Xlsx handles xlsx documents. The Text member is a list of strings where each element corresponds to a string value in the document. Only the strings are collected, numbers, formulas and binary data is ignored. Only unique strings are collected, i.e. if a piece of text appears multiple times in the document, it will only show up once in the list.

func MakeXlsx

func MakeXlsx(path string) (*Xlsx, error)

MakeXlsx creates a Xlsx from the path to a spreadsheet document. The returned instance contains the valid contents of the document if there was no error while processing it (which is then reported in the returned error value).

func MakeXlsxFromUrl added in v1.0.4

func MakeXlsxFromUrl(url string) (*Xlsx, error)

MakeXlsxFromUrl creates a Xlsx from an URL to a spreadsheet document. The returned instance contains the valid contents of the document if there was no error while processing it (which is then reported in the returned error value).

Jump to

Keyboard shortcuts

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