How to add straight line shape non width or height in PowerPoint .ShapeCollection Api

Hosshan 1 Reputation point
2022-05-06T06:38:57.127+00:00

I'm using PowerPoint.ShapeCollection addLine function.
But I'm having trouble drawing parallel lines.

Because addLine's ShapeAddOptions width or height set 0 to recognized as having no value specified.

const newShape1 = shapes.addLine(PowerPoint.ConnectorType.straight, {  
            left: 100 + shapeWidth + lineWidth / 2,  
            top: 100 + shapeHeight / 2,  
            width: 1,  
            height: 0,  
          });  

https://learn.microsoft.com/en-us/javascript/api/powerpoint/powerpoint.shapecollection?view=powerpoint-js-preview#powerpoint-powerpoint-shapecollection-addgeometricshape-member

JavaScript API
JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
883 questions
PowerPoint Management
PowerPoint Management
PowerPoint: A family of Microsoft presentation graphics products that offer tools for creating presentations and adding graphic effects like multimedia objects and special effects with text.Management: The act or process of organizing, handling, directing or controlling something.
222 questions
{count} votes