RE: FOP trunk error message when run from ant
That doesn't seem right at all. You explain how to get the fonts into the xconf reference path then show an embedded example. If you're using the classes and embedding the code you don't need that. I pull in fonts like this: 1) Create a TTFFontLoader using the font file name with URI path and a DefaultFontResolver 2) If it's one font per file just use getFont() to create a CustomFont, if you need to query any font details from the file 3) Build a new FontTriplet and add it into a Java ArrayList 4) Create a new EmbedFontInfo object using the FOP generated metrics file (URI), the KerningEnabled value (can be queried from CustomFont), the font triplet array, the font file (URI), and the sub font name (may be null) 5) Create another Java ArrayList and add in the EmbedFontInfo 6) Generate a Renderer and pass the font ArrayList to setFontList() 7) Put the Renderer into the UserAgent (setRendererOverride) Then you shouldn't even need the xconf file. I suggest never referring to fonts as files which should be installed on the client OS. We had a program years ago running on Windows 98 referencing a Courier font that didn't come out right because somehow the same font file had a different looking font in it on different clients. I avoid that problem now pulling the font from the server. -Original Message- From: Jayant Ghagre [mailto:jayant.gha...@ambest.com] Sent: Thursday, July 01, 2010 2:40 PM To: fop-users@xmlgraphics.apache.org Subject: RE: FOP trunk error message when run from ant Mario, Here's how I am using custom fonts. In my application folder I have created a folder "MyAppFonts" and copied all custom fonts in that folder. You can either refer to operating systems folder such as c:\windows\fonts. Copy fop.xconf file to your application folder and then rename to YourAppNameConfig.xml Open the YourAppNameConfig.xml in any editor and add you MyAppFonts folder as shown below .\MyAppFonts .\MyAppFonts Sample java code // configure fopFactory as desired FopFactory fopFactory = FopFactory.newInstance(); fopFactory.setUserConfig(new File( YourAppNameConfig.xml )); FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); I am using custom font in this manner. I hope this information helps. Regards, Jayant - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: FOP trunk error message when run from ant
Mario, Here's how I am using custom fonts. In my application folder I have created a folder "MyAppFonts" and copied all custom fonts in that folder. You can either refer to operating systems folder such as c:\windows\fonts. Copy fop.xconf file to your application folder and then rename to YourAppNameConfig.xml Open the YourAppNameConfig.xml in any editor and add you MyAppFonts folder as shown below .\MyAppFonts .\MyAppFonts Sample java code // configure fopFactory as desired FopFactory fopFactory = FopFactory.newInstance(); fopFactory.setUserConfig(new File( YourAppNameConfig.xml )); FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); I am using custom font in this manner. I hope this information helps. Regards, Jayant |> | From: | |> >--| |"Mario Madunic" | >--| |> | To:| |> >--| | | >--| |> | Date: | |> >--| |07/01/2010 02:19 PM | >--| |> | Subject: | |> >--| |RE: FOP trunk error message when run from ant | >--| Thanks Eric, I removed the following jar from my ant181/lib xmlgraphics-commons-1.3.1 and copied over the 1.4 version. The graphic error msg is gone but now have an id reference error. Will work on this one before posting if I make no head way. I'll start a new message on how to get Helvetica recognized. I was unable to create an XML metric file for it with the method for 0.94. Once again thanks Eric for your quick and knowledgeable reply. Marijan (Mario) Madunic Publishing Specialist New Flyer Industries -Original Message- From: Eric Douglas [mailto:edoug...@blockhouse.com] Sent: Thursday, July 01, 2010 1:07 PM To: fop-users@xmlgraphics.apache.org Subject: RE: FOP trunk error message when run from ant Do you have the xmlgraphics-commons-1.4svn.jar in your trunk lib path? New method for calling fonts? Is this on embedding code or just on running from a command line? I'm using the FOP classes with embedded code and my custom fonts are working nicely. -Original Message- From: Mario Madunic [mailto:mario_madu...@newflyer.com] Sent: Thursday, July 01, 2010 10:13 AM To: fop-users@xmlgraphics.apache.org Subject: FOP trunk error message when run from ant While running the trunk via ANT the build fails. The error message is at the bottom. Pieces I'm using Java 1.6.0_16 ANT 1.8.1 (just started using it today, was using 1.7 and received same error) Windows XP SP3 I executed the build by just typing ant in a cmd prompt. In the config file I added the font metrics for the time being from my 0.94 config file, as it still seems to be valid. Example below At the moment still trying to figure out the new method for calling fonts. (want to use Helvetica and encoding utf-8) Line 46 mentioned below of the build file (partsToPDF.xml) is (I receive the same error when using absolute paths, in case that makes a difference) Any help appreciated. Thanks BUILD FAILED c:\ publishingWorkflow\antTargets\partsToPDF.xml:46: java.lang.NoSuchMethodError: org.apache.xmlgraphics.java2d.GraphicContext.(Lorg/apache/xmlgraph ics/java2d/GraphicContext;)V at org.apache.fop.render.interme
RE: FOP trunk error message when run from ant
I'm not sure what you mean by id reference error. If you're talking about another build error, they're obvious to fix if you have the details with a class reference like your previous error. I don't remember how to create a metrics file but there's instructions on the site (http://xmlgraphics.apache.org/fop/0.95/fonts.html). I did have to create one for each ttf file I'm using for custom embedded fonts. I used the 0.95 to create. I don't know if that changed any from 0.94. I'm using some TrueType fonts which should be found in the Windows fonts folder (ie lucon.ttf). I'm using embedded code to create FOP objects and specify all the needed classes and methods to set it up, so I don't know much about running from a command line. -Original Message- From: Mario Madunic [mailto:mario_madu...@newflyer.com] Sent: Thursday, July 01, 2010 2:26 PM To: fop-users@xmlgraphics.apache.org Subject: RE: FOP trunk error message when run from ant Thanks Eric, I removed the following jar from my ant181/lib xmlgraphics-commons-1.3.1 and copied over the 1.4 version. The graphic error msg is gone but now have an id reference error. Will work on this one before posting if I make no head way. I'll start a new message on how to get Helvetica recognized. I was unable to create an XML metric file for it with the method for 0.94. Once again thanks Eric for your quick and knowledgeable reply. Marijan (Mario) Madunic Publishing Specialist New Flyer Industries - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: FOP trunk error message when run from ant
Thanks Eric, I removed the following jar from my ant181/lib xmlgraphics-commons-1.3.1 and copied over the 1.4 version. The graphic error msg is gone but now have an id reference error. Will work on this one before posting if I make no head way. I'll start a new message on how to get Helvetica recognized. I was unable to create an XML metric file for it with the method for 0.94. Once again thanks Eric for your quick and knowledgeable reply. Marijan (Mario) Madunic Publishing Specialist New Flyer Industries -Original Message- From: Eric Douglas [mailto:edoug...@blockhouse.com] Sent: Thursday, July 01, 2010 1:07 PM To: fop-users@xmlgraphics.apache.org Subject: RE: FOP trunk error message when run from ant Do you have the xmlgraphics-commons-1.4svn.jar in your trunk lib path? New method for calling fonts? Is this on embedding code or just on running from a command line? I'm using the FOP classes with embedded code and my custom fonts are working nicely. -Original Message- From: Mario Madunic [mailto:mario_madu...@newflyer.com] Sent: Thursday, July 01, 2010 10:13 AM To: fop-users@xmlgraphics.apache.org Subject: FOP trunk error message when run from ant While running the trunk via ANT the build fails. The error message is at the bottom. Pieces I'm using Java 1.6.0_16 ANT 1.8.1 (just started using it today, was using 1.7 and received same error) Windows XP SP3 I executed the build by just typing ant in a cmd prompt. In the config file I added the font metrics for the time being from my 0.94 config file, as it still seems to be valid. Example below At the moment still trying to figure out the new method for calling fonts. (want to use Helvetica and encoding utf-8) Line 46 mentioned below of the build file (partsToPDF.xml) is (I receive the same error when using absolute paths, in case that makes a difference) Any help appreciated. Thanks BUILD FAILED c:\ publishingWorkflow\antTargets\partsToPDF.xml:46: java.lang.NoSuchMethodError: org.apache.xmlgraphics.java2d.GraphicContext.(Lorg/apache/xmlgraph ics/java2d/GraphicContext;)V at org.apache.fop.render.intermediate.IFGraphicContext.(IFGraphicCont ext.java:50) at org.apache.fop.render.intermediate.IFGraphicContext.clone(IFGraphicConte xt.java:56) at org.apache.fop.render.intermediate.IFRenderer.saveGraphicsState(IFRender er.java:632) at org.apache.fop.render.intermediate.IFRenderer.startViewport(IFRenderer.j ava:885) at org.apache.fop.render.intermediate.IFRenderer.startVParea(IFRenderer.jav a:878) at org.apache.fop.render.AbstractRenderer.renderRegionViewport(AbstractRend erer.java:289) at org.apache.fop.render.intermediate.IFRenderer.renderRegionViewport(IFRen derer.java:731) at org.apache.fop.render.AbstractRenderer.renderPageAreas(AbstractRenderer. java:249) at org.apache.fop.render.AbstractRenderer.renderPage(AbstractRenderer.java: 230) at org.apache.fop.render.intermediate.IFRenderer.renderPage(IFRenderer.java :580) at org.apache.fop.area.RenderPagesModel.addPage(RenderPagesModel.java:114) at org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.finishPage(Ab stractPageSequenceLayoutManager.java:312) at org.apache.fop.layoutmgr.PageSequenceLayoutManager.finishPage(PageSequen ceLayoutManager.java:167) at org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.makeNewPage(A bstractPageSequenceLayoutManager.java:284) at org.apache.fop.layoutmgr.PageBreaker.handleBreakTrait(PageBreaker.java:5 26) at org.apache.fop.layoutmgr.PageBreaker.startPart(PageBreaker.java:429) at org.apache.fop.layoutmgr.AbstractBreaker.addAreas(AbstractBreaker.java:5 47) at org.apache.fop.layoutmgr.AbstractBreaker.addAreas(AbstractBreaker.java:4 97) at org.apache.fop.layoutmgr.PageBreaker.doPhase3(PageBreaker.java:308) at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:4 50) at org.apache.fop.layoutmgr.PageBreaker.doLayout(PageBreaker.java:85) at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSe quenceLayoutManager.java:107) at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java :238) at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:12 0) at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.j ava:349) at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:177) at net.sf.saxon.event.ContentHandlerProxy.endElement(ContentHandlerProxy.ja va:391) at net.sf.saxon.event.NamespaceReducer.endElement(NamespaceReducer.java:213 ) at net.sf.saxon.event.ReceivingContentHandler.endElement(ReceivingContentHa ndler.java:447) at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1528) at org.apache.crimson.parser.Parser2.content(Parser2.java:1779) at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507) at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500) at org.apache.crimson.parser.Parser2.parse(Parser2.java:305) at org.apache.c
RE: FOP trunk error message when run from ant
Do you have the xmlgraphics-commons-1.4svn.jar in your trunk lib path? New method for calling fonts? Is this on embedding code or just on running from a command line? I'm using the FOP classes with embedded code and my custom fonts are working nicely. -Original Message- From: Mario Madunic [mailto:mario_madu...@newflyer.com] Sent: Thursday, July 01, 2010 10:13 AM To: fop-users@xmlgraphics.apache.org Subject: FOP trunk error message when run from ant While running the trunk via ANT the build fails. The error message is at the bottom. Pieces I'm using Java 1.6.0_16 ANT 1.8.1 (just started using it today, was using 1.7 and received same error) Windows XP SP3 I executed the build by just typing ant in a cmd prompt. In the config file I added the font metrics for the time being from my 0.94 config file, as it still seems to be valid. Example below At the moment still trying to figure out the new method for calling fonts. (want to use Helvetica and encoding utf-8) Line 46 mentioned below of the build file (partsToPDF.xml) is (I receive the same error when using absolute paths, in case that makes a difference) Any help appreciated. Thanks BUILD FAILED c:\ publishingWorkflow\antTargets\partsToPDF.xml:46: java.lang.NoSuchMethodError: org.apache.xmlgraphics.java2d.GraphicContext.(Lorg/apache/xmlgraph ics/java2d/GraphicContext;)V at org.apache.fop.render.intermediate.IFGraphicContext.(IFGraphicCont ext.java:50) at org.apache.fop.render.intermediate.IFGraphicContext.clone(IFGraphicConte xt.java:56) at org.apache.fop.render.intermediate.IFRenderer.saveGraphicsState(IFRender er.java:632) at org.apache.fop.render.intermediate.IFRenderer.startViewport(IFRenderer.j ava:885) at org.apache.fop.render.intermediate.IFRenderer.startVParea(IFRenderer.jav a:878) at org.apache.fop.render.AbstractRenderer.renderRegionViewport(AbstractRend erer.java:289) at org.apache.fop.render.intermediate.IFRenderer.renderRegionViewport(IFRen derer.java:731) at org.apache.fop.render.AbstractRenderer.renderPageAreas(AbstractRenderer. java:249) at org.apache.fop.render.AbstractRenderer.renderPage(AbstractRenderer.java: 230) at org.apache.fop.render.intermediate.IFRenderer.renderPage(IFRenderer.java :580) at org.apache.fop.area.RenderPagesModel.addPage(RenderPagesModel.java:114) at org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.finishPage(Ab stractPageSequenceLayoutManager.java:312) at org.apache.fop.layoutmgr.PageSequenceLayoutManager.finishPage(PageSequen ceLayoutManager.java:167) at org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.makeNewPage(A bstractPageSequenceLayoutManager.java:284) at org.apache.fop.layoutmgr.PageBreaker.handleBreakTrait(PageBreaker.java:5 26) at org.apache.fop.layoutmgr.PageBreaker.startPart(PageBreaker.java:429) at org.apache.fop.layoutmgr.AbstractBreaker.addAreas(AbstractBreaker.java:5 47) at org.apache.fop.layoutmgr.AbstractBreaker.addAreas(AbstractBreaker.java:4 97) at org.apache.fop.layoutmgr.PageBreaker.doPhase3(PageBreaker.java:308) at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:4 50) at org.apache.fop.layoutmgr.PageBreaker.doLayout(PageBreaker.java:85) at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSe quenceLayoutManager.java:107) at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java :238) at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:12 0) at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.j ava:349) at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:177) at net.sf.saxon.event.ContentHandlerProxy.endElement(ContentHandlerProxy.ja va:391) at net.sf.saxon.event.NamespaceReducer.endElement(NamespaceReducer.java:213 ) at net.sf.saxon.event.ReceivingContentHandler.endElement(ReceivingContentHa ndler.java:447) at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1528) at org.apache.crimson.parser.Parser2.content(Parser2.java:1779) at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507) at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500) at org.apache.crimson.parser.Parser2.parse(Parser2.java:305) at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442) at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:397) at net.sf.saxon.event.Sender.send(Sender.java:182) at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:32) at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:299) at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:130) at org.apache.fop.tools.anttasks.FOPTaskStarter.renderInputHandler(Fop.java :657) at org.apache.fop.tools.anttasks.FOPTaskStarter.render(Fop.java:680) at org.apache.fop.tools.anttasks.FOPTaskStarter.run(Fop.java:539) at org.apache.fop.tools.anttasks.Fop.execute(Fop.java:368) at org.apache.tools.ant.UnknownElement.execute(Unknow
FOP trunk error message when run from ant
While running the trunk via ANT the build fails. The error message is at the bottom. Pieces I'm using Java 1.6.0_16 ANT 1.8.1 (just started using it today, was using 1.7 and received same error) Windows XP SP3 I executed the build by just typing ant in a cmd prompt. In the config file I added the font metrics for the time being from my 0.94 config file, as it still seems to be valid. Example below At the moment still trying to figure out the new method for calling fonts. (want to use Helvetica and encoding utf-8) Line 46 mentioned below of the build file (partsToPDF.xml) is (I receive the same error when using absolute paths, in case that makes a difference) Any help appreciated. Thanks BUILD FAILED c:\ publishingWorkflow\antTargets\partsToPDF.xml:46: java.lang.NoSuchMethodError: org.apache.xmlgraphics.java2d.GraphicContext.(Lorg/apache/xmlgraphics/java2d/GraphicContext;)V at org.apache.fop.render.intermediate.IFGraphicContext.(IFGraphicContext.java:50) at org.apache.fop.render.intermediate.IFGraphicContext.clone(IFGraphicContext.java:56) at org.apache.fop.render.intermediate.IFRenderer.saveGraphicsState(IFRenderer.java:632) at org.apache.fop.render.intermediate.IFRenderer.startViewport(IFRenderer.java:885) at org.apache.fop.render.intermediate.IFRenderer.startVParea(IFRenderer.java:878) at org.apache.fop.render.AbstractRenderer.renderRegionViewport(AbstractRenderer.java:289) at org.apache.fop.render.intermediate.IFRenderer.renderRegionViewport(IFRenderer.java:731) at org.apache.fop.render.AbstractRenderer.renderPageAreas(AbstractRenderer.java:249) at org.apache.fop.render.AbstractRenderer.renderPage(AbstractRenderer.java:230) at org.apache.fop.render.intermediate.IFRenderer.renderPage(IFRenderer.java:580) at org.apache.fop.area.RenderPagesModel.addPage(RenderPagesModel.java:114) at org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.finishPage(AbstractPageSequenceLayoutManager.java:312) at org.apache.fop.layoutmgr.PageSequenceLayoutManager.finishPage(PageSequenceLayoutManager.java:167) at org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.makeNewPage(AbstractPageSequenceLayoutManager.java:284) at org.apache.fop.layoutmgr.PageBreaker.handleBreakTrait(PageBreaker.java:526) at org.apache.fop.layoutmgr.PageBreaker.startPart(PageBreaker.java:429) at org.apache.fop.layoutmgr.AbstractBreaker.addAreas(AbstractBreaker.java:547) at org.apache.fop.layoutmgr.AbstractBreaker.addAreas(AbstractBreaker.java:497) at org.apache.fop.layoutmgr.PageBreaker.doPhase3(PageBreaker.java:308) at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:450) at org.apache.fop.layoutmgr.PageBreaker.doLayout(PageBreaker.java:85) at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:107) at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:238) at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:120) at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:349) at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:177) at net.sf.saxon.event.ContentHandlerProxy.endElement(ContentHandlerProxy.java:391) at net.sf.saxon.event.NamespaceReducer.endElement(NamespaceReducer.java:213) at net.sf.saxon.event.ReceivingContentHandler.endElement(ReceivingContentHandler.java:447) at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1528) at org.apache.crimson.parser.Parser2.content(Parser2.java:1779) at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507) at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500) at org.apache.crimson.parser.Parser2.parse(Parser2.java:305) at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442) at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:397) at net.sf.saxon.event.Sender.send(Sender.java:182) at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:32) at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:299) at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:130) at org.apache.fop.tools.anttasks.FOPTaskStarter.renderInputHandler(Fop.java:657) at org.apache.fop.tools.anttasks.FOPTaskStarter.render(Fop.java:680) at org.apache.fop.tools.anttasks.FOPTaskStarter.run(Fop.java:539) at org.apache.fop.tools.anttasks.Fop.execute(Fop.java:368) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:390) at org.apache.tools.ant.Target.performTasks(
Images not found!!!
Hi All, we are upgrading the FOP 0.25 to 0.95. We did all the necessary changes to the java code to convert XML to PDF. We modified the xls for empty cells and tested few xsl. The xsls which doesn't have images are printing fine. The ones which have the images are not printing properly i mean we are getting blank space in place of image. We checked the url path where the images are placed in our server..looks fine. We replaced the fop driver and configuration settings(fop 0.95) with fopFactory and foUserAgent(fop 0.95). At some place in our code we were using the below statement, configuration.put("dir", url); now we replaced the above file with fopfactory.setBaseURL(url); i think its causing problem but i am not sure... we are trying to figure out ... the exact error is "org.apache.fop.fo.flow.ExternalGraphic bind Image not found: images/emptybox.jpg". can anyone know about this issue ... pls help me. Thanks, Mamatha.