PDF Export
Swarm QA can generate formatted PDF reports for individual runs and aggregate multi-run summaries. Reports are rendered natively using Electron's printToPDF API with no external dependencies.
Single Run Report
Generate a PDF for any completed scan from the History tab by clicking Export PDF. The report includes:
| Section | Content |
|---|---|
| Header | Target URL, scan date, preset used, total duration |
| Score Summary | Quality score with color indicator, trend arrow, comparison to previous run |
| Findings Table | All findings grouped by severity, with agent name, check type, URL, and evidence |
| AI Analysis | Root cause, business impact, and suggested action for each enriched finding |
| Agent Summary | Per-agent breakdown: checks performed, findings count, execution time |
| Screenshots | Page captures (when screenshot mode was enabled during the scan) |
INFO
Reports use an A4 portrait layout with xyva branding. Page breaks are inserted between major sections to ensure clean printing.
Aggregate Report
Select multiple runs from the History tab and click Export Aggregate PDF to generate a trend report:
- Score trend chart — line graph showing score progression over selected runs.
- Finding trend — stacked bar chart of findings by severity per run.
- Recurring issues — findings that appear in every selected run, sorted by severity.
- Resolved issues — findings present in earlier runs but absent in the latest.
- Summary statistics — average score, total unique findings, most common agent triggers.
TIP
Aggregate reports are ideal for sprint reviews or monthly quality summaries. Select the last 4 weekly scans to show stakeholders the quality trajectory.
AI Analysis Inclusion
When AI enrichment was enabled during the scan, the PDF includes the enrichment data (root cause, business impact, suggested action) alongside each finding. If enrichment was disabled, these fields are omitted and the report shows raw findings only.
Technical Details
- Rendering engine: Electron's
BrowserWindow.webContents.printToPDF(). - Template system: HTML templates in
pdf-templates.tsare populated with run data and rendered in a hidden BrowserWindow. - No external dependencies: No Puppeteer, no wkhtmltopdf, no network calls. Everything runs locally.
- File size: Typical single-run reports are 200-500 KB. Reports with many screenshots can reach 5-10 MB.
// Core export flow (simplified)
const html = renderTemplate(runData, findings, enrichment);
const win = new BrowserWindow({ show: false });
win.loadURL(`data:text/html,${encodeURIComponent(html)}`);
const pdf = await win.webContents.printToPDF({ pageSize: 'A4' });
await writeFile(outputPath, pdf);WARNING
PDF generation happens in the main Electron process. Very large reports (50+ pages of screenshots) may take several seconds. A progress indicator is shown during generation.
