Skip to content

adds a workaround for inline svg and WeasyPrint#120

Merged
y0urself merged 3 commits intogreenbone:masterfrom
nichtsfrei:add_inline_svg
Nov 26, 2020
Merged

adds a workaround for inline svg and WeasyPrint#120
y0urself merged 3 commits intogreenbone:masterfrom
nichtsfrei:add_inline_svg

Conversation

@nichtsfrei
Copy link
Member

What:

Unfortunately WeasyPrint does not support inline svg at all, since we
need that functionality to create pictures dynamically based on
report-formats.

This workaround does look for tags with svg and then creates an img
element with base64 image content of that.

We are painfully aware that we lose css information with that method,
but the conclusion is that it is better to may define design element twice
(in the svg and in css) than to not have this possibility at all.

Why:

How:

Create an pdf-report template with svg content in it. Create a pdf and verify that the svg is displayed.

Checklist:

Unfortunately WeasyPrint does not support inline svg at all, since we
need that functionality to create pictures dynamically based on
report-formats.

This workaround does look for tags with svg and then creates an img
element with base64 image content of that.

We are painfully aware that we lose css information with that method,
but the conclusion is that it is better to may define design element twice
(in the svg and in css) than to not have this possibility at all.
@nichtsfrei nichtsfrei requested a review from a team November 26, 2020 10:33
@y0urself y0urself merged commit 54b7d1e into greenbone:master Nov 26, 2020
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