How to get rid of border around SVG images

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to get rid of border around SVG images

siddjain
Hello

Here is an SVG image: https://gist.github.com/siddjain/4c78da162319a26cd66991617bf62aeb

Save the gist as test.svg. Then write a file test.adoc that is simply

image::test.svg[]

Convert the adoc to PDF using asciidoctorpdf.

Observed: There is a black border around the image



Expected: No black border. Below is the image when I open it in chrome



How can I get the expected behavior?

I am using asciidoctor/docker-asciidoctor:1.2.0 which in turn uses asciidoctor-pdf 1.5.3

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: How to get rid of border around SVG images

mojavelinux
Administrator
Asciidoctor PDF doesn't add a border around images (unless you tell it to via the theme).

It's prawn-svg that is adding this border. It's being triggered by this line:

<polygon fill="white" stroke="transparent" points="-4,4 -4,-403 220,-403 220,4 -4,4"/>

It seems like prawn-svg is not understanding "transparent" as a stroke value and instead making the stroke black. I recommend reporting this to prawn-svg.

Best Regards,

-Dan

On Fri, Oct 23, 2020 at 4:43 PM siddjain [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hello

Here is an SVG image: https://gist.github.com/siddjain/4c78da162319a26cd66991617bf62aeb

Save the gist as test.svg. Then write a file test.adoc that is simply

image::test.svg[]

Convert the adoc to PDF using asciidoctorpdf.

Observed: There is a black border around the image



Expected: No black border. Below is the image when I open it in chrome



How can I get the expected behavior?

I am using asciidoctor/docker-asciidoctor:1.2.0 which in turn uses asciidoctor-pdf 1.5.3

Thanks


If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/How-to-get-rid-of-border-around-SVG-images-tp8284.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen (he, him, his) | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: How to get rid of border around SVG images

siddjain
Could you help me fix this? Is there anything I can do to the files that come with asciidoctor/docker-asciidoctor:1.2.0 that will fix this?  the border looks extremely ugly.
Reply | Threaded
Open this post in threaded view
|

Re: How to get rid of border around SVG images

mojavelinux
Administrator
You can find the answer in this thread: https://github.com/mogest/prawn-svg/issues/128

-Dan

On Sat, Oct 24, 2020 at 10:23 AM siddjain [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Could you help me fix this? Is there anything I can do to the files that come with asciidoctor/docker-asciidoctor:1.2.0 that will fix this?  the border looks extremely ugly.


If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/How-to-get-rid-of-border-around-SVG-images-tp8284p8287.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen (he, him, his) | @mojavelinux | https://twitter.com/mojavelinux