# Subject Key PDF Export Fix

The summative PDF export now includes a dedicated Subject Key appendix.

## Exported details

- Unit Code
- Unit Name
- Format: `Unit Code - Unit Name`

## Reports covered

- Unit Summative Marksheet PDF
- All-Units Class Summative Average PDF

## Behaviour

- The marks pages continue to show the relevant subject key near the report header.
- A dedicated Subject Key page is appended to every PDF download.
- All-units reports export the complete subject key, even when the marks matrix is split across several pages.
- Subject key records are deduplicated before export.
- Long unit names use the full landscape page width to minimise truncation.
- More than 22 subjects are automatically continued onto additional Subject Key pages.

## Validation

- All 168 PHP files passed PHP syntax validation.
- The PDF writer produced a valid PDF 1.4 document.
- A 30-unit test generated two Subject Key pages with unit codes and names successfully extractable from the PDF.
- Existing marksheet and transcript designs were not changed.
- No database migration is required.
