I have a Java class that takes FO input as a string and returns PDF bytecode as a string. Here's a snippet of my code:
ByteArrayOutputStream buffout = new ByteArrayOutputStream();
String pdfbytecode = buffout.toString();
this is a CFX tag (for Cold Fusion) written in Java: thus, i use pdfbytecode to return a query response object back to Cold Fusion.
The problem is: between stream...endstream identifiers in the pdf file the encoding of the characters seems to be wrong. As a result the PDF file is loaded with an error saying "the File is damaged but being repaired" and it then appears blank, although with the correct number of pages and approximately the right file size.
Can anyone help me fix my class or fix the encoding of the stuff between stream...endstream ??!!