How to use border for specific and inline images in pdf?

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

How to use border for specific and inline images in pdf?

cwempe
I found out I can add a border by adding some definitions in my theme.
https://github.com/asciidoctor/asciidoctor-pdf/blob/main/docs/theming-guide.adoc#image

Like :
image:
  border-color: cccccc
  border-width: 3

But this creates borders to all block images, I think.

So how can I apply borders to only specific images?
How can I add the same border to inline images?
Is this even possible?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: How to use border for specific and inline images in pdf?

mojavelinux
Administrator
You can disable the border per image by adding the noborder role to the macro.

[.noborder]
image::image-without-border.png[]

The converter does not support adding borders to inline images. In theory, you could define an inline role that defines a border, then wrap that around the image:

[.border]#image:image-with-border.png[]#

However, there is something currently preventing that from working properly. It works for text, but not for an inline image. Feel free to file an issue for that case to be supported.

-Dan

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