What unit is width and height from presLayout? #1216
Answered
by
AndreasNasman
AndreasNasman
asked this question in
Q&A
-
Hi! I'm wondering what units In the example picture below, const pixelWidth = 1170;
const pixelHeight = 658;
const ppi = 96;
const height = pixelHeight / ppi; // inches
const width = pixelWdith / ppi; // inches
presentation.defineLayout({
height,
width,
}) |
Beta Was this translation helpful? Give feedback.
Answered by
AndreasNasman
Jan 31, 2023
Replies: 1 comment
-
Found the answer by checking the source. The unit is EMU (English Metric Units) and you can convert it to inches by dividing by const EMU = 914400;
const inchWidth = presentation.presLayout.width / EMU;
console.log(inchWidth); // 10 (the default layout width in inches: https://gitbrent.github.io/PptxGenJS/docs/usage-pres-options/#standard-slide-layouts) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
AndreasNasman
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Found the answer by checking the source. The unit is EMU (English Metric Units) and you can convert it to inches by dividing by
914400
.