CodiMD导出pdf失败或无中文

CodiMD导出pdf失败,弹出文件保存窗口,有个pdf文件能下载,但是保存的时候提示"网站出问题了",实际到服务器上看会发现docker崩溃了。

解决办法:

  1. 使用最新的CodiMD镜像,如nabo.codimd.dev/hackmdio/hackmd:2.5.4

    如果是导出pdf没有中文,可能使用的较老的镜像,如2.4.2以前的,里面没有中文字体支持。

  2. docker-compose.yml里面配置如下参数:

     environment:
       #for pdf export
       - CMD_ALLOW_PDF_EXPORT=true
       - QT_QPA_PLATFORM=
       - OPENSSL_CONF=/etc/ssl
    

否则会提示DSO support routines:DLFCN_LOAD:

DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:185:filename(libssl_conf.so): libssl_conf.so: cannot open shared object file: No such file or directory

或者phantomjs错误

2024-03-24T14:42:45.731Z error:         uncaughtException: Command failed: /home/hackmd/app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs /home/hackmd/app/node_modules/markdown-pdf/phantom/render.js /tmp/tmp-35zfQ8i6i7t56J.html /tmp/tmp-35TT7Us019ho1a.pdf /home/hackmd/app /home/hackmd/app/node_modules/markdown-pdf/runnings.js /home/hackmd/app/node_modules/markdown-pdf/css/pdf.css /home/hackmd/app/node_modules/highlight.js/styles/github-gist.css A4 portrait 2cm 0 10000
Auto configuration failed
139809934388864:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:185:filename(libssl_conf.so): libssl_conf.so: cannot open shared object file: No such file or directory
139809934388864:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
139809934388864:error:0E07506E:configuration file routines:MODULE_LOAD_DSO:error loading dso:conf_mod.c:285:module=ssl_conf, path=ssl_conf
139809934388864:error:0E076071:configuration file routines:MODULE_RUN:unknown module name:conf_mod.c:222:module=ssl_conf

Error: Command failed: /home/hackmd/app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs /home/hackmd/app/node_modules/markdown-pdf/phantom/render.js /tmp/tmp-35zfQ8i6i7t56J.html /tmp/tmp-35TT7Us019ho1a.pdf /home/hackmd/app /home/hackmd/app/node_modules/markdown-pdf/runnings.js /home/hackmd/app/node_modules/markdown-pdf/css/pdf.css /home/hackmd/app/node_modules/highlight.js/styles/github-gist.css A4 portrait 2cm 0 10000
Auto configuration failed
139809934388864:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:185:filename(libssl_conf.so): libssl_conf.so: cannot open shared object file: No such file or directory
139809934388864:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
139809934388864:error:0E07506E:configuration file routines:MODULE_LOAD_DSO:error loading dso:conf_mod.c:285:module=ssl_conf, path=ssl_conf
139809934388864:error:0E076071:configuration file routines:MODULE_RUN:unknown module name:conf_mod.c:222:module=ssl_conf

    at ChildProcess.exithandler (node:child_process:402:12)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
2024-03-24T14:42:45.731Z error:         An uncaught exception has occured.
2024-03-24T14:42:45.731Z error:         Command failed: /home/hackmd/app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs /home/hackmd/app/node_modules/markdown-pdf/phantom/render.js /tmp/tmp-35zfQ8i6i7t56J.html /tmp/tmp-35TT7Us019ho1a.pdf /home/hackmd/app /home/hackmd/app/node_modules/markdown-pdf/runnings.js /home/hackmd/app/node_modules/markdown-pdf/css/pdf.css /home/hackmd/app/node_modules/highlight.js/styles/github-gist.css A4 portrait 2cm 0 10000
Auto configuration failed
139809934388864:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:185:filename(libssl_conf.so): libssl_conf.so: cannot open shared object file: No such file or directory
139809934388864:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
139809934388864:error:0E07506E:configuration file routines:MODULE_LOAD_DSO:error loading dso:conf_mod.c:285:module=ssl_conf, path=ssl_conf
139809934388864:error:0E076071:configuration file routines:MODULE_RUN:unknown module name:conf_mod.c:222:module=ssl_conf

2024-03-24T14:42:45.734Z error:         Process will exit now.
Error: Command failed: /home/hackmd/app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs /home/hackmd/app/node_modules/markdown-pdf/phantom/render.js /tmp/tmp-35zfQ8i6i7t56J.html /tmp/tmp-35TT7Us019ho1a.pdf /home/hackmd/app /home/hackmd/app/node_modules/markdown-pdf/runnings.js /home/hackmd/app/node_modules/markdown-pdf/css/pdf.css /home/hackmd/app/node_modules/highlight.js/styles/github-gist.css A4 portrait 2cm 0 10000
Auto configuration failed
139809934388864:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:185:filename(libssl_conf.so): libssl_conf.so: cannot open shared object file: No such file or directory
139809934388864:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
139809934388864:error:0E07506E:configuration file routines:MODULE_LOAD_DSO:error loading dso:conf_mod.c:285:module=ssl_conf, path=ssl_conf
139809934388864:error:0E076071:configuration file routines:MODULE_RUN:unknown module name:conf_mod.c:222:module=ssl_conf

    at ChildProcess.exithandler (node:child_process:402:12)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5) {
  code: 1,
  killed: false,
  signal: null,
  cmd: '/home/hackmd/app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs /home/hackmd/app/node_modules/markdown-pdf/phantom/render.js /tmp/tmp-35zfQ8i6i7t56J.html /tmp/tmp-35TT7Us019ho1a.pdf /home/hackmd/app /home/hackmd/app/node_modules/markdown-pdf/runnings.js /home/hackmd/app/node_modules/markdown-pdf/css/pdf.css /home/hackmd/app/node_modules/highlight.js/styles/github-gist.css A4 portrait 2cm 0 10000',
  level: 'error',
  timestamp: '2024-03-24T14:42:45.731Z',
  [Symbol(level)]: 'error',
  [Symbol(message)]: '2024-03-24T14:42:45.731Z error: \tCommand failed: /home/hackmd/app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs /home/hackmd/app/node_modules/markdown-pdf/phantom/render.js /tmp/tmp-35zfQ8i6i7t56J.html /tmp/tmp-35TT7Us019ho1a.pdf /home/hackmd/app /home/hackmd/app/node_modules/markdown-pdf/runnings.js /home/hackmd/app/node_modules/markdown-pdf/css/pdf.css /home/hackmd/app/node_modules/highlight.js/styles/github-gist.css A4 portrait 2cm 0 10000\n' +
    'Auto configuration failed\n' +
    '139809934388864:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:185:filename(libssl_conf.so): libssl_conf.so: cannot open shared object file: No such file or directory\n' +
    '139809934388864:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:\n' +
    '139809934388864:error:0E07506E:configuration file routines:MODULE_LOAD_DSO:error loading dso:conf_mod.c:285:module=ssl_conf, path=ssl_conf\n' +
    '139809934388864:error:0E076071:configuration file routines:MODULE_RUN:unknown module name:conf_mod.c:222:module=ssl_conf\n'
}
相关推荐
情勤坊13 小时前
JAVA实现将PDF转换成word文档
java·pdf·word
DN金猿16 小时前
Vue移动端网页(H5)预览pdf文件(pdfh5和vue-pdf)(很详细)
前端·vue.js·pdf
CodeCraft Studio1 天前
【实用技能】使用 TX Text Control 创建带有嵌入式附件的 PDF 文档
pdf·asp.net·.net
小小大侠客1 天前
IText创建加盖公章的pdf文件并生成压缩文件
java·pdf·itext
DevOpenClub1 天前
PDF 转 HTML API 数据接口
pdf
zhy8103022 天前
.net6 使用 FreeSpire.XLS 实现 excel 转 pdf - docker 部署
pdf·.net·excel
慧都小妮子2 天前
Spire.PDF for .NET【页面设置】演示:打开 PDF 时自动显示书签或缩略图
java·pdf·.net
join82 天前
解决vue-pdf的签章不显示问题
javascript·vue.js·pdf