Open slo1958 opened 4 years ago
If you have a child element, try using object.element.insert_element_before().
It's in build\lib\pptx\oxml\xmlchemy.py as def insert_element_before.
def insert_element_before(self, elm, *tagnames):
successor = self.first_child_found_in(*tagnames)
if successor is not None:
successor.addprevious(elm)
else:
self.append(elm)
return elm
https://python-pptx.readthedocs.io/en/latest/dev/xmlchemy.html
If that doesn't work, I think you need to fork and write your own function.
Hi. I'm using the library to create drawings using shapes and elbow connectors. Those connectors appear as an horizontal line fragment, a vertical line fragment and another horizontal line fragment. By default, the vertical line fragment is at 50% distance between starting point and ending point.
Playing with msPowerpoint and checking the generated xml, I discovered that changes to the default setting are recorded under the tag, which is empty and appears as in the xml generated by python-pptx.
I would like to add a child element there, in order to get something like </a:avLst>
The current python-pptx api does not provide a direct way to alter the position of the intermediate line via a property or a function .
I do not ask to update the api, but just an example how to create the child element under
Thanks,