Package it.smartio.docs.fop
Class FoGenerator
- java.lang.Object
-
- it.smartio.docs.fop.FoGenerator
-
public class FoGenerator extends java.lang.ObjectTheFoGeneratorclass.
-
-
Constructor Summary
Constructors Constructor Description FoGenerator(java.io.File source)Constructs an instance ofFoGenerator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FoGeneratoraddProperties(java.util.Properties properties)Add properties to theFoGenerator.BookbuildBook()Build the markdown based book.voidgenerate()Build the markdown based book.protected java.io.InputStreamgetFoStream(Book book, FoContext config)Get the FOInputStream.FoGeneratorsetConfig(java.lang.String config)Sets the config directory.FoGeneratorsetDebug(boolean debug)Sets thetrueif the fo file will be generatedFoGeneratorsetFilename(java.lang.String name)Sets the filenameFoGeneratorsetName(java.lang.String name)Sets the filenameFoGeneratorsetTarget(java.io.File target)Sets the target directory.protected static voidwriteFo(Book book, FoContext config, java.io.Writer writer)Writes theBookto FO.protected static voidwritePdf(java.io.File file, java.io.InputStream source, org.apache.fop.apps.FopFactory factory)Writes the FO stream to PDF.
-
-
-
Constructor Detail
-
FoGenerator
public FoGenerator(java.io.File source)
Constructs an instance ofFoGenerator.- Parameters:
source-
-
-
Method Detail
-
addProperties
public final FoGenerator addProperties(java.util.Properties properties)
Add properties to theFoGenerator.- Parameters:
properties-
-
setName
public final FoGenerator setName(java.lang.String name)
Sets the filename
-
setFilename
public final FoGenerator setFilename(java.lang.String name)
Sets the filename
-
setConfig
public final FoGenerator setConfig(java.lang.String config)
Sets the config directory.
-
setTarget
public final FoGenerator setTarget(java.io.File target)
Sets the target directory.
-
setDebug
public final FoGenerator setDebug(boolean debug)
Sets thetrueif the fo file will be generated
-
writeFo
protected static void writeFo(Book book, FoContext config, java.io.Writer writer) throws java.io.IOException
Writes theBookto FO.- Parameters:
book-config-writer-- Throws:
java.io.IOException
-
writePdf
protected static void writePdf(java.io.File file, java.io.InputStream source, org.apache.fop.apps.FopFactory factory) throws java.lang.ExceptionWrites the FO stream to PDF.- Parameters:
file-stream-factory-- Throws:
java.lang.Exception
-
buildBook
public final Book buildBook() throws java.io.IOException
Build the markdown based book.- Throws:
java.io.IOException
-
getFoStream
protected final java.io.InputStream getFoStream(Book book, FoContext config) throws java.io.IOException
Get the FOInputStream.- Parameters:
book-config-- Throws:
java.io.IOException
-
generate
public final void generate() throws java.io.IOExceptionBuild the markdown based book.- Throws:
java.io.IOException
-
-