Re: xsl:apply-templates
I think so; something similar to [1] -- but with something under the xsl:otherwise that you would want to see in the PDF in the case where there are no team members. Glen [1] http://marc.theaimsgroup.com/?l=fop-userm=110969377910177w=2 --- Ben Gill [EMAIL PROTECTED] wrote: Hi, I am using apply-templates, but would like to always spit out one child (ie.TeamMemeber) entry in the PDF doc. At the momment, if there is no TeamMember, nothing gets written to the PDF document.. Is there a clever way of telling XSL to spit out at least one child anyway? or is the solution to dump out some empty XML from the ProjectTeamXMLReader? Thanks This message has been checked for all known viruses by the MessageLabs Virus Control Centre. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RTF Renderer from command line?
RTF support in Cocoon is done through JFOR. JFOR, in the meantime, has been integrated into FOP but has been no release so far. FOP 0.20.5 contains no RTF-support. If you want RTF support you can download FOP from CVS (tag HEAD). Please note that the code is not in a releasable state. Use at your own risk or use JFOR for now. The code in CVS supports creating RTF through the command-line. On 10.03.2005 20:34:13 Siegfried Heintze wrote: I remember installing cocoon two years ago and getting rtf documents. Now I am using the command line and the documentation says the rtf renderer is not there by default! Why is this? Is there any documentation on where to get the rtf renderer and using it from the command line utility? Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FopServlet
Here's a modified version of the servlet: http://cvs.apache.org/~jeremias/FopServlet.java BTW, while updating the file I found an opportunity for a little optimization. In the servlet's case the ByteArrayOutputStream should not be instantiated with the default constructor. This only allocates 64 bytes initially. Every time the buffer runs out of space the old buffer is discarded and a new one with twice the previous space is allocated. If you do new ByteArrayOutputStream(16384) (or an even higher number depending on the documents you serve), you will get a slight performance improvement almost for free. :-) On 10.03.2005 13:02:22 Ben Gill wrote: Maybe the example can be updated with my version? I have not compiled this, but I know it works... Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Sources for layout.jpg
Hello, I'm looking for the xml/xslt/xsl-fo sources for the layout.jpg from the Demonstration section from the frontpage of the fop homepage, that is: http://xml.apache.org/fop/index.html#demo I've fetched the cvs repository, but have only been able to locate the jpeg image. Does aynone know where to find the source? -- Cheers, - Jacob Atzen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
produce RTF with FOP
Anyone has an idea how to generate RTF with FOP. Is XSL-FO the proper namespace for creating RTF? Regards 6X velocizzare la tua navigazione a 56k? 6X Web Accelerator di Libero! Scaricalo su INTERNET GRATIS 6X http://www.libero.it - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: FopServlet
Are you not creating an XML file on disk with this version with: else if ((xmlParam != null) (xslParam != null)) { Source src = new StreamSource(new File(xmlParam)); I think it would be good to include an example of how to generate the PDF from a ProjectTeam without touching the disk? Ben -Original Message- From: Jeremias Maerki [mailto:[EMAIL PROTECTED] Sent: 11 March 2005 08:26 To: [EMAIL PROTECTED] Subject: Re: FopServlet Here's a modified version of the servlet: http://cvs.apache.org/~jeremias/FopServlet.java BTW, while updating the file I found an opportunity for a little optimization. In the servlet's case the ByteArrayOutputStream should not be instantiated with the default constructor. This only allocates 64 bytes initially. Every time the buffer runs out of space the old buffer is discarded and a new one with twice the previous space is allocated. If you do new ByteArrayOutputStream(16384) (or an even higher number depending on the documents you serve), you will get a slight performance improvement almost for free. :-) On 10.03.2005 13:02:22 Ben Gill wrote: Maybe the example can be updated with my version? I have not compiled this, but I know it works... Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ This message has been checked for all known viruses by the MessageLabs Virus Control Centre. This message has been checked for all known viruses by the MessageLabs Virus Control Centre. * Notice: This email is confidential and may contain copyright material of Ocado Limited (the Company). Opinions and views expressed in this message may not necessarily reflect the opinions and views of the Company. If you are not the intended recipient, please notify us immediately and delete all copies of this message. Please note that it is your responsibility to scan this message for viruses. Company reg. no. 3875000. Ocado Limited Titan Court 3 Bishops Square Hatfield Business Park Hatfield Herts AL10 9NE * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FopServlet
The modified servlet has the same functionality as the example servlet in the distribution. You're welcome to do the example involving the ProjectTeam yourself. I don't have the time. On 11.03.2005 11:06:59 Ben Gill wrote: Are you not creating an XML file on disk with this version with: else if ((xmlParam != null) (xslParam != null)) { Source src = new StreamSource(new File(xmlParam)); I think it would be good to include an example of how to generate the PDF from a ProjectTeam without touching the disk? Ben -Original Message- From: Jeremias Maerki [mailto:[EMAIL PROTECTED] Sent: 11 March 2005 08:26 To: [EMAIL PROTECTED] Subject: Re: FopServlet Here's a modified version of the servlet: http://cvs.apache.org/~jeremias/FopServlet.java BTW, while updating the file I found an opportunity for a little optimization. In the servlet's case the ByteArrayOutputStream should not be instantiated with the default constructor. This only allocates 64 bytes initially. Every time the buffer runs out of space the old buffer is discarded and a new one with twice the previous space is allocated. If you do new ByteArrayOutputStream(16384) (or an even higher number depending on the documents you serve), you will get a slight performance improvement almost for free. :-) On 10.03.2005 13:02:22 Ben Gill wrote: Maybe the example can be updated with my version? I have not compiled this, but I know it works... Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ This message has been checked for all known viruses by the MessageLabs Virus Control Centre. This message has been checked for all known viruses by the MessageLabs Virus Control Centre. * Notice: This email is confidential and may contain copyright material of Ocado Limited (the Company). Opinions and views expressed in this message may not necessarily reflect the opinions and views of the Company. If you are not the intended recipient, please notify us immediately and delete all copies of this message. Please note that it is your responsibility to scan this message for viruses. Company reg. no. 3875000. Ocado Limited Titan Court 3 Bishops Square Hatfield Business Park Hatfield Herts AL10 9NE * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Sources for layout.jpg
I don't know who generated this image. It was done long ago and I don't think it shows a real-world example. But there are lots of other examples in the distribution. On 11.03.2005 10:46:41 Jacob Atzen wrote: I'm looking for the xml/xslt/xsl-fo sources for the layout.jpg from the Demonstration section from the frontpage of the fop homepage, that is: http://xml.apache.org/fop/index.html#demo I've fetched the cvs repository, but have only been able to locate the jpeg image. Does aynone know where to find the source? Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Barcode4J not human readable
Hi, I downloaded the Barcode4J files and installed everything (which is quite easy!) and nearly all works perfect -only the 'human readable section' below Code39 and Code128 is not (human;-) readable in the postscript format. (Attached is a bzipped postscript-file) When I generate PDF everything looks fine. I tried to change the font name - but that doesn't solve the problem. Any hints? Holger out1110473242271.ps.bz2 Description: BZip2 compressed data - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: produce RTF with FOP
XSL-FO is one way to create RTF. FOP is capable of converting XSL-FO into a number of formats (PDF, PS, PCL etc.). FOP 0.20.5 does not support RTF output. You can, however, use JFOR to create RTF from XSL-FO or if you are brave you can fetch the FOP source code from CVS HEAD where JFOR was merged in. But the latter code is probably not ready for productive use. On 11.03.2005 10:53:19 [EMAIL PROTECTED] wrote: Anyone has an idea how to generate RTF with FOP. Is XSL-FO the proper namespace for creating RTF? Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Sources for layout.jpg
On Fri, Mar 11, 2005 at 11:13:21AM +0100, Jeremias Maerki wrote: I don't know who generated this image. It was done long ago and I don't think it shows a real-world example. But there are lots of other examples in the distribution. Okay, I just assumed that This image is a demonstration of a real two page document meant that it actually was a real demonstration ;-) Does anyone know another example showing how to do text wrapping around an image? -- Cheers, - Jacob Atzen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: FopServlet
The source code change is here: /* * Copyright 1999-2003,2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* $Id$ */ import java.io.ByteArrayOutputStream; import java.io.File; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.xml.transform.Result; import javax.xml.transform.Source; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.sax.SAXResult; import javax.xml.transform.stream.StreamSource; import org.apache.fop.apps.Driver; import org.apache.fop.messaging.MessageHandler; import org.apache.avalon.framework.logger.ConsoleLogger; import org.apache.avalon.framework.logger.Logger; import embedding.ExampleObj2XML; import embedding.model.ProjectTeam; /** * Example servlet to generate a PDF from a servlet. * Servlet param is: * ul * lifo: the path to a formatting object file to render * /ul * * Example URL: http://servername/fop/servlet/FopServlet?fo=readme.fo * Example URL: http://servername/fop/servlet/FopServlet?xml=data.xmlxsl=format.xsl * Compiling: you will need * - servlet_2_2.jar * - fop.jar * - sax api * - avalon-framework-x.jar (where x is the version found the FOP lib dir) * * Running: you will need in the WEB-INF/lib/ directory: * - fop.jar * - batik.jar * - xalan-2.0.0.jar * - avalon-framework-x.jar (where x is the version found the FOP lib dir) */ public class FopServlet extends HttpServlet { public static final String FO_REQUEST_PARAM = fo; public static final String XML_REQUEST_PARAM = xml; public static final String XSL_REQUEST_PARAM = xsl; protected Logger log = null; protected TransformerFactory factory = null; public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException { if (log == null) { log = new ConsoleLogger(ConsoleLogger.LEVEL_WARN); MessageHandler.setScreenLogger(log); } try { String foParam = request.getParameter(FO_REQUEST_PARAM); String xmlParam = request.getParameter(XML_REQUEST_PARAM); String xslParam = request.getParameter(XSL_REQUEST_PARAM); if (foParam != null) { File fofile = new File(foParam); //log.warn(FO: +fofile.getCanonicalPath()); Source src = new StreamSource(fofile); renderFO(src, null, response); } else if ((xmlParam != null) (xslParam != null)) { Source src = new StreamSource(new File(xmlParam)); Source xslt = new StreamSource(new File(xslParam)); renderFO(src, xslt, response); } else if (xslParam != null) { /** * Example of going straight to PDF from ProjectTeam * without touching file system */ ProjectTeam projectTeam = ExampleObj2XML.createSampleProjectTeam(); Source src = projectTeam.getSourceForProjectTeam(); Source xslt = new StreamSource(new File(xslParam)); renderFO(src, xslt, response); } else { PrintWriter out = response.getWriter(); out.println(htmlheadtitleError/title/head\n+ bodyh1FopServlet Error/h1h3No 'fo' + request param given./body/html); } } catch (ServletException ex) { throw ex; } catch (Exception ex) { throw new ServletException(ex); } } /** * Renders an FO inputsource into a PDF file which is written * directly to the response object's OutputStream * @param src Source (XML or FO file) * @param xslt Source for stylesheet (may be null) * @param response servlet response to send the PDF to * @throws ServletException in case of an exception */ public void renderFO(Source src, Source xslt, HttpServletResponse response) throws ServletException { try { //Start with a bigger buffer to avoid too many buffer reallocations ByteArrayOutputStream out = new ByteArrayOutputStream(16384); response.setContentType(application/pdf);
Re: Barcode4J not human readable
Yes, this is a known bug in FOP 0.20.5. The SVG subsystem lacks support for a certain basic paint operation (QUADTO) which is used when painting text as shapes. I've got a work-around I did for a customer which is also much faster because it directly embeds the barcode as EPS into the PostScript file instead of going via SVG/Batik. It is described here: http://barcode4j.krysalis.org/fop-ext.html#The+special+FOP+extension+%28for+experienced+developers+only%29 Note that I have no problem giving this to you but I won't provide any (free) support for it. The other possibility is that you backport the necessary change from CVS HEAD into your copy of FOP 0.20.5. The missing part is this: http://cvs.apache.org/viewcvs.cgi/xml-fop/src/java/org/apache/fop/render/ps/PSGraphics2D.java?rev=1.13view=markup Look for the method processPathIterator() and port the part for PathIterator.SEG_QUADTO back into FOP 0.20.5. There's also a PostScript macro that needs to be ported: http://cvs.apache.org/viewcvs.cgi/xml-fop/src/java/org/apache/fop/render/ps/PSProcSets.java?rev=1.10view=markup Look for /QUADTO. This part is in PSRenderer.writeProcs() in FOP 0.20.5. On 11.03.2005 11:14:53 Holger Dehnhardt wrote: Hi, I downloaded the Barcode4J files and installed everything (which is quite easy!) and nearly all works perfect -only the 'human readable section' below Code39 and Code128 is not (human;-) readable in the postscript format. (Attached is a bzipped postscript-file) When I generate PDF everything looks fine. I tried to change the font name - but that doesn't solve the problem. Any hints? Holger Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Sources for layout.jpg
FOP can't do that, yet. On 11.03.2005 11:25:53 Jacob Atzen wrote: On Fri, Mar 11, 2005 at 11:13:21AM +0100, Jeremias Maerki wrote: I don't know who generated this image. It was done long ago and I don't think it shows a real-world example. But there are lots of other examples in the distribution. Okay, I just assumed that This image is a demonstration of a real two page document meant that it actually was a real demonstration ;-) Does anyone know another example showing how to do text wrapping around an image? -- Cheers, - Jacob Atzen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Sources for layout.jpg
On Fri, Mar 11, 2005 at 11:33:02AM +0100, Jeremias Maerki wrote: FOP can't do that, yet. Then I'll stop looking for a way to do it. Thanks. -- Cheers, - Jacob Atzen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: produce RTF with FOP
Do u know where to find usefull examples or tutorial for using jfor? www.jfor.org is not so well done. Regards -- Initial Header --- From : Jeremias Maerki [EMAIL PROTECTED] To : [EMAIL PROTECTED] Cc : Date : Fri, 11 Mar 2005 11:17:10 +0100 Subject : Re: produce RTF with FOP XSL-FO is one way to create RTF. FOP is capable of converting XSL-FO into a number of formats (PDF, PS, PCL etc.). FOP 0.20.5 does not support RTF output. You can, however, use JFOR to create RTF from XSL-FO or if you are brave you can fetch the FOP source code from CVS HEAD where JFOR was merged in. But the latter code is probably not ready for productive use. On 11.03.2005 10:53:19 [EMAIL PROTECTED] wrote: Anyone has an idea how to generate RTF with FOP. Is XSL-FO the proper namespace for creating RTF? Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] 6X velocizzare la tua navigazione a 56k? 6X Web Accelerator di Libero! Scaricalo su INTERNET GRATIS 6X http://www.libero.it - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Sources for layout.jpg
Just for the record: What you were looking for was an example with side-floats. fo:float is not implemented in FOP: http://xml.apache.org/fop/compliance.html#fo-object-float On 11.03.2005 11:35:58 Jacob Atzen wrote: On Fri, Mar 11, 2005 at 11:33:02AM +0100, Jeremias Maerki wrote: FOP can't do that, yet. Then I'll stop looking for a way to do it. Thanks. Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: produce RTF with FOP
http://www.jfor.org/jfor-readme.html shows me everything I need to know. On 11.03.2005 11:45:52 [EMAIL PROTECTED] wrote: Do u know where to find usefull examples or tutorial for using jfor? www.jfor.org is not so well done. Regards -- Initial Header --- From : Jeremias Maerki [EMAIL PROTECTED] To : [EMAIL PROTECTED] Cc : Date : Fri, 11 Mar 2005 11:17:10 +0100 Subject : Re: produce RTF with FOP XSL-FO is one way to create RTF. FOP is capable of converting XSL-FO into a number of formats (PDF, PS, PCL etc.). FOP 0.20.5 does not support RTF output. You can, however, use JFOR to create RTF from XSL-FO or if you are brave you can fetch the FOP source code from CVS HEAD where JFOR was merged in. But the latter code is probably not ready for productive use. On 11.03.2005 10:53:19 [EMAIL PROTECTED] wrote: Anyone has an idea how to generate RTF with FOP. Is XSL-FO the proper namespace for creating RTF? Jeremias Maerki Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Barcode4J not human readable
Jeremias, thank you for your assistance! I need barcode rendering for PS and PDF so I decided to make the patching as you described below. Everything works fine now! Thanks again Holger Am Freitag, 11. März 2005 11:32 schrieb Jeremias Maerki: Yes, this is a known bug in FOP 0.20.5. The SVG subsystem lacks support for a certain basic paint operation (QUADTO) which is used when painting text as shapes. I've got a work-around I did for a customer which is also much faster because it directly embeds the barcode as EPS into the PostScript file instead of going via SVG/Batik. It is described here: http://barcode4j.krysalis.org/fop-ext.html#The+special+FOP+extension+%28for +experienced+developers+only%29 Note that I have no problem giving this to you but I won't provide any (free) support for it. The other possibility is that you backport the necessary change from CVS HEAD into your copy of FOP 0.20.5. The missing part is this: http://cvs.apache.org/viewcvs.cgi/xml-fop/src/java/org/apache/fop/render/ps /PSGraphics2D.java?rev=1.13view=markup Look for the method processPathIterator() and port the part for PathIterator.SEG_QUADTO back into FOP 0.20.5. There's also a PostScript macro that needs to be ported: http://cvs.apache.org/viewcvs.cgi/xml-fop/src/java/org/apache/fop/render/ps /PSProcSets.java?rev=1.10view=markup Look for /QUADTO. This part is in PSRenderer.writeProcs() in FOP 0.20.5. On 11.03.2005 11:14:53 Holger Dehnhardt wrote: Hi, I downloaded the Barcode4J files and installed everything (which is quite easy!) and nearly all works perfect -only the 'human readable section' below Code39 and Code128 is not (human;-) readable in the postscript format. (Attached is a bzipped postscript-file) When I generate PDF everything looks fine. I tried to change the font name - but that doesn't solve the problem. Any hints? Holger Jeremias Maerki - 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: Sources for layout.jpg
On Mar 11, 2005, at 2:13 AM, Jeremias Maerki wrote: I don't know who generated this image. It was done long ago and I don't think it shows a real-world example. But there are lots of other examples in the distribution. As I recall, someone expressed a desire to swap out the other 'example' on the home page. I've created an updated graphic. Please check these out. New Graphic http://www.apache.org/~clay/document.jpg Updated FO file: http://www.apache.org/~clay/fop_normal.fo Updated PDF output file http://www.apache.org/~clay/fop_normal.pdf Does anyone have any objections to my making these files LIVE on the FOP site (and replacing the current document.jpg image on the home page)? One thing I like about the 'old' graphic is that you can really see the code... Web Maestro Clay -- [EMAIL PROTECTED] - http://homepage.mac.com/webmaestro/ My religion is simple. My religion is kindness. - HH The 14th Dalai Lama of Tibet - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]