-
Notifications
You must be signed in to change notification settings - Fork 9k
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
puppeteer from html to pdf arabic fonts are not showing #4424
Comments
See #4364 (comment). Seems this was caused by 27c9f75. A minimal testcase: const fs = require('fs');
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.setContent('😃');
fs.writeFileSync('out.png', await page.screenshot());
await browser.close();
})(); When run using 1.15, this correctly outputs: When run using 1.16, which includes mentioned commit, this incorrectly outputs: |
Hi @syednoor6208 |
Not yet... |
Hi @zeeshanaligold i have old "puppeteer" node_modules which is working fine... |
Hi @syednoor6208 |
I have same issue.
It's also same. |
Same issue here with Spanish accents. |
I got a fix, i'll post a pull request in a while! |
This patch fixes page.setContent with unicode strings that exceeds the range of a 8-bit byte. Fixes puppeteer#4424
Same issue here, v1.15.0 arabic and UTF-8 characters exported as a PDF come out correctly, v1.16.0 it is all messed up. |
Same issue here @v1.16 |
Fix `page.setContent` with unicode strings that exceeds the range of a 8-bit byte. This patch implements decoding part of the [MDN's solution #4 for the "unicode problem"](https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_4_%E2%80%93_escaping_the_string_before_encoding_it). Since we rely on node.js buffer to encode into base64, we don't have troubles with base64 encoding, so it is left as-is. Fixes #4424
It's broken again in 1.20. In 1.19 works fine |
Same issue here @v.1.20 |
Right now I'm trying to do return page
.$(selector)
.then(el => {
return el?.evaluate(el => {
return (el as HTMLTextAreaElement).value; I only get the spaces. To be more accurate, I type : [32, 0 ,32] chars but I get [32, 32] , the 0 is missing, not sure why. |
delete all npm modules and packagelock.json then do npm install arabic text is showing junk values.
![Screenshot 2019-05-14 at 4 35 49 PM](https://user-images.githubusercontent.com/30065880/57693237-5bc6ae80-7666-11e9-8ad7-562c3946dec9.png)
The text was updated successfully, but these errors were encountered: