documents

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DOCX = "docx"
	PDF  = "pdf"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Docx

type Docx struct{}

func (*Docx) ConvertTo

func (p *Docx) ConvertTo(fileType, subType string, fileBytes []byte) ([]byte, error)

func (*Docx) DocumentType

func (p *Docx) DocumentType() string

func (*Docx) SupportedFormats

func (p *Docx) SupportedFormats() map[string][]string

type Pdf

type Pdf struct {
	// contains filtered or unexported fields
}

Pdf struct implements the File and Document interface from the file package.

func NewPdf

func NewPdf(filename string) *Pdf

NewPdf returns a pointer to Pdf.

func (*Pdf) ConvertTo

func (p *Pdf) ConvertTo(fileType, subType string, fileBytes []byte) ([]byte, error)

ConvertTo converts the current PDF file to another given format. This method receives the file type, the sub-type and the file as an slice of bytes. Returns the converted file as an slice of bytes, if something wrong happens, an error is returned.

func (*Pdf) DocumentType

func (p *Pdf) DocumentType() string

DocumentType returns the type of ducument of Pdf.

func (*Pdf) SupportedFormats

func (p *Pdf) SupportedFormats() map[string][]string

SupportedFormats returns a map witht he compatible formats that Pds is compatible to be converted to.

Jump to

Keyboard shortcuts

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