Keep the presentation of loop-claude, with the script that prints it to PDF and what writing it settled
CI / tests (pull_request) Successful in 2m15s
CI / tests (pull_request) Successful in 2m15s
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
// Print /work/page.html to /work/out.pdf with Chromium, as build-pdf.sh runs it inside the playwright-for-claude image.
|
||||
const { chromium } = require('/app/node_modules/playwright');
|
||||
|
||||
(async () => {
|
||||
const browser = await chromium.launch({ args: ['--no-sandbox', '--disable-dev-shm-usage'] });
|
||||
const page = await browser.newPage({ viewport: { width: 1100, height: 1400 } });
|
||||
// networkidle waits for the Google Fonts the page loads; fonts.ready waits for them to apply.
|
||||
await page.goto('file:///work/page.html', { waitUntil: 'networkidle' });
|
||||
await page.evaluate(() => document.fonts.ready);
|
||||
await page.emulateMedia({ media: 'print' });
|
||||
// preferCSSPageSize takes the page's own @page rule: A4 landscape.
|
||||
await page.pdf({ path: '/work/out.pdf', format: 'A4', printBackground: true, preferCSSPageSize: true });
|
||||
await browser.close();
|
||||
})();
|
||||
Reference in New Issue
Block a user