Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when rendering code containing Chinese characters into a PDF #283

Open
HansBug opened this issue May 7, 2023 · 3 comments
Open

Error when rendering code containing Chinese characters into a PDF #283

HansBug opened this issue May 7, 2023 · 3 comments
Labels
plantuml core PlantUML Core Issue. Can't be fixed here, maybe report at <https://github.com/plantuml/plantuml>?

Comments

@HansBug
Copy link

HansBug commented May 7, 2023

As mentioned above, the latest version of the PlantUML server (version 23731c11bcf6, or jetty-v1.2023.6) fails to display Chinese characters correctly when rendering UML code containing Chinese characters into PDF format.

Here is an example code

@startuml
用户 -> 认证中心: 登录操作
认证中心 -> 缓存: 存放(key=token+ip,value=token)token

用户 <- 认证中心 : 认证成功返回token
用户 -> 认证中心: 下次访问头部携带token认证
认证中心 <- 缓存: key=token+ip获取token
其他服务 <- 认证中心: 存在且校验成功则跳转到用户请求的其他服务
其他服务 -> 用户: 信息
@enduml

It should be rendered like this (as it in PNG, SVG or even ASCII art format):

image

But it is actually rendered like this in pdf:

image

PS: I have just tested and encountered the same issue with the tomcat version image as well.

@HeinrichAD
Copy link
Collaborator

I tried your example directly with the lastest release (v1.2023.6) from plantuml (without the server part) as descript here and got the same result. Hence, I'm confident, that this isn't a plantuml-server but a plantuml bug. Maybe it is more promising to open/share the issue there?

@HansBug
Copy link
Author

HansBug commented May 16, 2023

@HeinrichAD Fine, I opened an issue there plantuml/plantuml#1426

I am maintaining a Python-based Plantuml SDK and CLI library called plantumlcli. Currently, this issue can be temporarily bypassed by installing cairosvg (which obtains a normal SVG image and converts it to PDF).

@HeinrichAD
Copy link
Collaborator

HeinrichAD commented Jun 10, 2023

I tried to look a little bit into the problem and created a test repository:
https://github.com/HeinrichAD/java-svg2pdf-issue

I have tried a few approaches, but unfortunately have not found a (quick/simple) solution.

@HeinrichAD HeinrichAD added the plantuml core PlantUML Core Issue. Can't be fixed here, maybe report at <https://github.com/plantuml/plantuml>? label Jul 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plantuml core PlantUML Core Issue. Can't be fixed here, maybe report at <https://github.com/plantuml/plantuml>?
Projects
None yet
Development

No branches or pull requests

2 participants