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 mi...@freenet.de on 2003/08/28 20:33:51 UTC
Problems with MathML Formulas and the fop developer version
Hello,
Thank you for your answer, it helped me.
How can I set the fop-0_20_2-maintain tag?
I hava now a fop.jar and so on with MathML Support and this works with the ExampleFO2PDF.java and the given examples
and: driver.addElementMapping("org.apache.fop.mathml.MathMLElementMapping");. OK.
But I hava now other problems if I use the new fop.jar ... with my existing classes for pdf transformation. In the
Developer build fop.jar there are no packages:
- org.apache.fop.messaging
- org.apache.fop.configuration more.
And the method:
setLogger(org.apache.avalon.framework.logger.Logger) in class org.apache.fop.apps.Driver is deprecated?!
And:
driver.setLogger(new org.apache.avalon.framework.logger.Log4JLogger(Logger.getRoot())); for Log4J is also dropped.
Where can I get the lost classes or are they dropped in newer versions?
There are also not generated with build.bat.
The problem is following I let all the pdf status (messages) infos in a JTextPane. That's why I need Log4J because my personal JTextPane use this.
The old code works not more with the new fop.jar.
Here is the significant code:
// Sun
import java.io.*;
import java.util.*;
import javax.swing.*;
// FOP
import org.apache.avalon.framework.logger.*;
import org.apache.fop.apps.*;
import org.apache.fop.messaging.*;
// Log4J
import org.apache.log4j.*;
import org.apache.log4j.Logger;
import org.w3c.dom.*;
// Apache
import org.xml.sax.*;
import javax.xml.transform.dom.DOMSource;
import org.w3c.dom.Document;
...
// Log4J
Layout myConsoleLayout = new SimpleLayout();
TextPaneAppender tpa = new TextPaneAppender(myConsoleLayout, "ConsoleAppender", false);
tpa.setTextPane(textPane);
tpa.setThreshold(Priority.INFO);
Logger.getRootLogger().addAppender(tpa);
// Construct FOP driver
Driver driver = new Driver();
// 1.
driver.setLogger(new org.apache.avalon.framework.logger.Log4JLogger(Logger.getRoot()));
driver.setRenderer(Driver.RENDER_PDF);
// 2.
MessageHandler.setOutputMethod(MessageHandler.EVENT);
MessageHandler.addListener(new TextPaneMessageListener());
MessageHandler.setScreenLogger(new ConsoleLogger(ConsoleLogger.LEVEL_INFO));
// necessary because images
org.apache.fop.configuration.Configuration.put("baseDir", xslFile.getParent());
driver.addElementMapping("org.apache.fop.mathml.MathMLElementMapping");
try
{
InputHandler inputHandler = new XSLTInputHandler(tempFile, xslFile);
// Setup output
OutputStream out = new java.io.FileOutputStream(outFile);
XMLReader parser = inputHandler.getParser();
driver.setOutputStream(out);
driver.render(parser, inputHandler.getInputSource());
out.close();
}
catch (Exception ex)
{ ...
}
...
class TextPaneMessageListener extends DefaultMessageListener
{
public void processMessage(MessageEvent event)
{
.... // let to JTextPane
}
}
Can anybody give me some hints?
Thank you very much, Micha
--
Gratis:
Nokia Handy (bei Abschluss eines 24 Monats Vertrages) +
d-Box 1 + PREMIERE START ! Hier bestellen
http://www.freenet.de/tipp/shopping/handy_aktion/index.html
Re: Problems with MathML Formulas and the fop developer version
Posted by "J.Pietschmann" <j3...@yahoo.de>.
michaweg@freenet.de wrote:
> How can I set the fop-0_20_2-maintain tag?
See
http://www.apache.org/dev/contributors.html#cvsbasics
> Developer build fop.jar there are no packages:
> - org.apache.fop.messaging
> - org.apache.fop.configuration more.
HEAD uses Avalon logging and configuration. Actually, I don't
think configuration works.
J.Pietschmann
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org