Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embed text when exporting in svg file format #100

Open
JWA74 opened this issue Jun 13, 2024 · 4 comments
Open

Embed text when exporting in svg file format #100

JWA74 opened this issue Jun 13, 2024 · 4 comments
Labels
feature-request New feature or request

Comments

@JWA74
Copy link

JWA74 commented Jun 13, 2024

sphinxcontrib-drawio is an excellent tool, extremely handy when creating images etcetera for documentation. We use Sphinx since it allows us to create documents in different formats using the same source code (*.rst files).

Discovered a minor issue, when exporting images in svg format they look fine in documents exported as HTML whereas the very same images in documents exported as PDF will have a small text stating “Text is not SVG – cannot display”. When exporting images manually from draw.io in svg format and then using those when creating the PDF works fine.

We use simplepdf to create PDF files from .rst source files.

It is not clear to me what settings are used in sphinxcontrib-drawio when exporting in svg format but the only thing I can think of that might cause this is that images and text are not embedded when exporting? Would it be possible to add such a feature?

image

How it looks in the PDF file when using sphinxcontrib-drawio.

image

How it looks like in the PDF file when exporting images manually in draw.io and then include those images in the rst files.

image

@JWA74 JWA74 added the feature-request New feature or request label Jun 13, 2024
@jdillard
Copy link
Collaborator

Thanks for the detailed description! It might help to add an example .drawio file so that someone can use that to troubleshoot.

@ItayZiv
Copy link
Contributor

ItayZiv commented Jun 16, 2024

Generally the SVGs exported by draw.io are meant for web embedding, there are some workaround that can be done.
But it has been a while since I touched this project so I need to take some time to remember how it works.

https://www.drawio.com/doc/faq/svg-export-text-problems
Explains the problem and how to workaround it (for now you can try the 2nd option to disable formatted text and word wrap)

@JWA74
Copy link
Author

JWA74 commented Jun 17, 2024

Generally the SVGs exported by draw.io are meant for web embedding, there are some workaround that can be done. But it has been a while since I touched this project so I need to take some time to remember how it works.

https://www.drawio.com/doc/faq/svg-export-text-problems Explains the problem and how to workaround it (for now you can try the 2nd option to disable formatted text and word wrap)

I will give it a try and keep update you all, thanks!

@JWA74
Copy link
Author

JWA74 commented Jun 18, 2024

Works fine, I also added some if-builder statements that allows me to generate svg files for HTML documentation and png files for PDF documents from the same source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants