Re: How to get rid of border around SVG images
Posted by
mojavelinux on
Oct 23, 2020; 11:36pm
URL: https://discuss.asciidoctor.org/How-to-get-rid-of-border-around-SVG-images-tp8284p8285.html
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
--