Index: src/java/org/apache/fop/render/pdf/pdfbox/PDFBoolean.java
===================================================================
--- src/java/org/apache/fop/render/pdf/pdfbox/PDFBoolean.java	(revision 1343262)
+++ src/java/org/apache/fop/render/pdf/pdfbox/PDFBoolean.java	(working copy)
@@ -21,7 +21,6 @@
 
 import java.io.IOException;
 import java.io.OutputStream;
-import java.io.Writer;
 
 import org.apache.commons.io.output.CountingOutputStream;
 
@@ -53,20 +52,9 @@
 
     /** {@inheritDoc} */
     @Override
-    protected int output(OutputStream stream) throws IOException {
+    public int output(OutputStream stream) throws IOException {
         CountingOutputStream cout = new CountingOutputStream(stream);
-        Writer writer = PDFDocument.getWriterFor(cout);
-        if (hasObjectNumber()) {
-            writer.write(getObjectID());
-        }
-
-        writer.write(Boolean.toString(getValue()));
-
-        if (hasObjectNumber()) {
-            writer.write("\nendobj\n");
-        }
-
-        writer.flush();
+        PDFDocument.flushTextBuffer(new StringBuilder(Boolean.toString(getValue())), cout);
         return cout.getCount();
     }
 
Index: src/java/org/apache/fop/render/pdf/pdfbox/PDFBoxAdapter.java
===================================================================
--- src/java/org/apache/fop/render/pdf/pdfbox/PDFBoxAdapter.java	(revision 1343262)
+++ src/java/org/apache/fop/render/pdf/pdfbox/PDFBoxAdapter.java	(working copy)
@@ -58,6 +58,7 @@
 import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation;
 import org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm;
 
+import org.apache.fop.pdf.AbstractPDFStream;
 import org.apache.fop.pdf.PDFArray;
 import org.apache.fop.pdf.PDFDictionary;
 import org.apache.fop.pdf.PDFDocument;
@@ -282,12 +283,12 @@
         }
     }
 
-    private void transferDict(COSDictionary orgDict, PDFDictionary targetDict,
+    private void transferDict(COSDictionary orgDict, AbstractPDFStream targetDict,
             Set filter) throws IOException {
         transferDict(orgDict, targetDict, filter, false);
     }
 
-    private void transferDict(COSDictionary orgDict, PDFDictionary targetDict,
+    private void transferDict(COSDictionary orgDict, AbstractPDFStream targetDict,
             Set filter, boolean inclusive) throws IOException {
         Iterator iter = orgDict.keySet().iterator();
         while (iter.hasNext()) {
Index: src/java/org/apache/fop/render/pdf/pdfbox/PDFString.java
===================================================================
--- src/java/org/apache/fop/render/pdf/pdfbox/PDFString.java	(revision 1343262)
+++ src/java/org/apache/fop/render/pdf/pdfbox/PDFString.java	(working copy)
@@ -22,7 +22,6 @@
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.UnsupportedEncodingException;
-import java.io.Writer;
 
 import org.apache.commons.io.output.CountingOutputStream;
 
@@ -117,20 +116,9 @@
 
     /** {@inheritDoc} */
     @Override
-    protected int output(OutputStream stream) throws IOException {
+    public int output(OutputStream stream) throws IOException {
         CountingOutputStream cout = new CountingOutputStream(stream);
-        Writer writer = PDFDocument.getWriterFor(cout);
-        if (hasObjectNumber()) {
-            writer.write(getObjectID());
-        }
-
-        writer.write(PDFText.escapeText(getString()));
-
-        if (hasObjectNumber()) {
-            writer.write("\nendobj\n");
-        }
-
-        writer.flush();
+        PDFDocument.flushTextBuffer(new StringBuilder(PDFText.escapeText(getString())), cout);
         return cout.getCount();
     }
 
