跳转到主要内容

BookStack PDF 导出中文

第一步:安装 wkhtmltopdf

yum install -y wget unzip fontconfig

wget https://fonts.google.com/download?family=Noto%20Sans%20HK -O Noto_Sans_HK.zip
unzip Noto_Sans_HK.zip -d /usr/share/fonts
fc-cache

wget https://fonts.google.com/download?family=Noto%20Sans%20TC -O Noto_Sans_TC.zip
unzip Noto_Sans_TC.zip -d /usr/share/fonts
fc-cache

wget https://fonts.google.com/download?family=Noto%20Sans%20SC -O Noto_Sans_SC.zip
unzip Noto_Sans_SC.zip -d /usr/share/fonts
fc-cache

wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos7.x86_64.rpm -O wkhtmltox-0.12.6-1.centos7.x86_64.rpm
yum localinstall wkhtmltox-0.12.6-1.centos7.x86_64.rpm 

# /usr/local/bin/wkhtmltopdf
which wkhtmltopdf

第二步:配置 BookStack

WKHTMLTOPDF=/usr/local/bin/wkhtmltopdf
ALLOW_UNTRUSTED_SERVER_FETCHING=true