Reference
Validation
Content, layout, package structure, and visual comparison are checked separately. Passing one does not imply passing the others.
Layout rules
validateLayout(page, options) checks rendered slides in Chromium. Errors block export; warnings are reported.
| Rule | Severity | Checks |
|---|---|---|
| dimensions | error | Slide box differs from the canvas |
| boundaries | error | Content extends beyond the slide |
| overflow | error | Clipped or scrolling content |
| images | error | Missing or undecodable images |
| fonts | warning | First named text font is unavailable |
| overlap | warning | Visible text or media boxes intersect |
PPTX structure
validatePptx(data) performs offline ZIP and XML checks: required parts, relationships, content types, slide references, and dimensions. It is not full OOXML schema validation or an Office acceptance test.
{
"valid": true,
"slideCount": 6,
"editableTextCount": 35,
"shapeCount": 52,
"issues": []
}
Optional visual comparison
comparePresentation renders the PPTX with LibreOffice Impress and Poppler, captures the source slides, and writes per-slide difference reports. Both tools must be installed separately.
import { comparePresentation } from './dist/index.js';
const reports = await comparePresentation(
'presentation.html',
'presentation.pptx',
'review/comparison',
);
console.log(reports.map(report => report.differenceRatio));