Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@allefeld
Copy link

@allefeld allefeld commented Jan 18, 2025

pptx2md has an option --disable-wmf, which however has no effect. The first commit is my (minimal) implementation, where the option leads to image embed code (![](file.wmf)) to be written to the output.

While there is to my knowledge no Markdown implementation which can actually embed WMF files, this serves as a placeholder to inform the user where the image is supposed to go. For my use, I will convert WMF files to SVG files using Inkscape and embed those, which works well with RevealJS output from Quarto.

After implementing the above, I noticed that the wmf files written by pptx2md cannot be read by Inkscape, because the file content is actually EMF (enhanced metafile). Apparently python-pptx has a bug (?) where shape.image.ext is wmf when it should be emf. In case of the PowerPoint file I worked with, the correct extension is in shape.image.filename. The second commit contains a fix based on that observation.

@allefeld allefeld changed the title Option --disable-wmf writes image embed code for wmf files Option --disable-wmf writes image embed code for wmf/emf files, and fix for writing emf files. Jan 18, 2025
@laelhalawani
Copy link

bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants