export a page with Chinese characters to PDF #3762

Closed
opened 2026-02-05 07:22:28 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @jasonyunliang on GitHub (Apr 25, 2023).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

when i tried to export a page with Chinese characters. the characters will not be recoginzed in PDF file as below.

1682404686665

please help check. thanks.

Exact BookStack Version

v23.02.3

Log Content

No response

PHP Version

No response

Hosting Environment

set up by docker-compose.

Originally created by @jasonyunliang on GitHub (Apr 25, 2023). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario when i tried to export a page with Chinese characters. the characters will not be recoginzed in PDF file as below. ![1682404686665](https://user-images.githubusercontent.com/129718765/234194153-e76f5ee9-3e8f-48fa-8a5d-99d8b1f432a4.png) please help check. thanks. ### Exact BookStack Version v23.02.3 ### Log Content _No response_ ### PHP Version _No response_ ### Hosting Environment set up by docker-compose.
OVERLORD added the 🐕 Support:cat2:🐈 Possible duplicate labels 2026-02-05 07:22:28 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Apr 25, 2023):

Hi @jasonyunliang,
Yeah, this is a known issue and is already open in #148 and #719. Hence I'm going to close this off as a duplicate.
Also referenced in #2182 and #1964.

I have previously suggested using our wkhtmltopdf option as a workaround, but this has security implications and may not be available in your docker environment.

@ssddanbrown commented on GitHub (Apr 25, 2023): Hi @jasonyunliang, Yeah, this is a known issue and is already open in #148 and #719. Hence I'm going to close this off as a duplicate. Also referenced in #2182 and #1964. I have previously suggested using our wkhtmltopdf option as a workaround, but this has security implications and may not be available in your docker environment.
Author
Owner

@huangs639 commented on GitHub (Nov 10, 2023):

Hi @jasonyunliang, Yeah, this is a known issue and is already open in #148 and #719. Hence I'm going to close this off as a duplicate. Also referenced in #2182 and #1964.

I have previously suggested using our wkhtmltopdf option as a workaround, but this has security implications and may not be available in your docker environment.

Hi @ssddanbrown,
I cannot found /usr/bin/wkhtmltopdf in linuxserver/bookstack docker image(TAG 23.06.2), has it been removed from the docker image? Do you have plan to support it again in subsequent versions?

@huangs639 commented on GitHub (Nov 10, 2023): > Hi @jasonyunliang, Yeah, this is a known issue and is already open in #148 and #719. Hence I'm going to close this off as a duplicate. Also referenced in #2182 and #1964. > > I have previously suggested using our wkhtmltopdf option as a workaround, but this has security implications and may not be available in your docker environment. Hi @ssddanbrown, I cannot found /usr/bin/wkhtmltopdf in linuxserver/bookstack docker image(TAG 23.06.2), has it been removed from the docker image? Do you have plan to support it again in subsequent versions?
Author
Owner

@tli47 commented on GitHub (Apr 18, 2024):

Hi @jasonyunliang, Yeah, this is a known issue and is already open in #148 and #719. Hence I'm going to close this off as a duplicate. Also referenced in #2182 and #1964.
I have previously suggested using our wkhtmltopdf option as a workaround, but this has security implications and may not be available in your docker environment.

Hi @ssddanbrown, I cannot found /usr/bin/wkhtmltopdf in linuxserver/bookstack docker image(TAG 23.06.2), has it been removed from the docker image? Do you have plan to support it again in subsequent versions?

Hi, wkhtmltopdf is removed from the official image, you need to make a new docker image that contains wkhtmltopdf.
My Dockerfile is below for your reference, please note: I also install SimSun.ttf that supports chinese font, make sure SimSun.ttf existence if you use the following Dockerfile.

FROM surnet/alpine-wkhtmltopdf:3.16.2-0.12.6-full as wkhtmltopdf

COPY SimSun.ttf /usr/share/fonts/SimSun.ttf

FROM lscr.io/linuxserver/bookstack

RUN echo -e http://mirrors.ustc.edu.cn/alpine/v3.7/main/ > /etc/apk/repositories
RUN echo -e https://mirrors.aliyun.com/alpine/v3.17/community >> /etc/apk/repositories
#RUN echo -e http://dl-cdn.alpinelinux.org/alpine/v3.7/community >> /etc/apk/repositories

# Install dependencies for wkhtmltopdf
RUN apk add --no-cache \
     libxrender \
     openssl1.1-compat \
     fontconfig \
     freetype \
     ttf-dejavu \
     ttf-droid \
     ttf-freefont \
     ttf-liberation \
  && mkfontscale && mkfontdir && fc-cache -f

# RUN mkdir -p /usr/share/fonts/win
COPY --from=wkhtmltopdf /usr/share/fonts/SimSun.ttf /usr/share/fonts/SimSun.ttf

# Copy wkhtmltopdf files from docker-wkhtmltopdf image
COPY --from=wkhtmltopdf /bin/wkhtmltopdf /bin/wkhtmltopdf
COPY --from=wkhtmltopdf /bin/wkhtmltoimage /bin/wkhtmltoimage
COPY --from=wkhtmltopdf /bin/libwkhtmltox* /bin/
@tli47 commented on GitHub (Apr 18, 2024): > > Hi @jasonyunliang, Yeah, this is a known issue and is already open in #148 and #719. Hence I'm going to close this off as a duplicate. Also referenced in #2182 and #1964. > > I have previously suggested using our wkhtmltopdf option as a workaround, but this has security implications and may not be available in your docker environment. > > Hi @ssddanbrown, I cannot found /usr/bin/wkhtmltopdf in linuxserver/bookstack docker image(TAG 23.06.2), has it been removed from the docker image? Do you have plan to support it again in subsequent versions? Hi, wkhtmltopdf is removed from the official image, you need to make a new docker image that contains wkhtmltopdf. My Dockerfile is below for your reference, please note: I also install SimSun.ttf that supports chinese font, make sure SimSun.ttf existence if you use the following Dockerfile. ``` FROM surnet/alpine-wkhtmltopdf:3.16.2-0.12.6-full as wkhtmltopdf COPY SimSun.ttf /usr/share/fonts/SimSun.ttf FROM lscr.io/linuxserver/bookstack RUN echo -e http://mirrors.ustc.edu.cn/alpine/v3.7/main/ > /etc/apk/repositories RUN echo -e https://mirrors.aliyun.com/alpine/v3.17/community >> /etc/apk/repositories #RUN echo -e http://dl-cdn.alpinelinux.org/alpine/v3.7/community >> /etc/apk/repositories # Install dependencies for wkhtmltopdf RUN apk add --no-cache \ libxrender \ openssl1.1-compat \ fontconfig \ freetype \ ttf-dejavu \ ttf-droid \ ttf-freefont \ ttf-liberation \ && mkfontscale && mkfontdir && fc-cache -f # RUN mkdir -p /usr/share/fonts/win COPY --from=wkhtmltopdf /usr/share/fonts/SimSun.ttf /usr/share/fonts/SimSun.ttf # Copy wkhtmltopdf files from docker-wkhtmltopdf image COPY --from=wkhtmltopdf /bin/wkhtmltopdf /bin/wkhtmltopdf COPY --from=wkhtmltopdf /bin/wkhtmltoimage /bin/wkhtmltoimage COPY --from=wkhtmltopdf /bin/libwkhtmltox* /bin/ ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3762