unidoc / unioffice

Pure go library for creating and processing Office Word (.docx), Excel (.xlsx) and Powerpoint (.pptx) documents
https://unidoc.io/unioffice/
Other
4.37k stars 473 forks source link

Runtime error extracting text from Word document #489

Closed JulieCraig closed 1 year ago

JulieCraig commented 1 year ago

Description

Trying to extract text from a word document gets a runtime error

Expected Behavior

Using code from https://github.com/unidoc/unioffice-examples/blob/master/document/text_extraction/main.go (but just get the flattened text and not the individual formatted items). I attempted to extract the text from a word document. The line "extracted := doc.ExtractText()" produces an error.

Actual Behavior

panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x17dfcf6]

goroutine 1 [running]: github.com/unidoc/unioffice/document.(*Document).ExtractText(0xc000002300)

Please include a reproducible code snippet or document attachment that demonstrates the issue. As an example, this document gets the error https://create.microsoft.com/en-us/template/bold-attorney-resume-d62d84e1-905a-45d1-b1ae-624b8cae6381

github-actions[bot] commented 1 year ago

Welcome! Thanks for posting your first issue. The way things work here is that while customer issues are prioritized, other issues go into our backlog where they are assessed and fitted into the roadmap when suitable. If you need to get this done, consider buying a license which also enables you to use it in your commercial products. More information can be found on https://unidoc.io/

sampila commented 1 year ago

Hi @JulieCraig,

Thanks for reporting this issue, we will checks this issue and inform the updates to you.

sampila commented 1 year ago

Hi @JulieCraig,

We released new UniOffice version https://github.com/unidoc/unioffice/releases/tag/v1.25.0 to solve this issue.