Skip to content

Commit

Permalink
feat: [Contracts] Configure puppeteer to run headless
Browse files Browse the repository at this point in the history
  • Loading branch information
radulescuandrew committed Aug 29, 2024
1 parent b74e939 commit afbb429
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/src/common/helpers/pdf-from-html.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import puppeteer from 'puppeteer';

export const HTMLtoPDF = async (html: string): Promise<Uint8Array> => {
const browser = await puppeteer.launch();
const browser = await puppeteer.launch({
headless: true,
args: ['--no-sandbox', '--disable-setuid-sandbox'],
});
const page = await browser.newPage();
await page.setContent(html);
const buffer = await page.pdf({ format: 'A4' });
Expand Down

0 comments on commit afbb429

Please sign in to comment.