/** {@inheritDoc} */ public void startRenderer(OutputStream outputStream) throws IOException { log.info("rendering areas to PNG"); multiFileUtil = new MultiFileRenderingUtil(PNG_FILE_EXTENSION, getUserAgent().getOutputFile()); this.firstOutputStream = outputStream; }
/** {@inheritDoc} */ public void setResult(Result result) throws IFException { if (result instanceof StreamResult) { multiFileUtil = new MultiFileRenderingUtil(FILE_EXTENSION_SVG, getUserAgent().getOutputFile()); this.firstStream = (StreamResult)result; } else { this.simpleResult = result; } }
/** {@inheritDoc} */ public void startRenderer(OutputStream outputStream) throws IOException { this.firstOutputStream = outputStream; this.multiFileUtil = new MultiFileRenderingUtil(SVG_FILE_EXTENSION, getUserAgent().getOutputFile()); super.startRenderer(this.firstOutputStream); }
/** {@inheritDoc} */ public void startRenderer(OutputStream outputStream) throws IOException { try { if (outputStream != null) { StreamResult result = new StreamResult(outputStream); if (getUserAgent().getOutputFile() != null) { result.setSystemId( getUserAgent().getOutputFile().toURI().toURL().toExternalForm()); } if (this.documentHandler == null) { this.documentHandler = createDefaultDocumentHandler(); } this.documentHandler.setResult(result); } super.startRenderer(null); if (log.isDebugEnabled()) { log.debug("Rendering areas via IF document handler (" + this.documentHandler.getClass().getName() + ")..."); } documentHandler.startDocument(); documentHandler.startDocumentHeader(); } catch (IFException e) { handleIFExceptionWithIOException(e); } }
/** {@inheritDoc} */ public void startDocument() throws IFException { super.startDocument(); try { // Creates writer this.imageWriter = ImageWriterRegistry.getInstance().getWriterFor(getMimeType()); if (this.imageWriter == null) { BitmapRendererEventProducer eventProducer = BitmapRendererEventProducer.Provider.get( getUserAgent().getEventBroadcaster()); eventProducer.noImageWriterFound(this, getMimeType()); } if (this.imageWriter.supportsMultiImageWriter()) { this.multiImageWriter = this.imageWriter.createMultiImageWriter(outputStream); } else { this.multiFileUtil = new MultiFileRenderingUtil(getDefaultExtension(), getUserAgent().getOutputFile()); } this.pageCount = 0; } catch (IOException e) { throw new IFException("I/O error in startDocument()", e); } }