asciidoctor / asciidoctorj-pdf

AsciidoctorJ PDF bundles the Asciidoctor PDF RubyGem (asciidoctor-pdf) so it can be loaded into the JVM using JRuby.
Apache License 2.0
36 stars 17 forks source link

Icons are represented as [icon name] in PDF output #51

Closed iXo closed 3 years ago

iXo commented 3 years ago

Hi, I am new to asciidoctor, and I am trying to generate a PDF via asciidoctorj and asciidoctorj-pdf

I need to put icons inline in the document, but so far I didn't manage to do it, it always result in a text name of icon surrounded by [ ]

I am using asciidoctor like that :

` final Asciidoctor asciidoctor = Asciidoctor.Factory.create();

    final Attributes attributes = new Attributes();

    final Options options = new Options();
    options.setInPlace(true);
    options.setBackend("pdf");
    options.setAttributes(attributes);
    options.setToFile("report.pdf");

    asciidoctor.convert(..., options);`

Nothing more, my maven dependencies is like that :

`

org.asciidoctor
        <artifactId>asciidoctorj</artifactId>
        <version>2.4.3</version>
    </dependency>
    <dependency>
        <groupId>org.asciidoctor</groupId>
        <artifactId>asciidoctorj-pdf</artifactId>
        <version>1.5.4</version>
    </dependency>`

My preambule is using :icons: font

robertpanzer commented 3 years ago

I can confirm that I am seeing the same. I will check what is going on.

robertpanzer commented 3 years ago

I am also stumbling over this every time. Please make sure to set the safe option to unsafe:

options.setSafe(SafeMode.UNSAFE);

Then it should work.

iXo commented 3 years ago

Thanks, indeed using unsafe mode works.

robertpanzer commented 3 years ago

Thanks for the feedback! :+1: