[feature] Transparent or white background on export (#565)
Co-authored-by: sb <sb@example.com>
This commit is contained in:
parent
da4d566bd8
commit
bb8cfab474
1 changed files with 5 additions and 0 deletions
|
@ -74,6 +74,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
|||
app.selectAll()
|
||||
app.zoomToSelection()
|
||||
app.selectNone()
|
||||
const tlContainer = document.getElementsByClassName('tl-container').item(0) as HTMLElement;
|
||||
if (tlContainer) {
|
||||
tlContainer.style.background = 'transparent';
|
||||
}
|
||||
} catch (e) {
|
||||
err = e.message
|
||||
}
|
||||
|
@ -83,6 +87,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
|||
}
|
||||
const imageBuffer = await page.screenshot({
|
||||
type,
|
||||
omitBackground: true
|
||||
})
|
||||
await browser.close()
|
||||
res.status(200).send(imageBuffer)
|
||||
|
|
Loading…
Reference in a new issue