As you mentioned, the issue does not happen with the command line (as I
checked). So the issue is not really with FOP. I also tried to run it
from a java program and had not no issues either.
Attached is the sample code I use, a variation of one of the examples.
On 4/14/13 2:12 PM, Bonekrusher wrote:
I was able to track this down and it is not related to a corrupt graphic. It
looks like if the text overflows a column, then the error occurs. Below is a
link to a repo of the issue. I made it as small as possible. Search for the
sentence "BUG HERE LONG TEXT OVERFLOW". If you delete the text it renders
fine.
Example FO <http://www.aviationcontentmanagement.com/images/error2.txt>
--
View this message in context:
http://apache-fop.1065347.n5.nabble.com/java-lang-IllegalArgumentException-Message-pattern-contains-unsupported-field-name-elementName-tp38286p38305.html
Sent from the FOP - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
package org.apache.fop.lbernardo;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.sax.SAXResult;
import javax.xml.transform.stream.StreamSource;
import org.xml.sax.SAXException;
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.Fop;
import org.apache.fop.apps.FopConfParser;
import org.apache.fop.apps.FopFactory;
import org.apache.fop.apps.FopFactoryBuilder;
import org.apache.fop.apps.MimeConstants;
public class FOToOutputFormat {
private static String mime = MimeConstants.MIME_PDF;
private static String confFile =
"/Users/lbernardo/Documents/C/workspace/fopexamples/fop.xconf";
private static String foFile = "/Users/lbernardo/Downloads/error2.txt";
private static String outFile = "/tmp/error.pdf";
/**
* @param args
* @throws IOException
* @throws SAXException
*/
public static void main(String[] args) throws SAXException, IOException {
FopFactoryBuilder builder = new FopConfParser(new
File(confFile)).getFopFactoryBuilder();
FopFactory fopFactory = builder.build();
try {
generateDoc(fopFactory);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void generateDoc(FopFactory fopFactory) throws IOException,
FOPException,
TransformerException {
File fo = new File(foFile);
File pdf = new File(outFile);
OutputStream out = null;
try {
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
// configure foUserAgent as desired
// Setup output stream. Note: Using BufferedOutputStream
// for performance reasons (helpful with FileOutputStreams).
out = new FileOutputStream(pdf);
out = new BufferedOutputStream(out);
// Construct fop with desired output format
Fop fop = fopFactory.newFop(mime, foUserAgent, out);
// Setup JAXP using identity transformer
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(); // identity
transformer
// Setup input stream
Source src = new StreamSource(fo);
// Resulting SAX events (the generated FO) must be piped through to
FOP
Result res = new SAXResult(fop.getDefaultHandler());
// Start XSLT transformation and FOP processing
transformer.transform(src, res);
} finally {
out.close();
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]