Skip to content

Conversation

@prog-klk1
Copy link

@prog-klk1 prog-klk1 commented May 15, 2025

Description

Summary

This PR introduces support for embedding SVG images in Word documents using PHPWord.

Svg Handling in \PhpWord\Element\Image

Added a bypass for SVG images to prevent default handling that is incompatible with the format.

New SVG Rendering Support in \PhpWord\Writer\Word2007\Element\Image

Implemented a dedicated method to process and insert SVG images correctly when generating Word 2007 documents.

Sample Usage

Added a new sample file Sample_47_SVG.php that demonstrates adding SVG images with and without styling (e.g., size, alignment, wrapping).

Resources

Included a sample SVG file (sample.svg) to support testing and documentation of this feature.

Fixes #1746

I'm looking for help setting up proper unit tests for this new SVG handling behavior. Any suggestions would be greatly appreciated.

Actively looking for feedback.

Checklist:

  • My CI is mostly 🟢
  • I have covered by unit tests my new code (check build/coverage for coverage report)
  • I have updated the documentation to describe the changes
  • I have updated the changelog
@coveralls
Copy link

coveralls commented May 19, 2025

Coverage Status

coverage: 96.024% (-0.7%) from 96.767%
when pulling d888771 on prog-klk1:master
into 6ca8c9f on PHPOffice:master.

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

Labels

None yet

2 participants