About using Korean.
eg2data opened this issue · 9 comments
Hi, I am so glad to say thank you for your efforts.
This is amazingly comfortable when I produce PDF file with prepared-PDF template.
However, I have had a trouble with input data in Korean.
I mean, whenever I have tried to set data written by Korean to the field, the error occured,
"(node:69032) UnhandledPromiseRejectionWarning: Error: WinAnsi cannot encode "왜" (0xc65c)"
I really want to discuss this issue with you.
I will share the code I have tried through github.
Hi @eg2data
I have checked the code and it seems to be fine.
I also had a problem with Japanese fonts before.
At that time it was a problem with the font file itself.
Could you please try with other fonts as well?
and you should this issue.
you can use subset: false option.
like this.
const pdf = await labelmake({
inputs,
template,
font: {
SauceHanSansJP: {
data: fs.readFileSync(__dirname + `/fonts/SauceHanSansJP.ttf`),
subset: false,
},
SauceHanSerifJP: {
data: fs.readFileSync(__dirname + `/fonts/SauceHanSerifJP.ttf`),
subset: false,
},
},
});
this option is not written in documents yet.
sorry....
please try.
@eg2data have you fixed your issue? I tried the fix, but the issue still remains.
Hi, drizzt00s.
Thank you for your consideration.
Actually, I cannot find the exact part to apply hand-dot's comment on my code, so that I do not check yet..!
@eg2data sorry my ambiguous explain.
Could you try below code?
const MaruBuri = fs.readFileSync("./MaruBuri-Regular.ttf")
const font = {
MaruBuri: {
data: MaruBuri,
subset: false
}
};
Hey, hand-dot..!
I am really happy to say that your code works! perfectly works!
Thank you for your help.
I was really surprised with your immediate response and efforts.
Thanks again!