Reputation: 11
Need help. I am using PptxGenJs library. I want to convert Html pixels to Ppt inches, I tried slide methods.
Sample code:
slide.addText('some message', {
x: 1,
y: 1,
w: 10,
h: 3
});
what does mean 'x: 1, y: 1' and 'w: 10, h: 3'?
Upvotes: 1
Views: 182
Reputation: 359
PowerPoint thinks in "paper pages" dimensions so those are inches.
You can safely convert from pixels in inches in pptx by dividing with 96. If your image has 960px wide it will be 960/96 10inches so you put w: 10. PPTXGenJS will try to maintain ratio with sizing: {} options but you need to put those w/h of the image to work.
For x,y these are in inches too and are the position on the page you could do the same conversion.
Upvotes: 1