You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by "Wagstaff, Jason" <Wa...@msx.umsl.edu> on 2003/04/30 16:36:42 UTC

blank pdf's

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: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: blank pdf's

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Wagstaff, Jason wrote:
> 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.

Save the file to disk and try to open it with Acrobat Reader.

 > <!--- info from log --->
 > [INFO] Using org.apache.crimson.parser.XMLReaderImpl as SAX2 Parser

This suggests you are using JDK 1.4. Can you produce the PDF with
the FOP command line?

J.Pietschmann


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org