【问题标题】:Asciidoctor convert multiple adocs to a pdfAsciidoctor 将多个 adocs 转换为 pdf
【发布时间】:2016-06-30 10:08:53
【问题描述】:

我在测试方法中使用 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 版

【问题讨论】:

    标签: java asciidoctor asciidoctor-pdf


    【解决方案1】:

    为什么不:

    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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-08-19
      • 2019-01-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-15
      相关资源
      最近更新 更多