Skip to content

[BUG]: The SVG format is incompatible with PDF files because it requires external sources #421

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

Open
Michallote opened this issue Oct 28, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Michallote
Copy link

Issue description

test_sample.json

Whenever we use the SVG download option the files are created requiring external sources:

In the content of the SVG file:

<foreignObject width="100%" height="100%" x="0" y="0" externalResourcesRequired="true"> ...
url(&quot;http://localhost:8888/assets/cursor.svg&quot;)

(Yes this was built from the docker container, but issues persist when done from the website.)

Most if not all tools for converting between SVG and PDF warn about improper SVG formats:

$ inkscape -D ATG.svg  -o AircraftTreeGraph.pdf --export-latex
WARNING: unknown type: svg:foreignObject
WARNING: unknown type: svg:foreignObject
** Message: 22:32:29.473: CairoRenderer: empty bounding box.
Failed to save PS/EPS/PDF to: AircraftTreeGraph.pdf

Also tried rsvg-convert -f pdf -o t.pdf ATG.svg but it produces unrenderable PDFs

The size of the SVGs is substantialy larger than it should be...

Media & Screenshots

image

Operating system

  • OS: [e.g. PopOs! 22.04]:

  • Browser [e.g. docker, brave]:

  • Any other details...

Priority this issue should have

Medium (should be fixed soon)

@Michallote Michallote added the bug Something isn't working label Oct 28, 2024
@bwnbrg
Copy link

bwnbrg commented Mar 5, 2025

Is there any update on this? I'm experiencing the same bug.

Or any workarounds while a fix is being worked on?

@Michallote
Copy link
Author

What I was able to do was to use the print functionality (to PDF) from my browser. (Turning off backgrounds and other ui elements helps) and it at least produced the pdf with rendered text and icons, which was an ok compromise. At least it avoids .png pr .jpeg and was lighter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants