question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

        const puppeteerBrowser = await puppeteer.launch({ args: ['--no-sandbox'] })
        const puppeteerPage = await puppeteerBrowser.newPage()
        await puppeteerPage.setContent(html, { waitUntil: 'networkidle0' })
        const pdfstring = await puppeteerPage.pdf({
            displayHeaderFooter: false,
            printBackground: true,
            format: 'A3'
        })

        res.setHeader('Content-disposition', `attachment; filename=${page}.pdf`);
        res.setHeader('Content-type', 'aplication/pdf');
        res.end(pdfstring)

        await puppeteerBrowser.close()

If i generate PDF using code above, than wrong charset is used. In html code is specificly added meta tag <meta charset="utf-8"/> and I can`t find any option in puppeteer to specify otherwise.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
semoalcommented, May 15, 2019

Duplicated issue mate, close it please. https://github.com/GoogleChrome/puppeteer/issues/4424

1reaction
DvdGiessencommented, May 15, 2019

See https://github.com/GoogleChrome/puppeteer/issues/4424#issuecomment-492196710. For the time being, installing the previous version (v1.15.0) does seem to resolve the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solving character encoding problems - jAlbum Wiki
Problem. Computers store text as a sequence of numbers where each character has a unique number according to an agreed upon "character encoding...
Read more >
The character set problem - Hostpoint Support Center
This error is the easiest to correct. The data is stored and output with a consistently defined charset, but the charset being used...
Read more >
Charset (character encoding) problem: text is displayed ...
Non-Latin characters in commit messages or file contents are displayed as squares or unknown characters.
Read more >
How to fix character encoding issue in html? - Stack Overflow
1 Answer 1 · On Notepad++ select Encoding -> ISO-8859-15 and save the file. · Use <meta http-equiv="Content-Type" content="text/html; charset=ISO- ...
Read more >
Fix Character Encoding on Your Website - Larry Kagan
A step-by-step guide to troubleshooting and repairing character encoding problems in your website.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found