mindoc icon indicating copy to clipboard operation
mindoc copied to clipboard

mindoc导出问题

Open lovebetterworld opened this issue 1 year ago • 5 comments

请按照一下格式提交issue,谢谢!

  1. 你当前使用的是哪个版本的 MinDoc(godoc_linux_amd64 version)?

registry.cn-hangzhou.aliyuncs.com/mindoc-org/mindoc:v2.1

  1. 你当前使用的是什么操作系统?

Centos7

  1. 你是如何操作的?

Docker-compose方式部署好mindoc,宿主机安装calibre。

宿主机测试转换,是可以成功的。

  1. 你期望得到什么结果?

成功导出word或者pdf

  1. 当前遇到的是什么结果?

转换WORD文档失败:exit status 1 2022/07/28 17:17:49.540 [E] [BookResult.go:498] 转换文件错误:开发文档 -> exit status 1

lovebetterworld avatar Jul 28 '22 09:07 lovebetterworld

哎呦我去啊,自己解决了,自己来附上解决办法,真绝望。

docker-compose里面,把calibre的也挂载出去。 容器里面,calibre是安装在/opt下面的,你也可以在宿主机安装在/opt下面,然后配置环境变量。

配置环境变量: vi /etc/profile ,添加如下两行,然后保存即可。 PATH=$PATH:/opt/calibre export PATH

source /etc/profile

然后,docker-compose.yml中,挂载目录。- /opt/calibre:/opt/calibre

完整docker-compose.yml如下: version: '3' services: mindoc: image: 'registry.cn-hangzhou.aliyuncs.com/mindoc-org/mindoc:v2.1' container_name: mindoc volumes: - /data/mindoc/uploads:/mindoc/uploads - /data/mindoc/conf:/mindoc/conf - /data/mindoc/views:/mindoc/views - /opt/calibre:/opt/calibre ports: - '8181:8181' environment: TZ: Asia/Shanghai MINDOC_DB_ADAPTER: mysql MINDOC_DB_HOST: xxxxxxx MINDOC_DB_PORT: 3306 MINDOC_DB_DATABASE: mindoc_db MINDOC_DB_USERNAME: root MINDOC_DB_PASSWORD: 123456

启动,测试成功。

lovebetterworld avatar Jul 28 '22 09:07 lovebetterworld

mindoc:v2.1 同样遇到这个问题

aisuhua avatar Aug 29 '22 00:08 aisuhua

@lovebetterworld 是不兼容 calibre 新版本的问题, Dockerfile 构建镜像时会一直使用最新版本的 calibre, https://github.com/mindoc-org/mindoc/blob/5a9d09734476a035c586c4cd501f790be69249c6/Dockerfile#L109

但是目前不兼容最新版 6,可回滚到 5 版本,具体操作如下: 首先进入容器

docker exec -it mindoc bash

然后重装 calibre 为低版本

mv /opt/calibre /opt/calibre-bak
mkdir /opt/calibre
wget https://download.calibre-ebook.com/5.44.0/calibre-5.44.0-x86_64.txz
tar xJof calibre-5.44.0-x86_64.txz -C /opt/calibre
rm  -f calibre-5.44.0-x86_64.txz

或者重新修改 Dockerfile,重新构建镜像。

aisuhua avatar Aug 29 '22 01:08 aisuhua

@lovebetterworld 是不兼容 calibre 新版本的问题, Dockerfile 构建镜像时会一直使用最新版本的 calibre,

https://github.com/mindoc-org/mindoc/blob/5a9d09734476a035c586c4cd501f790be69249c6/Dockerfile#L109

但是目前不兼容最新版 6,可回滚到 5 版本,具体操作如下: 首先进入容器

docker exec -it mindoc bash

然后重装 calibre 为低版本

mv /opt/calibre /opt/calibre-bak
mkdir /opt/calibre
wget https://download.calibre-ebook.com/5.44.0/calibre-5.44.0-x86_64.txz
tar xJof calibre-5.44.0-x86_64.txz -C /opt/calibre
rm  -f calibre-5.44.0-x86_64.txz

或者重新修改 Dockerfile,重新构建镜像。

嗯,我也解决了,修改了挂载宿主机得calibre版本就好了。

lovebetterworld avatar Aug 29 '22 02:08 lovebetterworld

@lovebetterworld 是不兼容 calibre 新版本的问题, Dockerfile 构建镜像时会一直使用最新版本的 calibre,

https://github.com/mindoc-org/mindoc/blob/5a9d09734476a035c586c4cd501f790be69249c6/Dockerfile#L109

但是目前不兼容最新版 6,可回滚到 5 版本,具体操作如下: 首先进入容器

docker exec -it mindoc bash

然后重装 calibre 为低版本

mv /opt/calibre /opt/calibre-bak
mkdir /opt/calibre
wget https://download.calibre-ebook.com/5.44.0/calibre-5.44.0-x86_64.txz
tar xJof calibre-5.44.0-x86_64.txz -C /opt/calibre
rm  -f calibre-5.44.0-x86_64.txz

或者重新修改 Dockerfile,重新构建镜像。

Great answer, but I'm still getting PDF export error when I compile using the regular method (NOT DOCKER).

[ebook-convert /tmp/51cc8fcb9a92073540676b5db76141ce/mindoc/output/content.epub /tmp/51cc8fcb9a92073540676b5db76141ce/mindoc/output/output/book.pdf --paper-size a4 --pdf-default-font-size 14 --pdf-header-template <p style='color:#8E8E8E;font-size:12px;'>_SECTION_</p> --pdf-footer-template <p style='color:#8E8E8E;font-size:12px;'>本文档使用 <a href='https://www.iminho.me' style='text-decoration:none;color:#1abc9c;font-weight:bold;'>MinDoc</a> 构建 <span style='float:right'>- _PAGENUM_ -</span></p> --pdf-page-margin-left 72 --pdf-page-margin-top 72 --pdf-page-margin-right 72 --pdf-page-margin-bottom 72]
正在转换 PDF 文件 /tmp/51cc8fcb9a92073540676b5db76141ce/mindoc/output/content.epub
转换PDF文档失败:exit status 1

DataSttructure avatar Oct 10 '22 09:10 DataSttructure