-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error to convert Html to Docx #117
Comments
maybe try to use the extension without a dot? |
On code of exeplain how to use there is a dot, but I followed your suggestion and remove the dot now and I received the same error.
|
hmm strange, does htmlbuffer contain any bytes? |
Yes
|
Do you have libreoffice installed? At which path?
Am 2. April 2024 17:43:22 MESZ schrieb Vinicius Fernandes ***@***.***>:
…Yes
```
htmlBuffer <Buffer 3c 70 20 73 74 79 6c 65 3d 22 74 65 78 74 2d 61 6c 69 67 6e 3a 20 6a 75 73 74 69 66 79 3b 20 6c 69 6e 65 2d 68 65 69 67 68 74 3a 20 31 2e 35 3b 22 3e ... 65 more bytes>
Error convertHTMLToWord {
"errno": -2,
"code": "ENOENT",
"syscall": "open",
"path": "/var/folders/q0/kspr59sd4zs2l0qw7ss2qzdh0000gn/T/libreofficeConvert_-89990-URymgrEgBS1s/source.docx"
}
```
--
Reply to this email directly or view it on GitHub:
#117 (comment)
You are receiving this because you commented.
Message ID: ***@***.***>
|
Yes, the path is /opt/homebrew/bin/soffice |
Then you need to specify the binary path in the config.
Am 2. April 2024 21:58:49 MESZ schrieb Vinicius Fernandes ***@***.***>:
…Yes, the path is /opt/homebrew/bin/soffice
--
Reply to this email directly or view it on GitHub:
#117 (comment)
You are receiving this because you commented.
Message ID: ***@***.***>
|
How I do this? |
Change your convert lines to:
```
const convertAsync = util.promisify(libre.convertWithOptions);
```
and
```
const docxBuffer = await convertAsync(htmlBuffer, extension, undefined, {sofficeBinaryPaths: ["/opt/homebrew/bin/soffice"]});
```
|
Doesn't worked |
@ViniCleFer can you set a breakpoint in the convert task? it seems it can not write into your temporary directory. Maybe you can check at the open call if the folder exists. You could set a breakpoint in line 16 of index.js. |
So did you resolve the issue? |
I'm executing this code:
And I received this:
Ca you help me, please?
The text was updated successfully, but these errors were encountered: