/** * Returns the DefaultHandler object that will receive the SAX stream containing the * FO document to be rendered. * @return the SAX DefaultHandler for handling the SAX events. * @throws FOPException if setting up the DefaultHandler fails */ public DefaultHandler getDefaultHandler() throws FOPException { if (foTreeBuilder == null) { createDefaultHandler(); } return this.foTreeBuilder; }
/** * Constructor for use with already-created FOUserAgents. It uses MIME types to select the * output format (ex. "application/pdf" for PDF). * @param outputFormat the MIME type of the output format to use (ex. "application/pdf"). * @param ua FOUserAgent object * @param stream the output stream * @throws FOPException if setting up the DefaultHandler fails */ Fop(String outputFormat, FOUserAgent ua, OutputStream stream) throws FOPException { if (ua == null) { throw new FOPException("Cannot create a new Fop instance without a User Agent."); } this.outputFormat = outputFormat; foUserAgent = ua; this.stream = stream; createDefaultHandler(); }