-
Notifications
You must be signed in to change notification settings - Fork 55
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
Support referenced SVG images #137
Comments
Hi, it is supported with the file:// scheme but you’ll need to enable it
and use a full URL. See readme for details.
…On Sat, 12 Jun 2021 at 7:41 AM, Christoph Wempe ***@***.***> wrote:
I am using asciidoctor to create PDFs.
I created an SVG file for the title page of my document.
This SVG file has two other images referenced like this:
<image
preserveAspectRatio="none"
inkscape:svg-dpi="512"
width="33.599998"
height="33.599998"
style="image-rendering:optimizeQuality"
xlink:href="my_image.svg"
id="image8061"
x="23.083784"
y="239.09735" />
This does not work because prawn-svg does not support linked SVG files in
a SVG file.
It works when I change it to PNG.
xlink:href="my_image.png"
It would be great if prawn-svg would support this.
I initially created an issue here: asciidoctor/asciidoctor-pdf#1937
<asciidoctor/asciidoctor-pdf#1937>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#137>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAFUXLSH3C5KU2SG3QFWY3TSJRGLANCNFSM46RLTMGA>
.
|
Interesting. I was not aware of that. I suppose it would be possible in Asciidoctor PDF to rewrite the target automatically. Is there a reason that the relative path cannot be supported? Just curious. |
Oh, apologies. You were referring to it not supporting svg files. That’s
correct. I don’t have any plans to implement this but you’re welcome to
contribute.
…On Sat, 12 Jun 2021 at 7:41 AM, Christoph Wempe ***@***.***> wrote:
I am using asciidoctor to create PDFs.
I created an SVG file for the title page of my document.
This SVG file has two other images referenced like this:
<image
preserveAspectRatio="none"
inkscape:svg-dpi="512"
width="33.599998"
height="33.599998"
style="image-rendering:optimizeQuality"
xlink:href="my_image.svg"
id="image8061"
x="23.083784"
y="239.09735" />
This does not work because prawn-svg does not support linked SVG files in
a SVG file.
It works when I change it to PNG.
xlink:href="my_image.png"
It would be great if prawn-svg would support this.
I initially created an issue here: asciidoctor/asciidoctor-pdf#1937
<asciidoctor/asciidoctor-pdf#1937>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#137>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAFUXLSH3C5KU2SG3QFWY3TSJRGLANCNFSM46RLTMGA>
.
|
Apparently I can’t remember my own code. It does in fact support refs
without the file: schema specified! The problem here is it doesn’t support
svg images. Serves me right for replying to emails when I’ve just woken up.
…On Sat, 12 Jun 2021 at 7:46 AM, Dan Allen ***@***.***> wrote:
Interesting. I was not aware of that. I suppose it would be possible in
Asciidoctor PDF to rewrite the target automatically.
Is there a reason that the relative path cannot be supported? Just curious.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#137 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAFUXJFAUGIBV7B55XJP6DTSJRZFANCNFSM46RLTMGA>
.
|
I'll see if someone in the community is available to contribute. |
I would need this feature too since asciidoctor-diagram (with graphviz) generates this syntax when you use an SVG for a node. I am not a Ruby programmer, but I think instead of skipping the element it should be replaced with the raw SVG code. prawn-svg/lib/prawn/svg/elements/image.rb Line 75 in e085b1d
|
Sadly it's not that straight forward @Alwinator. The SVG has its own context and view box; things that happen in the main SVG shouldn't affect things in the embedded SVG, and it has to be scaled correctly. It shouldn't be super hard to implement, but it's definitely not as simple as just copying the SVG code inline. |
A couple years late but better late than never :) |
I am using asciidoctor to create PDFs.
I created an SVG file for the title page of my document.
This SVG file has two other images referenced like this:
This does not work because
prawn-svg
does not support linked SVG files in a SVG file.It works when I change it to PNG.
It would be great if
prawn-svg
would support this.I initially created an issue here: asciidoctor/asciidoctor-pdf#1937
The text was updated successfully, but these errors were encountered: