python_pptx_interface
python_pptx_interface copied to clipboard
remove_unpopulated_shapes is it good to use
@natter1
- ReadMe says further testing is needed for remove_unpopulated_shapes. Are we good to use it. Is there any possible issues that can occur
- Is there any functions or comtype function in the repo other than remove_unpopulated_shapes to optimize the file size of the pptx
- Does remove_unpopulated_shapes uses any comtype function to optimize the file size of the pptx
- this line
# if shape.is_placeholder and shape.text_frame.text == "":
is commented in remove_unpopulated_shapes. Can we use this line
1.) I don't think it saves a lot of space to remove unpopulated shapes. As I create my pptx-files completly inside a script, its already reproducible and easy to copy formats. So I don't need the unpopulated shapes. So far I had no issues with removing them. On the other hand, when you want to change an existing pptx, the default shapes can help to identify parts in a presentation. Also, if you want to insert a slide from one presentation in another with different master layout, the layout would automatically fit correctly, because PowerPoint knows about its default shapes. Provided, the creator of the pptx-file used them properly, and the same is true for the template-file. So far I haven't seen anyone, who truly uses them in the way they are meant to.
2.) comtype is just a remote control for PowerPoint. So the question is, are there ways inside PowerPoint to reduce the file size? There might be some image compression settings. But if you use a script to place images in a pptx, it might be easier to compress them before putting them in a pptx.
4.) Not sure what was the idea behind this. The way it is implemented right now seems to works for all those visible empty shapes.