unidoc / unioffice

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

panic: runtime error: index out of range [0] with length 0 while converting docx to pdf #505

Open knight-ni opened 9 months ago

knight-ni commented 9 months ago

Description

i got error while converting this docx to pdf, can anybody help 测试用户1_测试业务1_centos_DMSERVER20231215.docx

Actual Behavior

panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]: github.com/unidoc/unioffice/document/convert.(convertContext).addAbsoluteTable(0xc000180d80, 0xc000961200) D:/gosdk/pkg/mod/github.com/unidoc/unioffice@v1.29.0/document/convert/convert.go:99 +0x2446 github.com/unidoc/unioffice/document/convert.(convertContext).addAbsoluteCBCs(0xc000180d80, {0xc000916cd0, 0x1, 0x47e8a7?}, {0xc000916cf8?, 0x1, 0x3cd585?})
D:/gosdk/pkg/mod/github.com/unidoc/unioffice@v1.29.0/document/convert/convert.go:25 +0x7a5 github.com/unidoc/unioffice/document/convert.ConvertToPdfWithOptions(0xc000180480, 0x0) D:/gosdk/pkg/mod/github.com/unidoc/unioffice@v1.29.0/document/convert/convert.go:155 +0xbe5 github.com/unidoc/unioffice/document/convert.ConvertToPdf(...) D:/gosdk/pkg/mod/github.com/unidoc/unioffice@v1.29.0/document/convert/convert.go:191 dmHC_Runner/pkg/docx2pdf.WordToPDF({{0xc0002fc28b, 0xd}, {0xc0002fc2aa, 0xd}, {0xc000228000, 0x3c}, {0xc0002fc2ca, 0xe}, 0x16, 0x1474, ...}, ...) D:/BaiduNetdiskDownload/work/DM/property/mytools/dmHC_Runner/pkg/docx2pdf/docx2pdf.go:29 +0x1f4 main.main() D:/BaiduNetdiskDownload/work/DM/property/mytools/dmHC_Runner/main.go:90 +0x9f0

Process finished with the exit code 2

sampila commented 9 months ago

Hi @knight-ni,

Thanks for the report, we are investigating this issue.

kellemNegasi commented 1 week ago

@knight-ni , This bug has been fixed and It will be available in the coming releases. We will write an update as soon as the fix is released.