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

adds a workaround for inline svg and WeasyPrint #120

Merged
merged 3 commits into from
Nov 26, 2020
Merged

adds a workaround for inline svg and WeasyPrint #120

merged 3 commits into from
Nov 26, 2020

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 as a code owner 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