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 朱曼 <zh...@gmail.com> on 2015/03/29 09:24:42 UTC

why table not showing at all

Dear list,

I am a newbie to fop, and I am trying a very small example of converting
xml+xsl-fo to pdf. But I am quite confused about that the table doesn't
appear in the result pdf at all. Could you please help me on this issue
please?
Here is the code I am using:
FopFactory fopFactory = FopFactory.newInstance();
fopFactory.setUserConfig(new File("font/fop.xconf"));
OutputStream out = new BufferedOutputStream(new FileOutputStream(new
File("db/ccb.pdf")));

try {
    Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, out);
    TransformerFactory factory = TransformerFactory.newInstance();
    Source src = new StreamSource(new File("db/ccb.xml"));
    Source xslt = new StreamSource(new File("db/ccb2fo.xsl"));
    Transformer transformer = factory.newTransformer(xslt);
    Result res = new SAXResult(fop.getDefaultHandler());
    transformer.transform(src, res);

} finally {
    out.close();
}

All required files are in the attachments.You may need to modify the
location in the fop.xconf file accordingly. Sorry for the inconvenience.

Re: why table not showing at all

Posted by 朱曼 <mz...@seu.edu.cn>.
Hi Robert,

Thanks a lot. It works!

Regards,
June

2015-03-30 3:06 GMT+08:00 Robert Meyer <rm...@hotmail.co.uk>:

> Hi,
>
> It's because you're using an <fo:table-and-caption> tag. Remove that as
> well as the closing tag from the end of the document. Currently the
> table-and-caption is not supported by FOP and in any case you're not
> specifying an accompanying caption which makes it a bit pointless.
>
> Regards,
>
> Robert Meyer
>
> ------------------------------
> Date: Sun, 29 Mar 2015 15:24:42 +0800
> Subject: why table not showing at all
> From: zhuman.private@gmail.com
> To: fop-users@xmlgraphics.apache.org
>
>
> Dear list,
>
> I am a newbie to fop, and I am trying a very small example of converting
> xml+xsl-fo to pdf. But I am quite confused about that the table doesn't
> appear in the result pdf at all. Could you please help me on this issue
> please?
> Here is the code I am using:
> FopFactory fopFactory = FopFactory.newInstance();
> fopFactory.setUserConfig(new File("font/fop.xconf"));
> OutputStream out = new BufferedOutputStream(new FileOutputStream(new
> File("db/ccb.pdf")));
>
> try {
>     Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, out);
>     TransformerFactory factory = TransformerFactory.newInstance();
>     Source src = new StreamSource(new File("db/ccb.xml"));
>     Source xslt = new StreamSource(new File("db/ccb2fo.xsl"));
>     Transformer transformer = factory.newTransformer(xslt);
>     Result res = new SAXResult(fop.getDefaultHandler());
>     transformer.transform(src, res);
>
> } finally {
>     out.close();
> }
>
> All required files are in the attachments.You may need to modify the
> location in the fop.xconf file accordingly. Sorry for the inconvenience.
>
> --------------------------------------------------------------------- To
> unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org For
> additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>

RE: why table not showing at all

Posted by Robert Meyer <rm...@hotmail.co.uk>.
Hi,
It's because you're using an <fo:table-and-caption> tag. Remove that as well as the closing tag from the end of the document. Currently the table-and-caption is not supported by FOP and in any case you're not specifying an accompanying caption which makes it a bit pointless.
Regards,
Robert Meyer

Date: Sun, 29 Mar 2015 15:24:42 +0800
Subject: why table not showing at all
From: zhuman.private@gmail.com
To: fop-users@xmlgraphics.apache.org

Dear list,

I am a newbie to fop, and I am trying a very small example of converting xml+xsl-fo to pdf. But I am quite confused about that the table doesn't appear in the result pdf at all. Could you please help me on this issue please? Here is the code I am using:FopFactory fopFactory = FopFactory.newInstance();		fopFactory.setUserConfig(new File("font/fop.xconf"));		OutputStream out = new BufferedOutputStream(new FileOutputStream(new File("db/ccb.pdf")));
		try {		    Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, out);		    TransformerFactory factory = TransformerFactory.newInstance();		    Source src = new StreamSource(new File("db/ccb.xml"));		    		    Source xslt = new StreamSource(new File("db/ccb2fo.xsl"));		    Transformer transformer = factory.newTransformer(xslt);		    Result res = new SAXResult(fop.getDefaultHandler());		    transformer.transform(src, res);
		} finally {		    out.close();		}
All required files are in the attachments.You may need to modify the location in the fop.xconf file accordingly. Sorry for the inconvenience.

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