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

SVG rendering failure in pdf #150

Open
abby-cyber opened this issue Apr 23, 2024 · 1 comment
Open

SVG rendering failure in pdf #150

abby-cyber opened this issue Apr 23, 2024 · 1 comment

Comments

@abby-cyber
Copy link

abby-cyber commented Apr 23, 2024

On the website, SVG can be rendered normally,
image
but in pdf, css rendering loses.
image

Configurations in materials for mkdocs:

plugins:
  - with-pdf:
      cover_subtitle: test     
      cover: true
      back_cover: true
      copyright: Copyright © Abby.huang -  All rights reserved.
      # cover_logo: 'https://cloud-cdn.nebula-graph.com.cn/nebula-for-pdf.png'
      output_path: pdf/abby.pdf

CSS content:

.railroad-diagram-output dt:first-child {
  margin-top: 0
}

.railroad-diagram-output dt:after {
  font-weight: 400;
  content: " ::="
}

.railroad-diagram-output dd {
  margin: 0 0 16px;
  padding: 0 16px;
  overflow-x: auto;
  overflow-y: hidden
}

.railroad-diagram-output path {
  fill: none;
  stroke-width: 1;
  stroke: #0e2336
}

.railroad-diagram-output text {
  font: 10px Verdana, sans-serif;
  text-anchor: middle
}

.railroad-diagram-output rect {
  fill: #b0cbed;
  stroke-width: 1;
  stroke: #0e2336
}

.railroad-diagram-output .start-end {
  fill: #0e2336
}

.railroad-diagram-output .terminal rect {
  fill: #d0e2f3
}

.railroad-diagram-output .terminal text {
  font-weight: 700
}

How can I fix it?

@abby-cyber abby-cyber changed the title SVG rendering failure SVG rendering failure in pdf Apr 23, 2024
@jvleminc
Copy link

jvleminc commented Oct 1, 2024

Yep, we had the same issue. In the end I converted the svg to png and moved on.

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

No branches or pull requests

2 participants