0

我在测试方法中使用 asciidoctorj 来生成我的 pdf

@Test
public void bAdocToPdf() throws Exception {

    Asciidoctor asciidoctor = create();
    Options options = new Options();

    options.setBackend("pdf");
    String[] result = asciidoctor.convertDirectory(new AsciiDocDirectoryWalker("src/docs/generated"),options);


}

将为每个文件生成一个pdf,但我希望它们都在一个pdf中,我该怎么做?

我正在使用 asasciidoctorj 版本 1.5.4 和 asciidoctorj-pdf 版本 1.5.0-alpha.11

4

1 回答 1

2

为什么不:

1)在您的代码中编写(如果不是太长)或生成一个“MyUniqueDoc.adoc”文件,其中包含所有文件的一系列包含指令

= My unique doc

include::./src/docs/generated/filea.adoc[leveloffset=+1]
include::./src/docs/generated/fileb.adoc[leveloffset=+1]
etc

2) 从 MyUniqueDoc.adoc 生成一个独特的 pdf

于 2016-06-30T15:06:35.633 回答