Since you are using 1.0 you better find a newer take on embedding fonts. Maybe here <http://xmlgraphics.apache.org/fop/trunk/fonts.html#embedding>

On 06/06/2011 03:28 PM, honyk wrote:
Hello Everyone,

I am trying to embed FOP into my app according to this article:
http://xmlgraphics.apache.org/fop/0.95/embedding.html

Actually, my code is here:
     public void createPDF(ArrayList<File>  inputFileList, File output) throws
Exception {

         File foFile = createFO(inputFileList);
         FopFactory fopFactory = FopFactory.newInstance();
         //fopFactory.getFontManager().setFontBaseURL("file:///D:");
         OutputStream out = new BufferedOutputStream(new
FileOutputStream(output));

         try {
             Fop fop = fopFactory.newFop(MimeConstants.MIME_FOP_PRINT, out);

             TransformerFactory factory = TransformerFactory.newInstance();
             Transformer transformer = factory.newTransformer();
             Source src = new StreamSource(foFile);
             Result res = new SAXResult(fop.getDefaultHandler());
             transformer.transform(src, res);
         } finally {
             out.close();
         }
     }

When this method is called, I am getting

Exception in thread "main" java.lang.NoSuchMethodError:
org.apache.fop.fonts.FontInfo.setEventListener(Lorg/apache/fop/fonts/FontEve
ntListener;)V
         at org.apache.fop.fo.FOEventHandler.<init>(FOEventHandler.java:84)
         at
org.apache.fop.area.AreaTreeHandler.<init>(AreaTreeHandler.java:100)
         at
org.apache.fop.render.RendererFactory.createFOEventHandler(RendererFactory.j
ava:359)
         at org.apache.fop.fo.FOTreeBuilder.<init>(FOTreeBuilder.java:99)
         at org.apache.fop.apps.Fop.createDefaultHandler(Fop.java:147)
         at org.apache.fop.apps.Fop.<init>(Fop.java:82)
         at org.apache.fop.apps.FopFactory.newFop(FopFactory.java:271)
         at org.apache.fop.apps.FopFactory.newFop(FopFactory.java:248)
         at me.jan.Producer.createPDF(Producer.java:32)

I have no idea what to check. I think it is related to fonts but that
exception is not very clear to me.

Win7/64bit, Java 1.6, Fop1.0

Regards,
Jan


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to