throw new IllegalStateException(
"Renderer not set when using standard foInputHandler");
}
- foInputHandler = new FOTreeHandler(currentDocument, stream, renderer, true);
+ foInputHandler = new FOTreeHandler(currentDocument, true);
}
foInputHandler.enableLogging(getLogger());
currentDocument.atModel = AreaTree.createRenderPagesModel(renderer);
//this.atModel = new CachedRenderPagesModel(renderer);
currentDocument.areaTree.setTreeModel(currentDocument.atModel);
+ try {
+ renderer.setupFontInfo(currentDocument);
+ // check that the "any,normal,400" font exists
+ if (!currentDocument.isSetupValid()) {
+ throw new SAXException(new FOPException(
+ "No default font defined by OutputConverter"));
+ }
+ renderer.startRenderer(stream);
+ } catch (IOException e) {
+ throw new SAXException(e);
+ }
}
/**
The following statement triggers virtually all of the processing
package org.apache.fop.fo;
// Java
-import java.io.IOException;
-import java.io.OutputStream;
import java.util.HashSet;
import java.util.Iterator;
import org.apache.fop.fo.flow.TableRow;
import org.apache.fop.fo.pagination.Flow;
import org.apache.fop.fo.pagination.PageSequence;
-import org.apache.fop.render.Renderer;
/**
* Defines how SAX events specific to XSL-FO input should be handled when
*/
private long startTime;
- /**
- * The stream to which this rendering is to be
- * written to. <B>Note</B> that some renderers
- * do not render to a stream, and that this
- * member can therefore be null.
- */
- private OutputStream outputStream;
-
- /**
- * The renderer being used.
- */
- private Renderer renderer;
-
/**
* Collection of objects that have registered to be notified about
* FOTreeEvent firings.
* Main constructor
* @param foTreeControl the FOTreeControl implementation that governs this
* FO Tree
- * @param outputStream the stream that the result is rendered to
- * @param renderer the renderer to call
* @param store if true then use the store pages model and keep the
* area tree in memory
*/
- public FOTreeHandler(FOTreeControl foTreeControl, OutputStream outputStream,
- Renderer renderer, boolean store) {
+ public FOTreeHandler(FOTreeControl foTreeControl, boolean store) {
super(foTreeControl);
if (collectStatistics) {
runtime = Runtime.getRuntime();
}
- this.outputStream = outputStream;
- this.renderer = renderer;
-
}
/**
initialMemory = runtime.totalMemory() - runtime.freeMemory();
startTime = System.currentTimeMillis();
}
- try {
- renderer.setupFontInfo(foTreeControl);
- // check that the "any,normal,400" font exists
- if (!foTreeControl.isSetupValid()) {
- throw new SAXException(new FOPException(
- "No default font defined by OutputConverter"));
- }
- renderer.startRenderer(outputStream);
- } catch (IOException e) {
- throw new SAXException(e);
- }
}
/**