Upload files to "pdf"

This commit is contained in:
2026-03-06 12:27:55 -06:00
parent 050bd55bc1
commit 740f328beb

View File

@@ -1,8 +1,9 @@
const puppeteer = require('puppeteer');
const buildHtml = require('./template');
const puppeteer = require('puppeteer-core');
const buildHtml = require('./template');
/**
* Renders the violation document HTML via Puppeteer and returns a PDF buffer.
* Uses the system Chromium installed in the Alpine image (no separate download).
* @param {object} violation - Row from violations JOIN employees
* @param {object} score - Row from active_cpas_scores
* @returns {Buffer}
@@ -26,8 +27,8 @@ async function generatePdf(violation, score) {
await page.setContent(html, { waitUntil: 'networkidle0' });
const pdf = await page.pdf({
format: 'Letter',
printBackground: true,
format: 'Letter',
printBackground: true,
margin: {
top: '0.6in',
bottom: '0.7in',