aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/svg/PDFTranscoder.java
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2007-11-20 07:14:33 +0000
committerJeremias Maerki <jeremias@apache.org>2007-11-20 07:14:33 +0000
commitadaeaeae7dd5ca1e5e3de8b5d88e496d5e733c93 (patch)
treeb909c43385458425ca21eef27c4eb84756d86e52 /src/java/org/apache/fop/svg/PDFTranscoder.java
parentfcedea93410031b5a7704e3309dce0a19c4b3de8 (diff)
downloadxmlgraphics-fop-adaeaeae7dd5ca1e5e3de8b5d88e496d5e733c93.tar.gz
xmlgraphics-fop-adaeaeae7dd5ca1e5e3de8b5d88e496d5e733c93.zip
Bugzilla #43904:
Buffer the OutputStreams in our transcoders if the users forget. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@596554 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/svg/PDFTranscoder.java')
-rw-r--r--src/java/org/apache/fop/svg/PDFTranscoder.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/java/org/apache/fop/svg/PDFTranscoder.java b/src/java/org/apache/fop/svg/PDFTranscoder.java
index f0d40b574..417b82097 100644
--- a/src/java/org/apache/fop/svg/PDFTranscoder.java
+++ b/src/java/org/apache/fop/svg/PDFTranscoder.java
@@ -20,7 +20,12 @@
package org.apache.fop.svg;
import java.awt.Color;
+import java.io.BufferedOutputStream;
import java.io.IOException;
+import java.io.OutputStream;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.svg.SVGLength;
import org.apache.avalon.framework.configuration.Configurable;
import org.apache.avalon.framework.configuration.Configuration;
@@ -36,10 +41,9 @@ import org.apache.batik.transcoder.TranscodingHints;
import org.apache.batik.transcoder.image.ImageTranscoder;
import org.apache.batik.transcoder.keys.BooleanKey;
import org.apache.batik.transcoder.keys.FloatKey;
+
import org.apache.fop.Version;
import org.apache.fop.fonts.FontInfo;
-import org.w3c.dom.Document;
-import org.w3c.dom.svg.SVGLength;
/**
* This class enables to transcode an input to a pdf document.
@@ -195,7 +199,11 @@ public class PDFTranscoder extends AbstractFOPTranscoder
if (hints.containsKey(KEY_DEVICE_RESOLUTION)) {
graphics.setDeviceDPI(((Float)hints.get(KEY_DEVICE_RESOLUTION)).floatValue());
}
- graphics.setupDocument(output.getOutputStream(), w, h);
+ OutputStream out = output.getOutputStream();
+ if (!(out instanceof BufferedOutputStream)) {
+ out = new BufferedOutputStream(out);
+ }
+ graphics.setupDocument(out, w, h);
graphics.setSVGDimension(width, height);
if (hints.containsKey(ImageTranscoder.KEY_BACKGROUND_COLOR)) {