-
Notifications
You must be signed in to change notification settings - Fork 1
Rendering Other Shapes 1
Chances are you might want to use a shape that's not supported yet. Checkout the changing list of supported elements to see what we support out of the box.
In this example, we'll build the shape renderer for an Octagon.
- Drag an Octagon shape onto your powerpoint slide and save the slideshow
- Run the following
airppt
CLI command. You will add an--element
parameter that prints DEBUG output to understand the powerpoint shape
airppt --input {slideshowpath} --slide {slideNumber} --element
-
Copy the JSON output and paste into a JSON Editor. This will make it easier to understand. Paste the JSON and click the ▶ arrow to parse the output.
-
You will see an attribute labeled
PowerpointElements
- this is a list of the all the PowerpointElements on a slide. The definitions for a powerpoint Element class can be found here. -
Find the element that corresponds to the Octagon, you'll realize that the ShapeType has already been prefilled according to the preset ppt shapes.
-
Expand the
elementPosition
andelementOffsetPosition
values. Powerpoints provides coordinates as EMU coordinates, you will need to keep this in mind when we write our renderer. -
Expand the
raw
attribute. This shows the powerpoint element directly translated from XML. When the parsed output such asfill
orfont
don't make sense, it's a good idea to check the raw output to see the original Powerpoint element.
You can checkout the PowerpointElement
interface here to learn more.
You are now ready to write a renderer to convert a PPT Octagon to HTMl.
Go to the next page ss