Document title with Cyrillic characters encoding problem
Hi, I'm not sure this has been reported yet, but basically the title is self-explanatory. Cyrillic characters in the document title become something else:
const handlePrint = useReactToPrint({
content: () => componentRef.current,
documentTitle: 'Справка',
onAfterPrint: () => console.log('Printed PDF successfully!'),
});
I suspected this would be a problem for other languages/character sets, so I also tested with some Chinese characters as well so... suspicion confirmed :)
const handlePrint = useReactToPrint({
content: () => componentRef.current,
documentTitle: '諺語',
onAfterPrint: () => console.log('Printed PDF successfully!'),
});
NodeJS v20.3.0 [email protected] [email protected] Google Chrome
Let me know if there's anything I can do to help. Thanks!
Hello. Thanks for the report. I'm not able to replicate this. I ran the test locally on:
MacOS: 13.6.1 Chrome: 119 Node: 20.10.0 React: 18.2.0 reacto-to-print: 20.14.15
Is there any other debug data you are able to provide? Are you using special fonts maybe?
Hi, thanks for the reply! I was thinking about supplying additional fonts as properties so I'll definitely do that. There are some project-specific fonts that are in place, if they are a likely culprit how should I proceed? Thanks again!
Can you try removing them to check if they are the issue? If they are, then what you should probably do is ensure they are not used in the printing view. That way the PDF will only use standard fonts that the computer will have. Alternatively, if you have access to all the computers the files will be viewed on, just install those additional fonts onto those computers