I am working on trying to use FOP 0.25rc2 with Coldfusion MX(CFMX).  I have 
followed the basic instructions from here 
http://xml.apache.org/fop/embedding.html#basics to embed fop. I have embeded it 
into a webpage and everything seems like it is working but it is returning 
blank pages.  It will even return the correct number of blank pages even given 
a .fo file with many pages.  Also if I remove response.setContentType it will 
display the binary info on the page and it looks like it is creating pdf 
information.  

I have tested in IE and Phoenix web browsers and they both exhibt the same 
behavior. Since the problem exists in both i don't think it is the infamous ie 
bug problem(but I could be wrong). 

Here is the code I am using. I know it is CFMX, but it is very 
straightforward(ask if it doesn't make sense).  I also have included a sample 
log.  

thanks in advance for any insight,
jason

<!--- testpdf.cfm --->
<cffile action="read" file="helloworld.fo" variable="xmlString" />
<cfscript>
        xmlString = javacast("string",xmlString);

        biStream = CreateObject("java","java.io.StringBufferInputStream");
        biStream.init(xmlString);

        inputStream = CreateObject("java","org.xml.sax.InputSource");
        inputStream.init(biStream);

        logger = 
CreateObject("java","org.apache.avalon.framework.logger.ConsoleLogger");
        logger.init(logger.LEVEL_DEBUG);

        getPageContext().getResponse().setContentType("application/pdf");
        outputStream = getPageContext().getResponse().getOutputStream();

        fopDriver = CreateObject("java","org.apache.fop.apps.Driver");
        fopDriver.init(inputStream,outputStream);
        fopDriver.setLogger(logger);
        fopDriver.setRenderer(fopDriver.RENDER_PDF);
        fopDriver.run();
        
</cfscript>

<!--- info from log --->
[INFO] Using org.apache.crimson.parser.XMLReaderImpl as SAX2 Parser
[INFO] building formatting object tree
[INFO] setting up fonts
[INFO] [1]
[DEBUG] Last page-sequence produced 1 pages.
[INFO] Parsing of document complete, stopping renderer
[DEBUG] Initial heap size: 4985Kb
[DEBUG] Current heap size: 4939Kb
[DEBUG] Total memory used: -46Kb
[DEBUG]   Memory use is indicative; no GC was performed
[DEBUG]   These figures should not be used comparatively
[DEBUG] Total time used: 490ms
[DEBUG] Pages rendered: 1
[DEBUG] Avg render time: 490ms/page

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to