Base64 encoded images embedded in SVGs are not supported in DOCX or MS Word
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 56.1k
- Forks
- 1.7k
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 22
Description
As of now, when including either raster or vector images into a document, and exporting to SVG format, typst always encodes the embedded images to base64.
While that's necessary for rasters, vectors could be embedded raw, without base64 encoding, and therefore would be loadable by Microsoft Word.
There was a recent PR implementing raw SVG embedding that was halted due to security concerns: #6814
And the related issue: #6812
I would propose to maybe put raw embedding behind a compiler flag, as to keep the more secure behavior as default, while still allowing Typst to produce fully MS Word-compatible SVGs.
Source about b64 embeds incompatibility with MS Word: https://learn.microsoft.com/en-us/answers/questions/1324557/is-word-document-read-base64-image-format?hl=it-IT
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the halted raw SVG embedding PR #6814 and related issue #6812, then trace the SVG export behavior described here. Done means producing SVGs that Microsoft Word can load while retaining the secure default behavior, with any opt-in compiler flag defined clearly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100