-
Notifications
You must be signed in to change notification settings - Fork 500
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
Some text on svg image doesn't appear #430
Comments
Very likely you are hitting the scenario described in mogest/prawn-svg#77. A fix has been committed. We're waiting on a new release of prawn-svg. |
My previous comment was misleading. This seems to be a style inheritance bug in prawn-svg. The I can fix this by changing the |
Thx Dan, you're right. The text is there! I'm now using 'img' type as alternative for mermaid script. it's not so bad ;) |
We should still pursue this problem upstream. Would you be willing to create an issue in prawn-svg for it? |
Sure. But plz review it ;) I'll mention this issue on there. |
I have a similar problem with SVG files, but in my case it is a line decorator (svg attribute "marker-end") which is not drawn correctly. I have attached a minimal example (svg inside zip), created by OmniGraffle. I tried this svg with prawn-svg-0.25.1 and there it worked. Looks as if asciidoctor is still using an older version, that is prawn-svg-0.21.0, is that correct? So, when running
the arrow decorator is rendered correctly, with
and asciidoctor pdf Asciidoctor PDF 1.5.0.alpha.11 using Asciidoctor 1.5.4 the arrow decorator is gone. Unfortunately I'm not a ruby programmer, otherwise I would have tried asciidoctor-pdf with the latest prawn-svg version... Which version of prawn-svg is used by asciidoctor? |
Ah: When I enforce asciidoctor-pdf to use the prawn-svg 0.25.1 is is working. When will this be available in the installable asciidoctor-pdf version? |
I'm in the process of getting alpha.12 released. |
I've filed the bug regarding the text color upstream as mogest/prawn-svg#79. We'll have to wait for that to be resolved before it can be fixed in Asciidoctor PDF. |
This is working as of prawn-svg 0.29.1 and will be included in the next release. |
- fixes spacing around image when only viewBox is specified - also resolves asciidoctor#430 adds broader support for CSS
Hi @mojavelinux, I don't think this is solved. While it works great on
PDF embedding mermaid test.svg: mermaid test.svg opened in a browser: |
Please direct issues with SVG rendering to prawn-svg. Asciidoctor PDF
doesn't render SVG images itself. It just delegates to prawn-svg.
… |
Just in case anyone is reading this and doesn't want to dig through issues. This is because Mermaid (and Draw.io annoyingly) do test as an embedded HTML For example if you do this in Draw.io It will save this SVG:
And it comes out like this: As you can see it uses a I don't think any standard SVG to PDF converteds will be able to support I think the only solution (apart from improving Mermaid and Draw.io to output pure SVG) is to use headless Chrome to convert the SVG to PDF (something like this script). Unfortunately Asciidoctor doesn't support embedding PDFs as images - only as full pages - so you will then have to convert back to SVG. I haven't tried it yet though. |
Also related to: asciidoctor/asciidoctor-diagram#398 (comment) |
The name of each node on svg diagram doen't apear on pdf output like below.
It works well on html.
SVG file: mermaid test.zip
This SVG file is generated with asciidoctor-diagram.
The ource of mermaid diagram is on below.
The text was updated successfully, but these errors were encountered: