-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Issues with characters not displayed correctly? #2677
Comments
This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant. |
This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant. |
This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant. |
@miriankakhidze Were you able to fix this? Or make it work on any Georgian font. |
@gsiradze No, I use another library |
@miriankakhidze hey, which one please ? |
@mkubdev not sure if this will help but in my case I did this and it worked pretty well |
@gsiradze thank you! Kudos, it's working ✨ |
I am trying to display data in Chinese, but for Chinese texts it is showing some weird text. Do anyone know how to fix this encoding issue. |
|
|
@HackbrettXXX Hi, I'm getting garbled Chinese when using textField. import { jsPDF } from "jspdf";
import fs from "fs";
const doc = new jsPDF();
var SimSun = fs.readFileSync('./SimSun.ttf', {
encoding: 'latin1',
});
doc.addFileToVFS('simsun.ttf', SimSun);
doc.addFont('simsun.ttf', 'simsun', 'normal');
doc.setFont('simsun');
const textField = new doc.AcroForm.TextField()
textField.Rect = [20, 20, 50, 50]
textField.value = '你好 世界! hello world!';
textField.fontStyle = 'normal';
doc.text(20, 20, '你好 世界! hello world!');
doc.addField(textField)
doc.save("hello.pdf") |
Sometimes characters are not displayed correctly in the created PDF files and instead show some weird glyphs. This is the case for any characters outside the ASCII range. In order to fix this issue, you need to add a custom font to jsPDF. See the readme on how to do this:
The text was updated successfully, but these errors were encountered: