MCPcopy Create free account
hub / github.com/SpaceZephyr/myskill / validateDimensions

Function validateDimensions

pptx/scripts/html2pptx.js:69–86  ·  view source on GitHub ↗
(bodyDimensions, pres)

Source from the content-addressed store, hash-verified

67
68// Helper: Validate dimensions match presentation layout
69function validateDimensions(bodyDimensions, pres) {
70 const errors = [];
71 const widthInches = bodyDimensions.width / PX_PER_IN;
72 const heightInches = bodyDimensions.height / PX_PER_IN;
73
74 if (pres.presLayout) {
75 const layoutWidth = pres.presLayout.width / EMU_PER_IN;
76 const layoutHeight = pres.presLayout.height / EMU_PER_IN;
77
78 if (Math.abs(layoutWidth - widthInches) > 0.1 || Math.abs(layoutHeight - heightInches) > 0.1) {
79 errors.push(
80 `HTML dimensions (${widthInches.toFixed(1)}" × ${heightInches.toFixed(1)}") ` +
81 `don't match presentation layout (${layoutWidth.toFixed(1)}" × ${layoutHeight.toFixed(1)}")`
82 );
83 }
84 }
85 return errors;
86}
87
88function validateTextBoxPosition(slideData, bodyDimensions) {
89 const errors = [];

Callers 1

html2pptxFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected