Hi Sorry,

I am a running FO to PDF transformation. I am using embedded FOP (calling
FOP from my Java app). When I run the FO file from my app, I get the error.
When I run the FOP file from the command line for FOP, it transforms with no
problem.

Here is my code:

try {
                
                OutputStream out =  new FileOutputStream("out.pdf");
                System.out.println("Creating PDF Now.....");
                FopFactoryBuilder builder = new FopConfParser(new
File(com.acm.constants.Constants.FOPCONFIG)).getFopFactoryBuilder();
                builder.setBaseURI(new
File(workingFolder).getAbsoluteFile().toURI());
                builder.setStrictFOValidation(false);
                   //
builder.setComplexScriptFeatures(complexScriptFeatures);
                FopFactory fopFactory =  builder.build();
                try {
                    System.out.println("FOUserAgent....");
                    FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
                    // configure foUserAgent as desired

                    // Setup output stream.  Note: Using
BufferedOutputStream
                    // for performance reasons (helpful with
FileOutputStreams).
                   
                    out = new BufferedOutputStream(out);
                    System.out.println("FOP object.....");
                    // Construct fop with desired output format
                    Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,
foUserAgent, out);

                    // Setup JAXP using identity transformer
                    TransformerFactory factory =
TransformerFactory.newInstance();
                    Transformer transformer = factory.newTransformer(); //
identity transformer

                    // Setup input stream
                    Source src = new
StreamSource(com.acm.constants.Constants.FoResult);

                    // Resulting SAX events (the generated FO) must be piped
through to FOP
                    Result res = new SAXResult(fop.getDefaultHandler());
                    System.out.println("Transforming....");
                    // Start XSLT transformation and FOP processing
                    transformer.transform(src, res);

                    // Result processing
                    FormattingResults foResults = fop.getResults();             
     
                    
                    System.out.println("Generated " +
foResults.getPageCount() + " pages in total.");
                    System.out.println("Deleting FO");
                   
                    
                    
                } catch (Exception e) {
                    System.out.println("Error!!!!!!!!");
                    e.printStackTrace(System.err);
                    
                } finally {
                    out.close();
                }
            } catch (SAXException ex) {
               
Logger.getLogger(XmlToPdfWorker.class.getName()).log(Level.SEVERE, null,
ex);
                
            } catch (IOException ex) {
               
Logger.getLogger(XmlToPdfWorker.class.getName()).log(Level.SEVERE, null,
ex);
            }



--
View this message in context: 
http://apache-fop.1065347.n5.nabble.com/java-lang-IllegalArgumentException-Message-pattern-contains-unsupported-field-name-elementName-tp38286p38291.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]

Reply via email to