We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Example of the issue:
Code snippet:
try { const browser = await launchChromium({ headless: true }) const page = await browser.newPage({ viewport: { width: 868, height: 500, }, }) const nextURL = new URL(url) await page.goto(nextURL.toString()) const { getHeaderTemplate, getFooterTemplate, margin } = templates[type] const [headerTemplate, footerTemplate] = await Promise.all([ getHeaderTemplate(templateProps), getFooterTemplate(templateProps), ]) const buffer = await page.pdf({ displayHeaderFooter: true, headerTemplate, footerTemplate, margin, printBackground: true, }) const compressed = zlib.gzipSync(buffer) const contentEncoding = 'gzip' const filename = 'filename.pdf' const s3Key = 'mykey/'.concat(filename) const contentType = 'application/pdf' const putObjectParams = { Bucket: s3Bucket, Key: `public/${s3Key}`, ContentType: contentType, ContentEncoding: contentEncoding, Body: compressed, } await Promise.all([s3.putObject(putObjectParams).promise(), browser.close()]) return { statusCode: 200, headers: defaultHeaders, body: { s3Key, filename, contentType, contentEncoding, }, } } catch (error) { console.error(error) return { statusCode: 500, headers: defaultHeaders, body: { error: error.message }, } }
Further explanation:
Help & Guidance please.
The text was updated successfully, but these errors were encountered:
@sh4nnongoh I've been able to work around the issue with this, hope it helps!
browser = await playwright.launchChromium({ args: [ ...playwright.getChromiumArgs(true), '--font-render-hinting=none' ] });
Seems to be a common chromium issue, found the solution on puppeteer puppeteer/puppeteer#2410
Sorry, something went wrong.
No branches or pull requests
Example of the issue:
Code snippet:
Further explanation:
Help & Guidance please.
The text was updated successfully, but these errors were encountered: