Documentation for available object properties missing

246 views
Skip to first unread message

jorawebdev zElement

unread,
Jul 23, 2013, 12:33:13 PM7/23/13
to node-of...@googlegroups.com
It would be great to have a comprehensive list (or a link to an outside resource) for a list of available object properties. For example, working on pptx I was unable to find all available properties of the slide.addShape() method such as 'ellipse' or 'shape: "roundRect"' or how to draw a border. Thank you!

Ziv Barber

unread,
Jul 23, 2013, 8:04:52 PM7/23/13
to node-of...@googlegroups.com
I do need to update the documentation.
Please check also the example code in examples/make_pptx.js

Interesting properties for both addShape and addText:

'color' - declaring the color for the text itself.
'fill' - declaring the color of the background.
'line' - right now declaring the color of the border line.

cy - vertical size of the object
cx - horizontal size of the object
y - vertical position
x - horizontal position

You can use '%' for cy and cx when 100% = the total size of the slide.
To center your object in either vertical or horizontal, pass 'c' as either 'y' or 'x'.

As for drawing lines:

line_head - the shape of the arrow on the "head" point of the line. Example: "triangle" or "stealth".
line_tail - the shape of the arrow on the "tail" point of the line.
flip_vertical: true - use this to flip the line vertical. For example to draw a line from bottom-left to top-right instead of the normal top-left to bottom-right.
The 'line' property effecting the color of the line.

Please note that ALL the color properties can be either a string to just enter the color code (for example "ffffff" for white color) or an object which will allow in future versions to support all the color options of PowerPoint and not just solid color.

Right now the only supported color option when passing object as the color:
{ type: 'solid', color: '<color code>' }

addImage supporting jpeg, gif, bmp, png and should support also all the image formats supported by Office but I didn't checked it yet.

A new method called addSP will support more then one paragraph in a single text object. This feature is needed to support lists, etc.

As for placing graphs inside PPTX:

Right now you can draw it yourself using addShape/addText but I'm going to allow using embedded Excel files (this is how PowerPoint really implementing graphs).

I'm also designing another way to use Officegen instead of calling the API directly - more on that later.

Ziv Barber

unread,
Jul 24, 2013, 8:10:55 AM7/24/13
to node-of...@googlegroups.com
 Version 0.1.11 will include better documentations. I just finished to add it.
Reply all
Reply to author
Forward
0 new messages