Sparticuz / chromium

Chromium (x86-64) for Serverless Platforms
MIT License
1.03k stars 71 forks source link

chromium.font isn't working as expected [BUG] #232

Closed GledachevY closed 9 months ago

GledachevY commented 9 months ago

Description

The bug happened after migrationg from node 16 to node 20, puppeteer 21.0.0 to puppeteer 22.0.0 and sparticuz/chromium 115.0.0 to sparticuz/chromium 121.0.0. Before that the font was loaded and used without any problems

Environment

Expected Behavior

when using await chromium.font() the font should be loaded

Current Behavior

The font isn't loaded

Steps to Reproduce

await chromium.font('url to otf file in S3 bucket')

const browser = await api.aws.createBrowser() const page = await browser.newPage() await page.setContent(html, { waitUntil: 'networkidle2' }) const buffer = await page.pdf({ format: 'A4', displayHeaderFooter: true, margin: { top: '80px', bottom: '70px', left: '40px', right: '40px', } })

let base64 = btoa(buffer)

GledachevY commented 9 months ago

The bug is not fixed in version 122.0.0