import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintStream;
+import java.net.URI;
import java.util.Locale;
import java.util.Map;
import java.util.Vector;
private boolean flushCache = false;
+ private URI baseURI = new File(".").toURI();
+
/**
* Construct a command line option object.
*/
this.useStdIn = true;
} else {
fofile = new File(filename);
+ baseURI = fofile.toURI();
}
return 1;
}
this.useStdIn = true;
} else {
xmlfile = new File(filename);
+ baseURI = xmlfile.toURI();
}
return 1;
}
this.useStdIn = true;
} else {
areatreefile = new File(filename);
+ baseURI = areatreefile.toURI();
}
return 1;
}
this.useStdIn = true;
} else {
iffile = new File(filename);
+ baseURI = iffile.toURI();
}
return 1;
}
this.useStdIn = true;
} else {
imagefile = new File(filename);
+ baseURI = imagefile.toURI();
}
return 1;
}
private void setUserConfig() throws FOPException, IOException {
FopFactoryBuilder fopFactoryBuilder;
if (userConfigFile == null) {
- fopFactoryBuilder = new FopFactoryBuilder(fofile.toURI());
+ fopFactoryBuilder = new FopFactoryBuilder(baseURI);
fopFactoryBuilder.setStrictFOValidation(strictValidation);
fopFactoryBuilder.setTargetResolution(targetResolution);
fopFactoryBuilder.setComplexScriptFeatures(useComplexScriptFeatures);
import org.apache.fop.render.RendererConfig.RendererConfigParser;
import org.apache.fop.render.intermediate.IFDocumentHandler;
import org.apache.fop.render.intermediate.IFDocumentHandlerConfigurator;
+import org.apache.fop.render.pdf.PDFRendererConfig.PDFRendererConfigParser;
/**
* Base Print renderer configurator (mostly handles font configuration)
}
public static PrintRendererConfigurator createDefaultInstance(FOUserAgent userAgent) {
- return new PrintRendererConfigurator(userAgent, null) {
+ // Since PDF is the default output is PDF, it makes sense for the default config parser
+ // to also be the PDF flavour
+ return new PrintRendererConfigurator(userAgent, new PDFRendererConfigParser()) {
@Override
protected List<FontCollection> getDefaultFontCollection() {
throw new UnsupportedOperationException();