Versions in this module Expand all Collapse all v0 v0.1.2 Nov 16, 2026 Changes in this version + const EngineSHA256 + const EngineVersion + const ModelVersion + const Unlimited + func Build(ctx context.Context, model *Document, base []byte) ([]byte, error) + func ColumnToIndex(col string) int + func DateToSerial(t time.Time, date1904 bool) float64 + func ExtractText(ctx context.Context, doc []byte, limits ...Limits) (string, error) + func IndexToColumn(n int) string + func ParseRef(ref string) (col, row int, err error) + func Ptr[T any](v T) *T + func SerialToDate(serial float64, date1904 bool) time.Time + func SheetToArrays(sheet XlsxSheet) [][]any + func SheetToObjects(sheet XlsxSheet, headerRow int) []map[string]any + type Date string + func DateOf(t time.Time) Date + func DateTimeOf(t time.Time) Date + func (d Date) Time() (time.Time, error) + type Decimal string + type Delimiters struct + End string + Start string + type Document struct + Format Format + ModelVersion int + Parts []DocxPart + Sheets []XlsxSheet + Slides []PptxSlide + func Parse(ctx context.Context, doc []byte, limits ...Limits) (*Document, error) + func (d Document) MarshalJSON() ([]byte, error) + type DocxBlock struct + Align string + Children []DocxInline + Grid string + List *ListRef + Props string + Rows []DocxTableRow + Style string + Type string + XML string + func (b DocxBlock) MarshalJSON() ([]byte, error) + type DocxInline struct + Anchor string + Children []DocxInline + Kind string + Props string + Text string + Type string + URL string + XML string + func (in DocxInline) MarshalJSON() ([]byte, error) + type DocxPart struct + Blocks []DocxBlock + Kind string + Path string + SectionProps string + func (p DocxPart) MarshalJSON() ([]byte, error) + type DocxRunStyle struct + Bold *bool + Color string + Font string + Highlight string + Italic *bool + Size *float64 + Strike *bool + Style string + Underline *Underline + VertAlign string + type DocxTableCell struct + Blocks []DocxBlock + ColSpan int + Props string + VMerge string + type DocxTableRow struct + Cells []DocxTableCell + Props string + func (r DocxTableRow) MarshalJSON() ([]byte, error) + type Engine struct + func DefaultEngine() (*Engine, error) + func NewEngine(ctx context.Context, cfg EngineConfig) (*Engine, error) + func (e *Engine) Build(ctx context.Context, model *Document, base []byte) ([]byte, error) + func (e *Engine) Close(ctx context.Context) error + func (e *Engine) DetectFormat(ctx context.Context, doc []byte, limits ...Limits) (Format, error) + func (e *Engine) ExtractText(ctx context.Context, doc []byte, limits ...Limits) (string, error) + func (e *Engine) Info(ctx context.Context) (*Info, error) + func (e *Engine) Parse(ctx context.Context, doc []byte, limits ...Limits) (*Document, error) + type EngineConfig struct + CacheDir string + Interpreter bool + MaxInstances int + type Error struct + Problems []Problem + func (e *Error) Error() string + func (e *Error) Is(target error) bool + type ErrorCode string + const ErrFilterFailed + const ErrHostError + const ErrInternal + const ErrInvalidDocument + const ErrInvalidExpression + const ErrInvalidImage + const ErrInvalidModel + const ErrInvalidOptions + const ErrInvalidRequest + const ErrInvalidSection + const ErrLimitExceeded + const ErrMissingValue + const ErrUnclosedSection + const ErrUnclosedTag + const ErrUnknownFilter + const ErrUnknownTemplate + const ErrUnmatchedClose + const ErrUnopenedTag + const ErrUnsupported + const ErrUnsupportedFormat + func (c ErrorCode) Error() string + type Filter func(value any, args ...any) (any, error) + type Format string + const Docx + const Pptx + const Xlsx + func DetectFormat(ctx context.Context, doc []byte, limits ...Limits) (Format, error) + type Image struct + Alt string + Data []byte + Extension string + Height float64 + Width float64 + type Info struct + ABIVersion int + CoreVersion string + Features map[string]any + Formats []Format + ModelVersion int + type InspectResult struct + Format Format + Parts []PartTags + Schema map[string]any + Tags []Tag + Variables []string + type Limits struct + MaxCompressionRatio int64 + MaxEntries int64 + MaxHostCalls int64 + MaxInputBytes int64 + MaxLoopIterations int64 + MaxOutputBytes int64 + MaxUncompressedBytes int64 + MaxXMLDepth int64 + type ListRef struct + ID int + Level int + type Location struct + Cell string + Paragraph *int + Row *int + Slide *int + type NullMode string + const NullEmpty + const NullError + const NullKeep + const NullText + type NullValue struct + Func func(tag TagInfo) (any, error) + Mode NullMode + Text string + type Options struct + DateFormat string + Delimiters Delimiters + Engine *Engine + EscapeChar string + Filters map[string]Filter + Limits Limits + NoEscape bool + NoLinebreaks bool + NullValue NullValue + Strict bool + Stringify func(value any) (string, error) + Syntax Syntax + TimeZone *time.Location + type PartTags struct + Part string + Tags []Tag + type PptxInline struct + Bold *bool + Color string + Font string + Italic *bool + Props string + Size *float64 + Strike *bool + Text string + Type string + Underline *Underline + XML string + func (in PptxInline) MarshalJSON() ([]byte, error) + type PptxParagraph struct + Align string + Children []PptxInline + EndProps string + Level *int + Props string + type PptxShape struct + ID int64 + Name string + Paragraphs []PptxParagraph + Placeholder string + Rows []PptxTableRow + Type string + XML string + type PptxSlide struct + Notes string + Path string + Shapes []PptxShape + type PptxTableCell struct + Paragraphs []PptxParagraph + type PptxTableRow struct + Cells []PptxTableCell + type Problem struct + Code ErrorCode + Details map[string]any + Location *Location + Message string + Part string + Tag string + func (p Problem) String() string + type SectionMode string + const ModeEach + const ModeIf + const ModeInverted + const ModeSection + const ModeUnless + type Syntax struct + Close string + Each string + Else string + If string + Image string + Inverted string + Section string + Unless string + type Tag struct + Children []Tag + ElseChildren []Tag + Expression string + Filters []string + Mode SectionMode + Path string + Raw string + Type TagType + type TagInfo struct + Expression string + Part string + Raw string + type TagType string + const TagImage + const TagSection + const TagVariable + type Template struct + func (tpl *Template) Close() error + func (tpl *Template) Format() Format + func (tpl *Template) Inspect(ctx context.Context) (*InspectResult, error) + func (tpl *Template) Parts() []string + func (tpl *Template) Render(ctx context.Context, data any) ([]byte, error) + type Templater struct + func New(opts Options) *Templater + func (t *Templater) Compile(ctx context.Context, template []byte) (*Template, error) + func (t *Templater) Inspect(ctx context.Context, template []byte) (*InspectResult, error) + func (t *Templater) Render(ctx context.Context, template []byte, data any) ([]byte, error) + type Underline struct + On bool + Type string + func (u *Underline) UnmarshalJSON(b []byte) error + func (u Underline) MarshalJSON() ([]byte, error) + type XlsxCell struct + Formula string + Ref string + RichText string + Style *int + Type string + Value any + type XlsxRow struct + Cells []XlsxCell + Height *float64 + Hidden *bool + Index int + type XlsxSheet struct + Merges []string + Name string + Path string + Rows []XlsxRow + func SheetFromArrays(name string, rows [][]any) XlsxSheet