private File configurePdfOutput() { this.options.setBackend("pdf"); File output = new File("build/output.pdf"); this.options.setToFile(output.getAbsolutePath()); return output; }
/** * Sets to file value. This toggles writing output to a file or returning output * as a string. If writing to a string, the header and footer are omitted from the * output by default. * * @param toFile * <code>true</code> to write output to a file, <code>false</code> * to write output to a string. * @return this instance. */ public OptionsBuilder toFile(boolean toFile) { this.options.setToFile(toFile); return this; }
/** * Sets to file value. This toggles writing output to a file or returning output * as a string. If writing to a string, the header and footer are omitted from the * output by default. * * @param toFile * <code>true</code> to write output to a file, <code>false</code> * to write output to a string. * @return this instance. */ public OptionsBuilder toFile(boolean toFile) { this.options.setToFile(toFile); return this; }
/** * Sets to file value. This is the destination file name. * * @param toFile * name of output file. * @return this instance. */ public OptionsBuilder toFile(File toFile) { this.options.setToFile(toFile.getPath()); return this; }
/** * Sets to file value. This is the destination file name. * @param toFile name of output file. * @return this instance. */ public OptionsBuilder toFile(File toFile) { this.options.setToFile(toFile.getPath()); return this; }
/** * Sets to file value. This is the destination file name. * * @param toFile * name of output file. * @return this instance. */ public OptionsBuilder toFile(File toFile) { this.options.setToFile(toFile.getPath()); return this; }
private List<InputStream> convertToInputStreams(List<File> source) throws IOException { List<InputStream> inputStreams = new ArrayList<>(); Asciidoctor asciidoctor = Factory.create(); ExtensionGroup group = asciidoctor.createGroup(); Preprocessor preprocessor = new Preprocessor(); group.preprocessor(preprocessor); Options options = new Options(); options.setToFile(false); options.setSafe(SafeMode.UNSAFE); group.register(); for (File file : source) { inputStreams.add(processSingleFile(file, asciidoctor, group, preprocessor, options)); } return inputStreams; }
options.setToFile(to_file); if (in_place != null) options.setInPlace(in_place);