excel-builder-vanilla
Version:
An easy way of building Excel files with javascript
15 lines (14 loc) • 424 B
text/typescript
/**
* Converts pixel sizes to 'EMU's, which is what Open XML uses.
*
* @todo clean this up. Code borrowed from http://polymathprogrammer.com/2009/10/22/english-metric-units-and-open-xml/,
* but not sure that it's going to be as accurate as it needs to be.
*
* @param int pixels
* @returns int
*/
export class Positioning {
static pixelsToEMUs(pixels: number) {
return Math.round((pixels * 914400) / 96);
}
}