@ooxml-sanad/dml
v0.2.0
Published
DrawingML geometry, fills and effects to canvas primitives; VML fallback.
Readme
@ooxml-sanad/dml
DrawingML renderer: geometry evaluation, fills, effects, lines, images, and VML fallback.
Install
npm install @ooxml-sanad/dmlOverview
Converts DrawingML and VML elements into canvas-ready primitives:
- Geometry — Guide evaluation, path computation, preset shapes, transform matrices
- Fills — Solid, gradient, pattern, and picture fills
- Effects — Shadow, glow, reflection, soft edge
- Lines — Dash patterns, line endings, compound lines
- Images — Embed and clip raster images
- VML — Legacy VML shape rendering fallback
- Text body — DrawingML text frame layout
- Placeholders — Slide placeholder resolution
Usage
import { evaluateGeometry, renderFill } from '@ooxml-sanad/dml';
// Evaluate a preset shape or custom geometry:
const paths = evaluateGeometry('roundRect', { width: 200, height: 100 });
// Resolve DrawingML fill into a Canvas fill style:
const fillStyle = renderFill(fillProps, { x: 0, y: 0, width: 200, height: 100 }, ctx);License
MIT
