-
Notifications
You must be signed in to change notification settings - Fork 90
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
add utf8 characterannotaiton is failed #55
Comments
aha, I have solved the problem by myself. |
Hi , can you explain how it was solved ? |
@alanJ198, please share your solution, I also need it! The following code (source is UTF-8): factory.createTextAnnotation({
// …
contents: "Hello! こんにちは! Привет!",
// …
}) Produces following annotation:
How to write UTF-8 strings to annotations correctly? |
function stringToUtf16Raw(text) {
let out = [];
out.push(String.fromCharCode(254));
out.push(String.fromCharCode(255));
for (let c of text) {
c = c.charCodeAt(0);
out.push(String.fromCharCode(c >> 8));
out.push(String.fromCharCode(c & 0xFF));
}
return out.join('');
}
factory.createTextAnnotation({
// …
contents: stringToUtf16Raw("Hello! こんにちは! Привет!"),
// …
}) |
no show char in browser when open the export pdf file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hi, when I try to add some annotations with utf8 character (for example Japanese), it seems not work.
hope to get an advice for this problem, thanks
The text was updated successfully, but these errors were encountered: