Closed Bruce337f closed 8 months ago
While you can't wrap text round images in md2pptx they can certainly co-exist, at least 2 ways:
The slide can have a title - which would be text.
You can have text blocks next to or above / below graphics. Look at contentSplit
and contentSplitDirection
metadata items (which can be dynamic). If the manual doesn't describe them well enough please open another issue.
There are some limitations with this - which it might be possible to relax. But definitely you can mix text and graphics (and tables) up to a point.
I'm using both the methods above in my work-related presentations (of which there are many).
So I'll research if backgrounds - in Powerpoint - can be one per page. If so I'll probably add a metadata item (and also make a dynamic counterpart).
If Powerpoint doesn't allow this then it'll have to be an image injected underneath all the other shapes. I would also preserve the aspect ratio of the image - which might make it not fill the space. (At this point all md2pptx image handling aims to preserve aspect ratios.)
It looks like a different background for each slide is doable in Powerpoint itself - as I just did it. 😀 I saved the .pptx and will examine its XML later. I don't know, though, if it will be feasible to do it in Python.
(I can't rush this - over the next few days.)
Looks like python-pptx can set a slide background colour / pattern - but not a background image.
So the solution will have to be adding a picture at the back.
Candidate syntax for static metadata:
backgroundImage: myfile.png
Candidate syntax for static metadata:
<!--md2pptx: backgroundImage: thisSlidesBackground.png -->
and there would be special values, as so often is the case of pres
, default
, prev
.
On the question of contentSplit
and contentSplitDirection
I've added Issue 149 to hopefully improve that aspect of the documentation with some example graphics.
branch backgroundImage
created.
Thanks for your reply and update!
Here, the creation of pptx through code customization has been further deepened. Now the appearance of ppt can be more beautiful.
This is a good project! !
I've reopened as I haven't actually written the code yet. This is an enhancement that - if successful - people will like.
Delivered in v4.2.
I figured out the XML to create real PowerPoint slide background images so I released v4.2.1 with this in.
And how to achieve the coexistence of images and text, such as text contain images?