Re: odd error from 0.93
On Thu, 01 Mar 2007 00:30:50 +0100, Andreas L Delmelle wrote: On Mar 1, 2007, at 00:25, Andreas L Delmelle wrote: Worked like a charm! Thanks so much, arturo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: odd error from 0.93
On Fri, 23 Feb 2007 16:01:13 +0100, Andreas L Delmelle wrote: On Feb 23, 2007, at 13:38, Andreas L Delmelle wrote: Arturo, After closer inspection of the FO, I don't think it is a bug. Strictly speaking, you weren't doing anything wrong, only something that the XSL-FO Recommendation leaves a bit vague IMO... You're specifying width=100% on the fo:table-cells in question. Thanks, Andreas, I've removed that and the error goes away. Unfortunately, so does the border on the table-cells. Before I spend too much effort figuring what's broken on my end, can you tell me the proper way to have borders on all the cells of a table? I know collapse doesn't work 100% (which would be ideal) but I've poked at it some and I'm not having any luck getting the cell borders to come back. tia, arturo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem using custom EntityResolver with fop 0.92
On Thu, 22 Feb 2007 23:22:11 +0100, Andreas L Delmelle wrote: On Feb 22, 2007, at 23:12, Arturo Perez wrote: On Thu, 22 Feb 2007 22:08:58 +0100, Andreas L Delmelle wrote: Before we go any further: Did you try Jeremias' suggestion and set the URIResolver on both the FopFactory and the TransformerFactory? During one iteration I put the URIResolver on every XMLReader created by that codepath. Same problem. Is that different than what you/Jeremy suggested? To follow Jeremias' suggestion to the letter, try adding: stf.setURIResolver(ArticleHelper.getURIResolver()); right after you get the SAXTransformerFactory instance. HTH! Cheers, Andreas So, doing the below I still got the error: Can not load requested doc: unknown protocol: urn Fop fop = FOPConfigurator.newFop(outStream); SAXTransformerFactory stf = (SAXTransformerFactory)TransformerFactory.newInstance(); Transformer transformer = stf.newTransformer(); transformer.setURIResolver(ArticleHelper.getURIResolver()); //Make sure the XSL transformation's result is piped through to FOP Result res = new SAXResult(fop.getDefaultHandler()); grrr! arturo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem using custom EntityResolver with fop 0.92 (RESOLVED)
Apparently, it's not the FOP transformer that needs the URIResolver. It's a TransformFilter somewhere in the chain. I stuck the URIResolver on that and now I have bugs I can deal with on my own :-) thanks all for the patience and understanding, arturo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem using custom EntityResolver with fop 0.92
On Sun, 18 Feb 2007 10:04:05 -0500, Arturo Perez wrote: In article [EMAIL PROTECTED], Andreas L Delmelle [EMAIL PROTECTED] wrote: On Feb 18, 2007, at 10:19, Jeremias Maerki wrote: snip / Arturo, I don't know how you use the EntityResolver in your code, but I'd propose to switch to URIResolver entirely. Seems like the best option indeed. Just FYI: As to an alternative, looking a bit closer into the API docs, an EntityResolver is supposed to be set on an org.xml.sax.XMLReader instance, through its setEntityResolver() method. The XMLReader here being the reader that will be used by Xalan to parse the stylesheet. Cheers, Andreas I haven't had a chance to try this. But, in the interest of clarity, I have the EntityResolver working in my code for XSLT. And I have the URIResolver working as well. But PDF generation using FOP 0.92 doesn't seem to be using either. Maybe all the XMLFilters in that process are interfering? -arturo I really need help on making this work with 0.92beta. I could probably upgrade to 0.93 if that works better. Please note that I have this working for a plain XSL that converts XML to HTML where FOP is not involved. I put the URIResolver on the FOPFactory like this: fopFactory.setURIResolver(ArticleHelper.getURIResolver()); The transforming code for the PDF looks like: InputSource inputSource = new InputSource(new ByteArrayInputStream(xmlBytes)); Templates articleTemplates =TemplatesManager.getTemplates(transformName); TransformFilter foFilter = new TransformFilter(articleTemplates); Transformer transformer = foFilter.getTransformer(); Templates psmiTemplates = TemplatesManager.getTemplates(psmi); SAXTransformerFactory stf = (SAXTransformerFactory)TransformerFactory.newInstance(); XMLFilter psmiFilter = stf.newXMLFilter(psmiTemplates); // Set up to read the input file XMLReader reader = source.getXMLReader(); if (reader == null) { SAXParserFactory spf = SAXParserFactory.newInstance(); spf.setNamespaceAware(true); SAXParser parser = spf.newSAXParser(); reader = parser.getXMLReader(); } // Add a filter to look for characters outside the standard font and send remapped // events to the child filter. XMLFilter fontFilter = new FontRemappingFilter(); foFilter.setParent(reader); psmiFilter.setParent(foFilter); fontFilter.setParent(psmiFilter); SAXSource pdfSource = new SAXSource(fontFilter,SAXSource.sourceToInputSource(source)); Fop fop = FOPConfigurator.newFop(outStream); SAXTransformerFactory stf = (SAXTransformerFactory)TransformerFactory.newInstance(); Transformer transformer = stf.newTransformer(); //Make sure the XSL transformation's result is piped through to FOP Result res = new SAXResult(fop.getDefaultHandler()); transformer.transform(source, res); My URIResolver just prints log statements when it is called. The style sheet has a document call like this: document('urn:hayesinc:report:abc') This is the log output. The URIResolver is never called for the urn. It is called for all kinds of other things: jndi:/localhost/xsl; Line #77; Column #94; Can not load requested doc: unknown protocol: urn ArticleHelper- resolve: graphics/pdf_logo_healthcareTechBrief.jpg jndi:/localhost/fop/ ArticleHelper- resolve: graphics/bottom_left_cornice.svg jndi:/localhost/fop/ ArticleHelper- resolve: arialbd.xml jndi:/localhost/fonts/ ArticleHelper- resolve: en.hyp jndi:hyphenation ArticleHelper- resolve: en.xml jndi:hyphenation ArticleHelper- resolve: arialbi.xml jndi:/localhost/fonts/ ArticleHelper- resolve: ariali.xml jndi:/localhost/fonts/ 2007-02-22 15:25:26,353 [articleId=3374] WARN org.apache.fop.area.AreaTreeModel- Page 1: Unresolved id reference htpBeginning found. ArticleHelper- resolve: ARIALI.ttf jndi:/localhost/fonts/ ArticleHelper- resolve: ARIALBI.ttf jndi:/localhost/fonts/ ArticleHelper- resolve: ARIALBD.ttf jndi:/localhost/fonts/ ArticleHelper- resolve: ARIAL.ttf jndi:/localhost/fonts/ ArticleHelper- resolve: arial.xml jndi:/localhost/fonts/ ArticleHelper- resolve: ariali.xml jndi:/localhost/fonts/ ArticleHelper- resolve: ARIALI.ttf jndi:/localhost/fonts/ ArticleHelper- resolve: ARIAL.ttf jndi:/localhost/fonts/ The unresolved id is supposed to come from the xml loaded by the document() call. Help please, tia, arturo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem using custom EntityResolver with fop 0.92
On Thu, 22 Feb 2007 22:08:58 +0100, Andreas L Delmelle wrote: On Feb 22, 2007, at 21:55, Arturo Perez wrote: Arturo, Before we go any further: Did you try Jeremias' suggestion and set the URIResolver on both the FopFactory and the TransformerFactory? Cheers, Andreas During one iteration I put the URIResolver on every XMLReader created by that codepath. Same problem. Is that different than what you/Jeremy suggested? -arturo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem using custom EntityResolver with fop 0.92
In article [EMAIL PROTECTED], Andreas L Delmelle [EMAIL PROTECTED] wrote: On Feb 18, 2007, at 10:19, Jeremias Maerki wrote: snip / Arturo, I don't know how you use the EntityResolver in your code, but I'd propose to switch to URIResolver entirely. Seems like the best option indeed. Just FYI: As to an alternative, looking a bit closer into the API docs, an EntityResolver is supposed to be set on an org.xml.sax.XMLReader instance, through its setEntityResolver() method. The XMLReader here being the reader that will be used by Xalan to parse the stylesheet. Cheers, Andreas I haven't had a chance to try this. But, in the interest of clarity, I have the EntityResolver working in my code for XSLT. And I have the URIResolver working as well. But PDF generation using FOP 0.92 doesn't seem to be using either. Maybe all the XMLFilters in that process are interfering? -arturo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem using custom EntityResolver with fop 0.92
In article [EMAIL PROTECTED], Jeremias Maerki [EMAIL PROTECTED] wrote: http://xmlgraphics.apache.org/fop/0.93/embedding.html#fop-factory I had already been setting the URIResolver and that doesn't seem to work either. My document calls would look like document('urn:hayesinc:report:id') and no matter what I get urn: unknown protocol. I'll try again but I am sure I am missing something here. At the very least, I should be setting the UserAgent URIResolver? -arturo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem using custom EntityResolver with fop 0.92
Hi all, I'm trying to redo a bunch of XSL logic to use my own EntityResolver for document() calls. I'm using Xalan SAX to do the XSL. My EntityResolver is being called by everything except FOP 0.92beta. I cannot find where to force FOP to use my EntityResolver rather than (I guess) the DefaultHandler. Any help in where to put the right call to setEntityResolver() would be much appreciated, arturo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
odd error from 0.93
Just tried 0.93. I have been using 0.92beta. I get this error and my PDF looks horrible. ERROR org.apache.fop.layoutmgr.AbstractBaseLayoutManager- Cannot find LM to handle given FO for LengthBase. What did I do wrong? -arturo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Programmatically set hyphenation-base
Title: Programmatically set hyphenation-base Hi all, I've pored over the documentation for 0.92beta but I don't see any API for setting the hyphenation-base user configuration parameter, unlike the situation with font-base. Is there in fact no way to set it when FOP is embedded in a servlet? If so, any suggestions for what I should set it to? tia, arturo
Re: FOP 0.92b Logger
Heinzer David heinzer.david at wanadoo.fr writes: Thanks a lot everybody for your help ! :) Now, with all your advises, I will try to resolve my problem... :) It's right log4j is very powerful, I made some examples to understand its use, it's relatively easy. But if I understand well, with FOP, the only thing to do is to configure the ouput display with configuration of Jakarta, the abstract layer between FOP and , by example, log4j. Arturo, if you always agree, I will be interesting for your code. I thank you in advance. Best regards Heinzer David heinzer.david AT wanadoo.fr Here's what I do: // this part goes just before you start the FOP rendering process Logger fopLogger = Logger.getLogger(org.apache.fop); NullOutputStream errorOutput = new NullOutputStream(); Appender errorAppender = new WriterAppender(new ActionErrorLayout(errors, infoMsgs), errorOutput); fopLogger.addAppender(errorAppender); // this class converts the LoggingEvent into Struts ActionMessage. class ActionErrorLayout extends Layout { ActionErrors errors; ActionMessages messages; public ActionErrorLayout(ActionErrors errors, ActionMessages infoMsgs) { this.errors = errors; this.messages = infoMsgs; } public String format(LoggingEvent arg0) { if (arg0.getLevel() == org.apache.log4j.Level.ERROR) { ActionError nextError = new ActionError(error.SAXErrorWrapper, arg0.getMessage()); errors.add(ActionErrors.GLOBAL_ERROR, nextError); } else { ActionMessage nextMsg = new ActionMessage(error.SAXErrorWrapper, arg0.getMessage()); messages.add(ActionMessages.GLOBAL_MESSAGE, nextMsg); } return ; } public boolean ignoresThrowable() { return true; } public void activateOptions() { } } HTH, arturo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: page-number-citation not working in 0.92?
Perez arturo at ethicist.net writes: In article BAY102-DAV4F05FF37FD396E2588738FB7E0 at phx.gbl, Chris Bowditch bowditch_chris at hotmail.com wrote: Arturo Perez wrote: Hi all, I am concatenating via XSL a bunch of XML files and then trying to set up references and page numbers for a TOC. But it looks like forward references aren't working in 0.92 (got that from an old posting). -arturo OK, I have a workaround. If the page-number-citation refers to an id on a table-row it does not work. When the id is placed on a block then it does work. I think the page-number-citation is supposed to work in either case? Or am I wrong about that? There's the whole business of normal area that I don't get. thanks all, arturo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: page-number-citation not working in 0.92?
Jeremias Maerki dev at jeremias-maerki.ch writes: On 27.06.2006 17:03:18 Arturo Perez wrote: Perez arturo at ethicist.net writes: There's the whole business of normal area that I don't get. What's that about? The term normal area is defined in the XSL 1.0 spec in chapter 4.2.5 Stacking Constraints. FOP itself does not maintain the area-class trait in code, however. If there's anything specific I can explain, tell me. Jeremias Maerki I think everything is working as advertised so I am all set. I was thinking that the table-row id didn't work because maybe it wasn't a normal area. I see the compliance page addresses the issue. Unfortunately I don't have all those things internalized yet (that is, the compliance page, the XSL spec, et al). Thanks again for all the help. -arturo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ClassCastException in list-block code
Jeremias Maerki wrote: Looks like one of our smaller consistency problems. The ListBlockLayoutManager cannot deal with inline-level FOs as its parent. We'll have to fix that. In the meantime, wrap your list-block in a block and you should be fine. Hi Arturo, After reading your fo file, I've identified what did not do the job: fo:inline containing a fo:list-block. (see the snippet in fine) Removing the (*SSD^) completely unnecessary inline fixed the problem. Thanks all, -arturo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
page-number-citation not working in 0.92?
Hi all, I am concatenating via XSL a bunch of XML files and then trying to set up references and page numbers for a TOC. But it looks like forward references aren't working in 0.92 (got that from an old posting). Any workarounds? Except for the put the TOC at the end one? :-) tia, arturo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Large table cell crashes fop92
Jeremias Maerki dev at jeremias-maerki.ch writes: The marker thing I put in for 0.92 but I think I get the same crash under 0.20.5. Really? 0.20.5's layout engine is working completely differently. I can't imagine you get the same error. Not exactly the same but it looks similar enough. java.lang.ArrayIndexOutOfBoundsException: -2 at org.apache.fop.fo.flow.TableRow$CellArray.getNextFreeCell(TableRow.ja va:134) at org.apache.fop.fo.flow.TableRow.initCellArray(TableRow.java:512) at org.apache.fop.fo.flow.TableRow.layout(TableRow.java:275) at org.apache.fop.fo.flow.AbstractTableBody.layout(AbstractTableBody.jav a:236) at org.apache.fop.fo.flow.Table.layout(Table.java:302) at org.apache.fop.fo.flow.AbstractFlow.layout(AbstractFlow.java:154) So the cause is an emtpy table cell? Or is it a cell that wraps and the wrapping doesn't create anything? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Large table cell crashes fop92
Hi all, I have a very large table-cell that crashes fop-0.92beta. The cell in question seems to be 11.75 inches tall while the page is only allowed to be 8in in the page-sequence. I found this out by playing with the page-sequence/region definitions. Any suggestions on how to work around it? Here's the beginning of the stack trace. java.lang.NullPointerException at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:167) at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:114) at org.apache.fop.cli.Main.startFOP(Main.java:159) at org.apache.fop.cli.Main.main(Main.java:190) - java.lang.NullPointerException at org.apache.fop.layoutmgr.AbstractLayoutManager.isFirst(AbstractLayout Manager.java:349) at org.apache.fop.layoutmgr.AreaAdditionUtil.addAreas(AreaAdditionUtil.j ava:90) at org.apache.fop.layoutmgr.table.TableCellLayoutManager.addAreas(TableC ellLayoutManager.java:418) at org.apache.fop.layoutmgr.table.TableContentLayoutManager$RowPainter.a ddAreasForCell(TableContentLayoutManager.java:973) at org.apache.fop.layoutmgr.table.TableContentLayoutManager$RowPainter.a ddAreasAndFlushRow(TableContentLayoutManager.java:925) at org.apache.fop.layoutmgr.table.TableContentLayoutManager$RowPainter.h andleTableContentPosition(TableContentLayoutManager.java:782) at org.apache.fop.layoutmgr.table.TableContentLayoutManager.iterateAndPa intPositions(TableContentLayoutManager.java:740) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem using svg image on both fop.0.20 and fop.0.92beta
Jeremias Maerki dev at jeremias-maerki.ch writes: This problem is now documented in our FAQ: http://xmlgraphics.apache.org/fop/faq.html#svg-attribute-required I put in the Xalan2.7 into the endorsed library (and serializer.jar, it needs that too) but I still get the same problem on 0.92 It looks like I'll have to wait for a fixed Batik for this to be resolved? If so, is there a timeframe for that? tia, -arturo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem using svg image on both fop.0.20 and fop.0.92beta
Jeremias Maerki dev at jeremias-maerki.ch writes: Make sure you have it in the jdk-home/jre/lib/endorsed directory if you've installed a JDK rather than a JRE. In my jre/lib/endorsed directory for Sun JDK 1.4.2_10 I have the following JARs: - serializer-2.7.0.jar - xalan-2.7.0.jar - xercesImpl-2.7.1.jar - xml-apis-1.3.02.jar Looks like I ran into path (not classpath) problems with Java. It's working fine now that I've straighted that out. Thanks again, -arturo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]