一、下载安装包
https://download.calibre-ebook.com/5.0.1/calibre-5.0.1-x86_64.txz
二、解压安装包到指定目录
tar -xvf calibre-5.0.1-x86_64.txz -C /opt/calibre
三、安装软件包
/opt/calibre/calibre_postinstall
四、安装yum install qt5-qtbase-devel解决以下问题
五、测试运行
calibre
报以下错误信息:
请使用如下设置解决:
echo "export QT_QPA_PLATFORM='offscreen'" | tee /etc/profile.d/QT_QPA.sh
source /etc/profile
再次尝试运行:
calibre
按下【Ctrl+Z】结束程序
六、创建测试文件touch test.txt,vim test.txt编辑输入中文很英文字符
七、测试文件转换ebook-convert test.txt test.pdf
会报如下错误:
请使用如下设置解决:
export QTWEBENGINE_DISABLE_SANDBOX=1
source /etc/profile
再次尝试运行:ebook-convert test.txt test.pdf
八、导出的文件会出现中文乱码
解决方法如下:
将Windows上的宋体上传到服务器/usr/share/fonts/里/usr/share/fonts/chinese/TrueType/simsun.ttc