unidoc/unioffice

[UO-129] Incorrect conversion of doc to pdf

springswen opened this issue · 8 comments

Description

Incorrect conversion of doc to pdf

Expected Behavior

doc to pdf converted correctly

Actual Behavior

            outputPath := fmt.Sprintf("output/%s.pdf", filename)
	doc, err := document.Open("https://github.com/unidoc/unioffice/files/8096886/liuna.docx")
	if err != nil {
		log.Fatalf("error opening document: %s", err)
	}
	defer doc.Close()
	c := convert.ConvertToPdf(doc)

	err = c.WriteToFile(outputPath)
	if err != nil {
		log.Fatalf("error converting document: %s", err)
	}

But the conversion result is incorrect,I tried using https://foxyutils.com/wordtopdf/ the conversion is correct

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/

Hi @springswen,
Thank you for informing us about this issue.
This issue is on our radar, we gonna release improvement for Word to PDF conversion in the next version.

Hi @springswen
We made a new release for DOCX to PDF conversion improvement.
https://github.com/unidoc/unioffice/releases/tag/v1.18.0

Hi @springswen We made a new release for DOCX to PDF conversion improvement. https://github.com/unidoc/unioffice/releases/tag/v1.18.0

hi @sampila I tried to convert with this version but still got an error, I added the source file to the attachment, you can debug
liuna.docx

Hi @springswen, I tried and didn't see the error.
Is there's any error that makes the conversion didn't work? or the result of PDF still incorrect?
I got the result: liuna.docx.pdf
You need to add font of SIMSUN.ttf when converting the docx to pdf.
SIMSUN.zip

Hi @springswen, I tried and didn't see the error. Is there's any error that makes the conversion didn't work? or the result of PDF still incorrect? I got the result: liuna.docx.pdf You need to add font of SIMSUN.ttf when converting the docx to pdf. SIMSUN.zip

Hi @sampila Thank you for your suggestion, the conversion is correct after adding fonts, but if there are pictures in the file, the result of PDF format is incorrect
liuna.docx

Hi @springswen, thank you for the feedback, we will keep doing the improvement for the conversion result.
I will do check on that document.

Hi @springswen,
We released a new version of unioffice https://github.com/unidoc/unioffice/releases/tag/v1.19.0
I think the issue with incorrect convert result should be solved in that version.

I will close this issue for now.
Thanks.