【发布时间】:2020-11-12 20:11:37
【问题描述】:
所以,我使用的是libreoffice-convert,当然是在我的 nodejs 应用程序中运行。 我的代码如下
const file = fs.readFileSync(enterPath);
// Convert it to pdf format with undefined filter (see Libreoffice doc about filter)
libre.convert(file, extend, undefined, (err, done) => {
if (err) {
console.log(`Error converting file: ${err}`);
}
// Here in done you have pdf file which you can save or transfer in another stream
fs.writeFileSync(outputPath, done);
});
上面的代码在尝试打开 LibreOffice 时返回错误。
The application cannot be started.
The configuration file "C:\Program Files\LibreOffice\program\bootstrap.ini" is corrupt.
这是我bootstrap.ini的内容
[Bootstrap]
InstallMode=<installmode>
ProductKey=LibreOffice 7.0
UserInstallation=$SYSUSERCONFIG/LibreOffice/4
如果有人能帮助解决这个问题,我真的很感激。也不确定它是否有帮助,但我在 Windows 上运行它。
【问题讨论】:
-
你能从
C:\Program Files\LibreOffice\program运行soffice.exe吗?有用吗? -
是的,我可以运行
soffice.exe。它工作得很好。 -
而且
bootstrap.ini看起来也不错? -
啊,是的,我已经更新了问题并包含了我的
bootstrap.ini的内容。 -
@Anatoly,在 Mac 上安装 LibreOffice 后非常简单,一切正常。但在 Windows 上,这发生了。
标签: node.js libreoffice