(Note, even though this mention Pyppeteer, the Python version of Puppeteer, the code is exactly the same and works with either Puppeteer and Pyppeeteer).
Hi,
I'm converting the page http://getemoji.com/ into PDF using the following code :
import asyncio
from pyppeteer import launch
from pyppeteer.launcher import connect
async def main():
browser = await launch()
context = await browser.createIncognitoBrowserContext()
page = await context.newPage()
page.on('dialog', lambda dialog: dialog.dismiss())
# await page.emulateMedia('print')
await page.goto('http://getemoji.com/')
await page.screenshot({'path': 'example.png'})
await context.close()
await browser.disconnect()
asyncio.get_event_loop().run_until_complete(main())
And it generates properly the following image:
But if I try to convert the page into PDF, like this:
await page.pdf({
'path': 'example.pdf',
'format': 'A4'
})
All the emoticons are greyed in the resulting PDF, like this:
The issue is not a font issue with the emoji, since they work perfectly on the screenshot. It's something related to how the PDF is generated, but I can't find out why.
I'm hoping you'll find it :)