using FOP under JRE 1.6
Hi, i try to start FOP (0.94) without xalan under JRE 1.6 If i right understud the docs, i can omit xalan and co. if i use JDK > 1.4 (JAXP) Without using xalan i get problems: java.lang.NoClassDefFoundError: org/apache/xml/utils/URI$MalformedURIException at org.apache.fop.fonts.FontCache.addFont(FontCache.java:246) at org.apache.fop.render.PrintRendererConfigurator.getFontInfoFromConfiguration(PrintRendererConfigurator.java:313) at org.apache.fop.render.PrintRendererConfigurator.buildFontListFromConfiguration(PrintRendererConfigurator.java:196) at org.apache.fop.render.PrintRendererConfigurator.configure(PrintRendererConfigurator.java:93) at org.apache.fop.render.pdf.PDFRendererConfigurator.configure(PDFRendererConfigurator.java:70) at org.apache.fop.render.RendererFactory.createRenderer(RendererFactory.java:187) at org.apache.fop.area.RenderPagesModel.(RenderPagesModel.java:70) at org.apache.fop.area.AreaTreeHandler.setupModel(AreaTreeHandler.java:126) at org.apache.fop.area.AreaTreeHandler.(AreaTreeHandler.java:101) at org.apache.fop.render.RendererFactory.createFOEventHandler(RendererFactory.java:224) at org.apache.fop.fo.FOTreeBuilder.(FOTreeBuilder.java:99) at org.apache.fop.apps.Fop.createDefaultHandler(Fop.java:147) at org.apache.fop.apps.Fop.(Fop.java:82) at org.apache.fop.apps.FopFactory.newFop(FopFactory.java:226) … I use my own generated font metrics. They are configured in fop.xconf file. After debuging i found that the class "CachedFontInfo" has a dependency to org.apache.xml.utils.URI.MalformedURIException which is a xalan class. Does it mean i HAVE to use xalan? Or i do something wrong? thans a lot Dmitri - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
using FOP under JRE 1.6
Hi, i try to start FOP (0.94) without xalan under JRE 1.6 If i right understud the docs, i can omit xalan and co. if i use JDK > 1.4 Without xalan i get problems: java.lang.NoClassDefFoundError: org/apache/xml/utils/URI$MalformedURIException at org.apache.fop.fonts.FontCache.addFont(FontCache.java:246) at org.apache.fop.render.PrintRendererConfigurator.getFontInfoFromConfigura tion(PrintRendererConfigurator.java:313) at org.apache.fop.render.PrintRendererConfigurator.buildFontListFromConfigu ration(PrintRendererConfigurator.java:196) at org.apache.fop.render.PrintRendererConfigurator.configure(PrintRendererC onfigurator.java:93) at org.apache.fop.render.pdf.PDFRendererConfigurator.configure(PDFRendererC onfigurator.java:70) at org.apache.fop.render.RendererFactory.createRenderer(RendererFactory.jav a:187) at org.apache.fop.area.RenderPagesModel.(RenderPagesModel.java:70) at org.apache.fop.area.AreaTreeHandler.setupModel(AreaTreeHandler.java:126) at org.apache.fop.area.AreaTreeHandler.(AreaTreeHandler.java:101) at org.apache.fop.render.RendererFactory.createFOEventHandler(RendererFacto ry.java:224) at org.apache.fop.fo.FOTreeBuilder.(FOTreeBuilder.java:99) at org.apache.fop.apps.Fop.createDefaultHandler(Fop.java:147) at org.apache.fop.apps.Fop.(Fop.java:82) at org.apache.fop.apps.FopFactory.newFop(FopFactory.java:226) ... I use my own generated font metrics. They are configured in fop.xconf file. What do i do wrong? thans a lot Dmitri
Re: Fop layout question
Thanks Jeremias. This is exactly the type of information I was looking for. I will try to work out a few examples of my own the coming days to make sure I understand what is going on. Peter -- View this message in context: http://www.nabble.com/Fop-layout-question-tf4815030.html#a13790353 Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: filtering SVG
Jeremias, I might have to resolve to that...i am having difficulties inserting text into an existing element... So far I have, but I still need the first template to apply template so I can get to the second template... marker { overflow:visible; } Tx (also Pascal).. I will probably try the URI Resolver.. -Original Message- From: Jeremias Maerki [mailto:[EMAIL PROTECTED] Sent: 16 November 2007 10:40 To: fop-users@xmlgraphics.apache.org Subject: Re: filtering SVG In addition to what Pascal suggested: You can plug in a custom URIResolver. When the image package redesign is completed you should also be able to return a DOMSource as the result of URI resolution. At the moment you have to return an InputStream. Jeremias Maerki On 16.11.2007 09:55:05 Raphael Parree wrote: > Hi, > > > > I was wondering if the following is possible and what would be the best > approach. We use a lot of SVG (exported from Visio). These SVG always need a > manual fix to make line ends (arrow etc) visible: > > > > > > > > > > > > I would like to insert this style element to each svg during generation. The > SVGs are added as external images. So I would need some sort of image filter > to add this to the DOM tree of the SVG. > > > > Is this possible, and what would be the best approach.? > > > > Tx., > > > > Raphael > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: filtering SVG
Hi, I had a similar problem in the past: replace all texts in SVG with localized one. This can be done at the XSLT stage: - parse the SVG with the document() function; - use fo:instrem-foreign-object instead of fo:external-graphic HTH, Pascal > -Message d'origine- > De : Raphael Parree [mailto:[EMAIL PROTECTED] > Envoyé : vendredi 16 novembre 2007 09:55 > > Hi, > > I was wondering if the following is possible and what would > be the best approach. We use a lot of SVG (exported from > Visio). These SVG always need a manual fix to make line ends > (arrow etc) visible: > > > > > > I would like to insert this style element to each svg during > generation. The SVGs are added as external images. So I would > need some sort of image filter to add this to the DOM tree of the SVG. > > Is this possible, and what would be the best approach...? > > Raphael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Capturing FOP logging message event in an embedded application using FOP 0.94
(comments inline below) On 16.11.2007 01:06:08 Andreas L Delmelle wrote: > Probably the better way for FOP (well, it's a start): > -> implement a more generic org.apache.fop.apps.Log, that raises > events on an associated Listener > -> set the above config attribute on LogFactory prior to doing > anything else, except > -> offer the user a hook to plug in a custom event handler Please note that this is something that will be addressed in the next few months (it's going up in my priority list). I don't like just piping log output to the user/caller. I have different ideas that should address the needs better than just a massive stream of log output. I like to differentiate between information for the FOP developer (logging) and for the FOP user (processing feedback). Please track the following Wiki page: http://wiki.apache.org/xmlgraphics-fop/ProcessingFeedback I'm probably getting to that in December or January at which point I'll initiate a serious design discussion. > The Log instance that raises the events should ideally be tied to the > FOUserAgent. > > Still unsure how to fit in the static loggers :/ > Maybe, to minimize the amount of refactoring, FTM we could do: > -> implement a simple org.apache.fop.apps.StaticLog > -> initialize all static loggers in static blocks and call > LogFactory.setAttribute() to use this type > > The StaticLog.info() events and above, could get overloads that > accept an instance-based logger (the one tied to the user agent) on > which they register those events. > Should you decide to take steps in this direction, since this is > becoming a rather pressing matter, IMO, I'm willing to invest some > time in this as well. For a client, I've hacked together something using ThreadLocals in Log4J so you can grab all log output per rendering run (as long as we don't do multi-threading inside FOP). http://www.jeremias-maerki.ch/download/fop/log4j-threadlocal-appender.zip You just have to implement ThreadLocalLogInterceptor to get the log output. One instance per rendering run. Before you call FOP, you call ThreadLocalLogSetup.installLogIntercepter() with your interceptor instance in the same thread that you will run FOP. After the rendering run, uninstall it again using ThreadLocalLogSetup.uninstallLogIntercepter(). This only works for Log4J so you have to configure Commons Logging to use Log4J. But this could easily be adapted to work with Commons Logging directly. But maybe that helps as a work-around until we have a proper processing feedback mechanism. Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: filtering SVG
In addition to what Pascal suggested: You can plug in a custom URIResolver. When the image package redesign is completed you should also be able to return a DOMSource as the result of URI resolution. At the moment you have to return an InputStream. Jeremias Maerki On 16.11.2007 09:55:05 Raphael Parree wrote: > Hi, > > > > I was wondering if the following is possible and what would be the best > approach. We use a lot of SVG (exported from Visio). These SVG always need a > manual fix to make line ends (arrow etc) visible: > > > > > > > > > > > > I would like to insert this style element to each svg during generation. The > SVGs are added as external images. So I would need some sort of image filter > to add this to the DOM tree of the SVG. > > > > Is this possible, and what would be the best approach.? > > > > Tx., > > > > Raphael > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: BreakingAlgorithm Problem
On Friday 16 November 2007 17:33, Andreas L Delmelle wrote: > On Nov 16, 2007, at 09:29, fma-001 wrote: > > Hi > > > thanks for your hint. I wrote a template, which checks if there are > > some > > non-letter-characters (like '.', '/'; etc.). If this is the case, I > > concat > > the string after each character with Unicode Zero Width Space > > (''), > > but then FOP 0.93 overlaps letters. I also tried FIGURE SPACE > > ('&x#2007;'), > > but then FOP does break it half way ... very strange. Here my code > > snippet: > > > > > > > > > > > > > > > > > > Any idea, why FOP0.93 is doing it that way? > > Yes, this was a bug in 0.93 IIRC. Upgrading to 0.94 should resolve > the issue. In addition 0.94 should break at the '/' character automatically, i.e. it should break typical URLs. However, it will not break on '.' not followed by whitespace (if it did if could have very unfortunate effects on numbers like $12.50). > > HTH! > > Andreas > Manuel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: BreakingAlgorithm Problem
On Nov 16, 2007, at 09:29, fma-001 wrote: Hi thanks for your hint. I wrote a template, which checks if there are some non-letter-characters (like '.', '/'; etc.). If this is the case, I concat the string after each character with Unicode Zero Width Space (''), but then FOP 0.93 overlaps letters. I also tried FIGURE SPACE ('&x#2007;'), but then FOP does break it half way ... very strange. Here my code snippet: Any idea, why FOP0.93 is doing it that way? Yes, this was a bug in 0.93 IIRC. Upgrading to 0.94 should resolve the issue. HTH! Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
filtering SVG
Hi, I was wondering if the following is possible and what would be the best approach. We use a lot of SVG (exported from Visio). These SVG always need a manual fix to make line ends (arrow etc) visible: I would like to insert this style element to each svg during generation. The SVGs are added as external images. So I would need some sort of image filter to add this to the DOM tree of the SVG. Is this possible, and what would be the best approach.? Tx., Raphael
Re: Fop layout question
Of course, there are some more properties that can influence the placing of the text so the following calculations are only exemplary and only restricted to the scenario you posted. However, there's one problem with your example to start with: You specify font-family and font-size on the inline, but the dominant baseline is actually defined by the font on the parent block which is undefined in your example (depends on parent values not visible in the example). So let me rework your example to make it simpler. I assume you want to do this to exactly position text on a page, maybe to fill out some form. That's why you need exact information on how the placing is performed. Correct me if I'm wrong. The adjusted example: Some test The block-container has fixed positioning on coordinate 0/0, so it has the upper left corner in exactly the upper left corner of the sheet of paper. The first block has a margin-top which is internally translated to a space-before of the same length with its conditionality subproperty set to retain (it is always shown). Let's assume for this example that the font is "Helvetica". Here are the essential font metrics for Helvetica: ascender = 718 descender = -207 These values can be found if you look into the XML font metrics file that you can generate from a font with PFMReader and TTFReader. We need to calculate some other helper variables: font box = font-size * (font.ascender - font.descender) (area tree: text/@bpd) block-height = font-size * line-height (area tree: block/@bpd) half-leading is defined through the line-height property. half-leading = (block-height - font box) / 2 (area tree: lineArea/@space-before and lineArea/@space-after) baseline = font-size * ascender (area tree: text/@baseline) So not the absolute coordinate baseline of "Some test": x = 0 (because it's left aligned, no start-indent) y = aa + half-leading + baseline aa = block.margin-top = block.space-before = 20 pt = 2 mpt bb = line-height = 1.2 font-family = Helvetica cc = font-size = 12 pt = 12000 mpt font box = 12 pt * (718 - -207) = 11100 mpt block-height = 12000 mpt * 1.2 = 14400 mpt half-leading = (14400 mpt - 11000 mpt) / 2 = 1650 mpt baseline = 12 pt * 718 = 8616 mpt y = 2 + 1650 + 8616 = 30266 mpt Some pointers to the spec: http://www.w3.org/TR/xsl11/#line-height http://www.w3.org/TR/xsl11/#area-line (line areas are much more complicated than the above example shows!) I hope that's what you wanted. Jeremias Maerki On 15.11.2007 17:35:56 Peter Coppens wrote: > > Gentlepeople > > Assume the following fo structure > >left="0.0pt" > height="280pt" absolute-position="fixed"> > > > > > Some test > > > > > > > I am trying to figure where the base line (let's say) of the characters will > end up based on the values of margin-top, line-height and possibly the > relevant font properties > > Would anyone have any pointers to information that would help me to get > started. I am sure it's in the fo spec, but i have not enough time to try > and get my brain around that document (assuming I would ever succeed). > > Many thanks indeed! > > Peter > -- > View this message in context: > http://www.nabble.com/Fop-layout-question-tf4815030.html#a13774821 > Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: BreakingAlgorithm Problem
Hi Kumar, thanks for your hint. I wrote a template, which checks if there are some non-letter-characters (like '.', '/'; etc.). If this is the case, I concat the string after each character with Unicode Zero Width Space(''), but then FOP 0.93 overlaps letters. I also tried FIGURE SPACE ('&x#2007;'), but then FOP does break it half way ... very strange. Here my code snippet: Any idea, why FOP0.93 is doing it that way? Thanks in advance, Franz Puppala, Kumar (LNG-CON) wrote: > > You could insert a Unicode Zero Width Space () after each > character within your table-cell. That should enable the word to break > properly without overflowing into the next cell. > > However, if the same logic is applied to some standard text (which can > hyphenate) it will no longer hyphenate. > > Thanks, > Kumar > -- View this message in context: http://www.nabble.com/BreakingAlgorithm-Problem-tf4806438.html#a13788523 Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]