|
|
|
|
|
|
|
|
import java.io.FileNotFoundException; |
|
|
import java.io.FileNotFoundException; |
|
|
import java.io.IOException; |
|
|
import java.io.IOException; |
|
|
import java.io.PrintStream; |
|
|
import java.io.PrintStream; |
|
|
|
|
|
import java.net.URI; |
|
|
import java.util.Locale; |
|
|
import java.util.Locale; |
|
|
import java.util.Map; |
|
|
import java.util.Map; |
|
|
import java.util.Vector; |
|
|
import java.util.Vector; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean flushCache = false; |
|
|
private boolean flushCache = false; |
|
|
|
|
|
|
|
|
|
|
|
private URI baseURI = new File(".").toURI(); |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Construct a command line option object. |
|
|
* Construct a command line option object. |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
this.useStdIn = true; |
|
|
this.useStdIn = true; |
|
|
} else { |
|
|
} else { |
|
|
fofile = new File(filename); |
|
|
fofile = new File(filename); |
|
|
|
|
|
baseURI = fofile.toURI(); |
|
|
} |
|
|
} |
|
|
return 1; |
|
|
return 1; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.useStdIn = true; |
|
|
this.useStdIn = true; |
|
|
} else { |
|
|
} else { |
|
|
xmlfile = new File(filename); |
|
|
xmlfile = new File(filename); |
|
|
|
|
|
baseURI = xmlfile.toURI(); |
|
|
} |
|
|
} |
|
|
return 1; |
|
|
return 1; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.useStdIn = true; |
|
|
this.useStdIn = true; |
|
|
} else { |
|
|
} else { |
|
|
areatreefile = new File(filename); |
|
|
areatreefile = new File(filename); |
|
|
|
|
|
baseURI = areatreefile.toURI(); |
|
|
} |
|
|
} |
|
|
return 1; |
|
|
return 1; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.useStdIn = true; |
|
|
this.useStdIn = true; |
|
|
} else { |
|
|
} else { |
|
|
iffile = new File(filename); |
|
|
iffile = new File(filename); |
|
|
|
|
|
baseURI = iffile.toURI(); |
|
|
} |
|
|
} |
|
|
return 1; |
|
|
return 1; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.useStdIn = true; |
|
|
this.useStdIn = true; |
|
|
} else { |
|
|
} else { |
|
|
imagefile = new File(filename); |
|
|
imagefile = new File(filename); |
|
|
|
|
|
baseURI = imagefile.toURI(); |
|
|
} |
|
|
} |
|
|
return 1; |
|
|
return 1; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void setUserConfig() throws FOPException, IOException { |
|
|
private void setUserConfig() throws FOPException, IOException { |
|
|
FopFactoryBuilder fopFactoryBuilder; |
|
|
FopFactoryBuilder fopFactoryBuilder; |
|
|
if (userConfigFile == null) { |
|
|
if (userConfigFile == null) { |
|
|
fopFactoryBuilder = new FopFactoryBuilder(fofile.toURI()); |
|
|
|
|
|
|
|
|
fopFactoryBuilder = new FopFactoryBuilder(baseURI); |
|
|
fopFactoryBuilder.setStrictFOValidation(strictValidation); |
|
|
fopFactoryBuilder.setStrictFOValidation(strictValidation); |
|
|
fopFactoryBuilder.setTargetResolution(targetResolution); |
|
|
fopFactoryBuilder.setTargetResolution(targetResolution); |
|
|
fopFactoryBuilder.setComplexScriptFeatures(useComplexScriptFeatures); |
|
|
fopFactoryBuilder.setComplexScriptFeatures(useComplexScriptFeatures); |