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

When exporting PDF, all Chinese characters become squares #164

Open
Neilsons opened this issue Sep 2, 2024 · 2 comments
Open

When exporting PDF, all Chinese characters become squares #164

Neilsons opened this issue Sep 2, 2024 · 2 comments

Comments

@Neilsons
Copy link

Neilsons commented Sep 2, 2024

Expected Behavior
The report downloaded using asp.net core api is displayed normally in Chinese。

Actual Behavior
The report downloaded using asp.net coreapi using .net6 displays normally in Chinese. It can be downloaded normally when deployed on window, and the generated PDF can also display normally in Chinese. It can also generate normal PDF when run on a linux (console program) physical machine. However, when the generated PDF is deployed in a container, the Chinese characters are not displayed normally, and are all squares. The numbers can be displayed normally. I'm not sure if it is a font problem or an encoding problem in the deployment environment.

The font embedding method used

The font parser is
GeneratePDf.zip

The font is already embedded in the assembly。

@Neilsons
Copy link
Author

Neilsons commented Sep 3, 2024

Solved. The encoding format of the files generated by pdf is Simplified Chinese (GB2312) - code page 936, which should be adjusted to Uniconde (UTF-8 with signature) - code page 65001

@ThomasHoevel
Copy link
Member

The encoding format of the files generated by pdf is Simplified Chinese (GB2312) - code page 936, which should be adjusted to Uniconde (UTF-8 with signature) - code page 65001

I'm afraid I don't understand. Was it a change in your code or did you change PDFsharp?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants