RE: Problem Executing FopServlet on bea weblogic6.1
Sorry about cross posting to both the list, This isn't an IE problem because I am able to view other PDF properly in IE, and I am not getting anything else in the weblogic log other than [DEBUG] Using weblogic.xml.jaxp.RegistryXMLReader as SAX2 Parser I checked the size of the ByteArrayOutputStream it is showing 0 this means nothing is being rendered. Thanks Amit -Original Message- From: Oleg Tkachenko [mailto:[EMAIL PROTECTED]] Sent: Monday, July 15, 2002 1:07 PM To: [EMAIL PROTECTED] Subject: Re: Problem Executing FopServlet on bea weblogic6.1 Amit Rangari wrote: I am not able to execute the FOServlet on weblogic6.1. I get a blank PDF in the IE when I try to execute the FOServlet. The message on Weblogic console is: [DEBUG] Using weblogic.xml.jaxp.RegistryXMLReader as SAX2 Parser Please help me to resolve this issue. You didn't give us enough information to help you. That could be and fop problem and IE one. The debug message you have posted is usual fop's debug message, which only says which xml parser is in use, show us the rest of messages. And look at the list archive for IE and blank pdf, that's actually faq, try to put dummy parameter at the end of url: http://./FopServlet?dummy=.pdf This way probably IE able to understand that response is going to be pdf. -- Oleg Tkachenko Multiconn International, Israel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: Problem Executing FopServlet on bea weblogic6.1
Hi, Please find attached the FopServlet.java that I am using and the output on the weblogic console that I am getting is as below: DRIVER OBJECT CREATED SET LOGGER EXECUTED SET RENDERER EXECUTED OUT PUT STREAM IS SET [DEBUG] Using weblogic.xml.jaxp.RegistryXMLReader as SAX2 Parser RENDERING DONE CONTENT LENGTH: 0 DONE And the CLASSPATH I am using is as follows: .; E:\bea\wlserver6.1\lib\fop\avalon-framework-4.1.2b.jar; E:\bea\wlserver6.1\lib\fop\batik.jar; E:\bea\wlserver6.1\lib\fop\fop.jar; E:\bea\wlserver6.1\lib\fop\logkit-1.0.1.jar; E:\bea\wlserver6.1\lib\fop\xalan-2.3.1.jar; E:\bea\wlserver6.1\lib\fop\xercesImpl-2.0.1.jar; E:\bea\wlserver6.1\lib\fop\xml-apis.jar; E:\bea; E:\bea\jdk131; E:\bea\wlserver6.1; E:\bea\wlserver6.1\config\alphadomain2_2; E:\bea\wlserver6.1\config\alphadomain2_2\serverclasses; E:\bea\wlserver6.1\config\alphadomain2_2\servletclasses; E:\bea\jdk131\lib\tools.jar; E:\bea\wlserver6.1\config\alphadomain2_2\applications\TestBean.jar; E:\bea\wlserver6.1\lib\weblogic_sp.jar; E:\bea\wlserver6.1\lib\weblogic.jar Thanks Amit -Original Message- From: Oleg Tkachenko [mailto:[EMAIL PROTECTED]] Sent: Monday, July 15, 2002 1:44 PM To: [EMAIL PROTECTED] Subject: Re: Problem Executing FopServlet on bea weblogic6.1 Amit Rangari wrote: Sorry about cross posting to both the list, This isn't an IE problem because I am able to view other PDF properly in IE, and I am not getting anything else in the weblogic log other than [DEBUG] Using weblogic.xml.jaxp.RegistryXMLReader as SAX2 Parser I checked the size of the ByteArrayOutputStream it is showing 0 this means nothing is being rendered. Well, probably some exception has occured and you have to find its stack trace in logs somewhere, actually FopServlet throws new ServletException object and it's servlet engine responsibility to log it. Or alternatively try to redirect the logger fop uses to a file in order to see fop debug mesages. How you can do it depends on fop version you are using. -- Oleg Tkachenko Multiconn International, Israel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] FopServlet.java Description: Binary data - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Problem Executing FopServlet on bea weblogic6.1
Hi All, I am not able to execute the FOServlet on weblogic6.1. I get a blank PDF in the IE when I try to execute the FOServlet. The message on Weblogic console is: [DEBUG] Using weblogic.xml.jaxp.RegistryXMLReader as SAX2 Parser Please help me to resolve this issue. Thanks, Amit - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: Unable to generate PDF file from EJB using FOP
I have written a simple program to translate the XML data to PDF format when I run this program as a standalone application it works fine; it generates the appropriate PDF file. Please find attached Translate.java file. The problem is when I call the method to convert XML to PDF from EJB (Stateless) it does not render at all; in fact it doesn't write anything to the ByteArrayOutputStream which is set as a outputStream for the Driver. - Are you using IEx as a client? Do you use a URL ending in .pdf to access the PDF? Yes I am planning to do so but the problem is that the PDF itself is not getting created. - Have you used a command line client like wget to retrieve the PDF? Do you get an error? Do you get an empty or corrupted PDF? Yes I do get a Report1.pdf on the disk but it is empty. - is there anything interesting in the logs of the EJB container? no - Have you tried the servlet example distributed with FOP? Do you have prolems there alos? Yes I tried the FOPServlet example that also doen't work -Original Message- From: J.Pietschmann [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 11, 2002 12:55 AM To: [EMAIL PROTECTED] Subject: Re: Unable to generate PDF file from EJB using FOP Amit Rangari wrote: Simply the rendering not done It is hard to guess your problem from such a sparse description. Some possibilities: - Are you using IEx as a client? Do you use a URL ending in .pdf to access the PDF? - Have you used a command line client like wget to retrieve the PDF? Do you get an error? Do you get an empty or corrupted PDF? - is there anything interesting in the logs of the EJB container? - Have you tried the servlet example distributed with FOP? Do you have problem there also? J.Pietschmann -Original Message- You are supposed to trim unnecessary old quotes, in particular if there are completely unrelated old messages therein. Look at the archives: http://marc.theaimsgroup.com/?l=fop-devm=102629436519701w=2 Assume someone searches the archive for white-space-collapse and gets a hit on your post. J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] Translate.java Description: Binary data - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Unable to generate PDF file from EJB using FOP
I have written a simple class which takes XML and XSL and translate it into PDF using FOP (this works fine when run it as a standalone application) but when I embed this program/logic in a stateless EJB it doesn't render the content to the output stream. I have checked out the class path also, I am using the same setEnv.bat file to set the environment for running both standalone program as well as weblogic application server. Please help me Thanks Amit -Original Message- From: RamanaJV [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 09, 2002 9:39 AM To: [EMAIL PROTECTED] Subject: RE: Page details support? I understand that messing around with FOP is not a good idea. But what to do, I doesn't get any solution till. I'll put the problem in greater detail again. I will be having FO templates, that specify the style of the report. Let's say the template is like: ?xml version=1.0 encoding=utf-8? fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format !-- defines the layout master -- fo:layout-master-set fo:simple-page-master master-name=first page-height=11in page-width=8.5in margin-top=25pt margin-bottom=25pt margin-left=20pt margin-right=10pt fo:region-body margin-top=50pt fo:region-before extent=50pt fo:region-after extent=25pt /fo:simple-page-master /fo:layout-master-set !-- starts actual layout -- fo:page-sequence master-reference=first fo:static-content flow-name=xsl-region-before !-- Static content goes here -- /fo:static-content fo:flow flow-name=xsl-region-body fo:block white-space-collapse=false space-after=12pt fo:inline font-weight=bold##/fo:inline + /fo:block /fo:flow /fo:page-sequence /fo:root There will be templates like above where the hashpart(###) is the hole area where the programs fill the data. The data will be got from the database and the client program supplies the server with the data and the sever program takes the data and for every write call the client program says, the server creates a new fo:block element and places the data supplied in the hash portion. The client proceeds in this fashion. The client program may supply large amount of records, can be around 15,000 records also. So, it is not advisable to make the user wait till all the data is supplied and the entire FO constructed. There is an assumption made now, say we can show 40 records per page. The client supplies 40 records to the sever, which renders the page using FOP API. But, the problem comes if the data supplied will not fit in the single line. If the data spans more than 1 line, then the assumption becomes incorrect and the remnant portion of the data ( a small chunk, could be one or two lines) comes in the second page. This is not good. There actually will be number of templates and client filling out the templates. So, I'm trying to find a solution where in which at any point of time client should be able to know that Still how many lines of display remain?. With that the client can hold until the server gives it a ready signal again. I hope I'm clear now... I'm not finding how to solve the above problem... I think this type of viewing is common in business applications... For now, it is assumed that the page size is 8.5in * 11in and portrait mode. Is it possible? I'll be waiting to hear for a solution... -Original Message- From: Jeremias Maerki [mailto:[EMAIL PROTECTED]] Sent: Monday, July 08, 2002 8:54 PM To: [EMAIL PROTECTED] Subject: Re: Page details support? The font classes could help you here, too. But I wonder if that helps you a lot. Questions like that often indicate that someone is trying to work around a problem that is actually supposed to be worked out in a different way. If you experience a deficiency with FOP, first try to find out, if it's XSL:FO that doesn't provide what you need or if it's FOP. If it's FOP, tell us what you want to accomplish. We may (!) be able to help you find another solution that doesn't involve messing around with FOP
RE: Unable to generate PDF file from EJB using FOP
Simply the rendering not done -Original Message- From: RamanaJV [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 10, 2002 2:55 PM To: [EMAIL PROTECTED] Subject: RE: Unable to generate PDF file from EJB using FOP Is it throwing any exceptions or simply the rendering not done? Ramana.JV. -Original Message- From: Amit Rangari [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 10, 2002 12:39 PM To: [EMAIL PROTECTED] Subject: Unable to generate PDF file from EJB using FOP I have written a simple class which takes XML and XSL and translate it into PDF using FOP (this works fine when run it as a standalone application) but when I embed this program/logic in a stateless EJB it doesn't render the content to the output stream. I have checked out the class path also, I am using the same setEnv.bat file to set the environment for running both standalone program as well as weblogic application server. Please help me Thanks Amit -Original Message- From: RamanaJV [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 09, 2002 9:39 AM To: [EMAIL PROTECTED] Subject: RE: Page details support? I understand that messing around with FOP is not a good idea. But what to do, I doesn't get any solution till. I'll put the problem in greater detail again. I will be having FO templates, that specify the style of the report. Let's say the template is like: ?xml version=1.0 encoding=utf-8? fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format !-- defines the layout master -- fo:layout-master-set fo:simple-page-master master-name=first page-height=11in page-width=8.5in margin-top=25pt margin-bottom=25pt margin-left=20pt margin-right=10pt fo:region-body margin-top=50pt fo:region-before extent=50pt fo:region-after extent=25pt /fo:simple-page-master /fo:layout-master-set !-- starts actual layout -- fo:page-sequence master-reference=first fo:static-content flow-name=xsl-region-before !-- Static content goes here -- /fo:static-content fo:flow flow-name=xsl-region-body fo:block white-space-collapse=false space-after=12pt fo:inline font-weight=bold##/fo:inline + /fo:block /fo:flow /fo:page-sequence /fo:root There will be templates like above where the hashpart(###) is the hole area where the programs fill the data. The data will be got from the database and the client program supplies the server with the data and the sever program takes the data and for every write call the client program says, the server creates a new fo:block element and places the data supplied in the hash portion. The client proceeds in this fashion. The client program may supply large amount of records, can be around 15,000 records also. So, it is not advisable to make the user wait till all the data is supplied and the entire FO constructed. There is an assumption made now, say we can show 40 records per page. The client supplies 40 records to the sever, which renders the page using FOP API. But, the problem comes if the data supplied will not fit in the single line. If the data spans more than 1 line, then the assumption becomes incorrect and the remnant portion of the data ( a small chunk, could be one or two lines) comes in the second page. This is not good. There actually will be number of templates and client filling out the templates. So, I'm trying to find a solution where in which at any point of time client should be able to know that Still how many lines of display remain?. With that the client can hold until the server gives it a ready signal again. I hope I'm clear now... I'm not finding how to solve the above problem... I think this type of viewing is common in business applications... For now, it is assumed that the page size is 8.5in * 11in and portrait mode. Is it possible? I'll be waiting to hear for a solution... -Original Message- From: Jeremias Maerki [mailto:[EMAIL PROTECTED]] Sent: Monday, July 08, 2002 8:54 PM To: [EMAIL PROTECTED] Subject: Re: Page details support? The font
PDF to RTF
Does anybody know of a PDF to RTF converter written in Java (preferably)? Or does anybody know of a XSL:FO based RTF renderer? I tried the jfor one but is not sufficient for what I am trying to do...(lacks support for headers, borders footers etc)
Re: Easier logging suppression for Driver?
That would be very usefull, and I am sure there are many others who would like it as well. Also in my humble opinion the logger used in FOP should be a configurable using the log4j package. - Original Message - From: Rhett Aultman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, April 19, 2002 1:08 PM Subject: Easier logging suppression for Driver? Hey guys, One thing I'm seeing coming up a lot on the small-use apps I'm writing is that I don't need FOP to log its activity in apps moved to production. For some reason, though, Avalon 4 doesn't seem to have an org.apache.avalon.framework.logger.NullLogger available to make logging suppression easy, and the other strategies I see for logging suppression don't look as simple as passing a NullLogger into the Driver. I'd like to suggest a convenience method to make FOP suppress logging. If anyone else thinks this would be useful, I'll happily take the work on myself. -- J. Rhett Aultman Business Technology Solutions FCCI Insurance Group - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
XSLTransform
I am trying to create a PDF from a org.w3c.dom.Document and and XSL file I have on my file system since XSLTransform is up to such a task I tried this **Code** Document outDoc = null; XSLTransform.transform(xmlDoc, xslInputStream, outDoc); **Code** But somehow the outDoc is null. According to the api it should've have written out to outDoc. I am sure I am doing something wrong ... If somebody hassome insights/suggestions I would really appreciate it Amit
Fw: XSLTransform
Title: RE: XSLTransform - Original Message - From: Amit Kirdatt To: Clute, Andrew Sent: Wednesday, November 14, 2001 12:43 PM Subject: Re: XSLTransform XSLTransform.transform() expects xmlDoc, xslInputStream, and an org.w3c.dom.Document According to your example your passing it an ByteArrayOutputStream. I am trying to get the output as a org.w3c.dom.Document so that I can pass it to the Driver is Fop - Original Message - From: Clute, Andrew To: 'Amit Kirdatt ' Sent: Wednesday, November 14, 2001 11:36 AM Subject: RE: XSLTransform you are passing an null object to have it render to -- it has nothing to render to it: Try this: ByteArrayOutputStream out = new ByteArrayOutputStream(); XSLTResultTarget xsltResult = new XSLTResultTarget(out); XSLTransform.transform(xmlDoc, xslInputStream, out); -Original Message- From: Amit Kirdatt To: Fop Fop Sent: 11/14/2001 12:31 PM Subject: XSLTransform I am trying to create a PDF from a org.w3c.dom.Document and and XSL file I have on my file system since XSLTransform is up to such a task I tried this **Code** Document outDoc = null; XSLTransform.transform(xmlDoc, xslInputStream, outDoc); **Code** But somehow the outDoc is null. According to the api it should've have written out to outDoc. I am sure I am doing something wrong ... If somebody has some insights/suggestions I would really appreciate it Amit
image align
How do you align images..for example at start, end, center of the page etc. This is what my image block looks like fo:external-graphic src="http://localhost:8080/some.gif" content-height="3cm" content-width="8cm" / I tried "align=left" but that dosen't work and I tried other things but no luck Any help would be appreciated thanks Amit
Re: image align
It is in the static-region before and I am trying to align it to the right side of the page instead of the default left - Original Message - From: Branham, Paul To: '[EMAIL PROTECTED]' Sent: Tuesday, November 13, 2001 12:12 PM Subject: RE: image align According to the short reference, you use before, center, or after. Paul Branham [EMAIL PROTECTED] 24/7 Media, Inc. Phone:(301)897-7722 -Original Message-From: Amit Kirdatt [mailto:[EMAIL PROTECTED]]Sent: Tuesday, November 13, 2001 12:37 PMTo: Fop FopSubject: image align How do you align images..for example at start, end, center of the page etc. This is what my image block looks like fo:external-graphic src="http://localhost:8080/some.gif" content-height="3cm" content-width="8cm" / I tried "align=left" but that dosen't work and I tried other things but no luck Any help would be appreciated thanks Amit
Re: image align
thanks a lot ...it worked - Original Message - From: Branham, Paul To: '[EMAIL PROTECTED]' Sent: Tuesday, November 13, 2001 12:43 PM Subject: RE: image align The best way to achieve this would be similar to the following code, (Assuming that you don't have any text on the same line...) fo:block text-align="end" font-size="12pt" line-height="21pt"font-family="Times" font-weight="bold"fo:external-graphic src="d:\fop-bin\fop\logo.gif"//fo:block or: fo:external-graphic src="d:\fop-bin\fop\logo.gif" display-align="after"/ where you put how you want it aligned in the display-align field. In addition you can create a table, if you have text on the same line as the logo graphic. Paul Branham [EMAIL PROTECTED] 24/7 Media, Inc. Phone:(301)897-7722 -Original Message-From: Amit Kirdatt [mailto:[EMAIL PROTECTED]]Sent: Tuesday, November 13, 2001 1:36 PMTo: [EMAIL PROTECTED]Subject: Re: image align It is in the static-region before and I am trying to align it to the right side of the page instead of the default left - Original Message - From: Branham, Paul To: '[EMAIL PROTECTED]' Sent: Tuesday, November 13, 2001 12:12 PM Subject: RE: image align According to the short reference, you use before, center, or after. Paul Branham [EMAIL PROTECTED] 24/7 Media, Inc. Phone:(301)897-7722 -Original Message-From: Amit Kirdatt [mailto:[EMAIL PROTECTED]]Sent: Tuesday, November 13, 2001 12:37 PMTo: Fop FopSubject: image align How do you align images..for example at start, end, center of the page etc. This is what my image block looks like fo:external-graphic src="http://localhost:8080/some.gif" content-height="3cm" content-width="8cm" / I tried "align=left" but that dosen't work and I tried other things but no luck Any help would be appreciated thanks Amit
Date
How do you insert todays date Is there something similar to page-number fo:page-number\ I tried fo:date\ that dosen't work. any ideas thanks Amit
Re: [vote] Merging JFor with FOP
+1 it would make JFOR and FOP richer John Kattestaart (Freeler) wrote: -Original Message- From: Jim Wright [mailto:[EMAIL PROTECTED]] Sent: donderdag 18 oktober 2001 21:06 To: [EMAIL PROTECTED] Subject: RE: [vote] Merging JFor with FOP I don't officially count as these things go, but merging jfor and fop would solve several issues I currently have. Yes combinune fop and jfor would make life easier. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: Fop speed improvements
There are disclaimers stating that Fop is not ready for production level use. However many of us use it. I can generate 2+ page pdfs with graphics in less than 30 seconds...this is just to give you an idea. I a using JDK1.2.2 with 512MB of RAM If you could paste/attach your servlet code or the xml, xsl files someone might be able to take a look at it to see if something is going on there. Pablo Iaria wrote: Hi all, This is the second message I post about fop performance and I didn't got any answer; is there a way to make it faster or useable. I'm generating a pdf from a servlet and although it's very easy to use, it's VERY slow and causes the browser to raise a timeout exception. I'm using a Pentium III 500 + 500 Mb + jdk1.3 machine and it takes 5 minutes to get a 2 pages document with no graphics, just one big table with 5 columns... Am I doing something wrong or fop is not ready for real-life ? Thanks in advance, Pablo.- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: pdf freeze due to image?
does this happen only on windows 2000? Also I am sure this is just a typo with your URL below...the server is missing in the url. Linda Zammit wrote: We have an intermittent problem with out pdf's that are created with FOP 19. For some reason the image referred to in: fo:external-graphic src=http://whatever.gif/ does not always display. When it does display on the Adobe pdf screen, many time the user's Win2K system freezes and they have to shut down Adobe 5 completely and start again. We checked out the Adobe site and see that there is an issue logged with printing (which is also sometimes a freezing problem) but we seemed to have it narrowed down to something with the external graphic. That is, when I take out the fo:external-graphic link, the system doesn't freeze. Has anyone else experienced this? Thanks in advance. Linda - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: Newbie question: Error: Null
Paul, There is already a class which will take the xml, xsl files and outpu a pdf! There is also a batch file (if you or unix a shell script) which will do this for you. It is is in your fop installation directory and is called fop.bat (fop.sh on unix). This is for a standalone application. Are you trying to create a servlet which will out put PDF files with the xml and xsl files as input? Amit Paul Kowlessar wrote: Hi, I have just downloaded FOP 0.20.2 and have included the appropriate jars into my classpath. To test my installation, I have created a simple program based on the code in the Embedding FOP page. Here is the code: // import java.util.*; import java.io.*; import java.io.FileOutputStream; import org.apache.fop.apps.*; import org.xml.sax.*; import org.apache.avalon.framework.logger.*; import org.apache.log.*; public class PDFTest { public PDFTest() { Logger log = null; Hierarchy hierarchy = Hierarchy.getDefaultHierarchy(); log = hierarchy.getLoggerFor(fop); log.setPriority(Priority.WARN); String xmlFile = c:\\worktemp\\01M10_YVR_FA.xml; String xslFile = c:\\worktemp\\bidreport.xsl; String pdfFile = c:\\worktemp\\outFile.pdf; FileOutputStream output = null; try{ output = new FileOutputStream(pdfFile); Driver driver = new Driver(); driver.setLogger(log); driver.setRenderer(Driver.RENDER_PDF); XSLTInputHandler inputHandler = new XSLTInputHandler(new File(xmlFile), newFile(xslFile)); org.xml.sax.XMLReader parser = inputHandler.getParser(); driver.setOutputStream(output); driver.render(parser,inputHandler.getInputSource()); }catch (Exception ex){ ex.printStackTrace(); } } public static void main(String[] args) { PDFTest test = new PDFTest(); } } /*/ This file compiles with no problem. However, when I try to run it the following errors are encountered: org.apache.fop.apps.FOPException at org.apache.fop.apps.XSLTInputHandler.getParser(XSLTInputHandler.java:109) at PDFTest.init(PDFTest.java:29) at PDFTest.main(PDFTest.java:41) - java.lang.reflect.InvocationTargetException: org.apache.fop.apps.FOPException: javax.xml.parsers.FactoryConfigurationE at org.apache.fop.apps.TraxInputHandler.getXMLFilter(TraxInputHandler.java:103) at java.lang.reflect.Method.invoke(Native Method) at org.apache.fop.apps.XSLTInputHandler.getParser(XSLTInputHandler.java:102) at PDFTest.init(PDFTest.java:29) at PDFTest.main(PDFTest.java:41) - - org.apache.fop.apps.FOPException: javax.xml.parsers.FactoryConfigurationError: com.sun.xml.parser.SAXParserFactoryImpl at org.apache.fop.apps.TraxInputHandler.getXMLFilter(TraxInputHandler.java:103) at java.lang.reflect.Method.invoke(Native Method) at org.apache.fop.apps.XSLTInputHandler.getParser(XSLTInputHandler.java:102) at PDFTest.init(PDFTest.java:29) at PDFTest.main(PDFTest.java:41) - javax.xml.transform.TransformerConfigurationException: javax.xml.parsers.FactoryConfigurationError: com.sun.xml.parser at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:815) at org.apache.xalan.processor.TransformerFactoryImpl.newXMLFilter(TransformerFactoryImpl.java:486) at org.apache.fop.apps.TraxInputHandler.getXMLFilter(TraxInputHandler.java:84) at java.lang.reflect.Method.invoke(Native Method) at org.apache.fop.apps.XSLTInputHandler.getParser(XSLTInputHandler.java:102) at PDFTest.init(PDFTest.java:29) at PDFTest.main(PDFTest.java:41) - javax.xml.transform.TransformerException: javax.xml.parsers.FactoryConfigurationError: com.sun.xml.parser.SAXParserFac at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:813) at org.apache.xalan.processor.TransformerFactoryImpl.newXMLFilter(TransformerFactoryImpl.java:486) at org.apache.fop.apps.TraxInputHandler.getXMLFilter(TraxInputHandler.java:84) at java.lang.reflect.Method.invoke(Native Method) at org.apache.fop.apps.XSLTInputHandler.getParser(XSLTInputHandler.java:102) at PDFTest.init(PDFTest.java:29) at PDFTest.main(PDFTest.java:41) - org.xml.sax.SAXException: javax.xml.parsers.FactoryConfigurationError: com.sun.xml.parser.SAXParserFactoryImpl at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:771) at org.apache.xalan.processor.TransformerFactoryImpl.newXMLFilter(TransformerFactoryImpl.java:486) at org.apache.fop.apps.TraxInputHandler.getXMLFilter(TraxInputHandler.java:84
Re: Newbie question: Error: Null
Paul I haven't had much luck with XSLTInputHandler For some reason I could never get it working. I used org.apache.fop.tools.xslt.XSLTransform instead and everything works great. I have attached my code for a servlet, so to use it in your application substitute all the ByArrayOutputStream to FilOutputStream and it should work. I haven't tried it but if you have problems I'll try it give you feedback if neccessary. /*--Code snippet begin ---*/ String xmlFile=file:C:\\yourfile.xml; String xmlFile=file:C:\\yourfile.xsl; java.io.Reader reader; Writer writer = new StringWriter(); try{ ByteArrayOutputStream out = new ByteArrayOutputStream(); XSLTransform.transform(xmlFile, xslFile, writer); writer.flush(); writer.close(); reader = new StringReader(writer.toString()); Driver driver = new Driver(new InputSource(reader), out); driver.setRenderer(Driver.RENDER_PDF); driver.run(); byte[] content = out.toByteArray(); response.setContentType(application/pdf); response.setContentLength(content.length); response.getOutputStream().write(content); response.getOutputStream().flush(); } catch (Exception ex) { throw new ServletException(ex); } /* */ Paul Kowlessar wrote: Hi Amit, I'm sorry; I should have mentioned that these errors occur while running the standalone application as well. As to your question, I want to use Fop within an application on the client side. Cheers...Paul Amit wrote: Paul, There is already a class which will take the xml, xsl files and outpu a pdf! There is also a batch file (if you or unix a shell script) which will do this for you. It is is in your fop installation directory and is called fop.bat (fop.sh on unix). This is for a standalone application. Are you trying to create a servlet which will out put PDF files with the xml and xsl files as input? Amit Paul Kowlessar wrote: Hi, I have just downloaded FOP 0.20.2 and have included the appropriate jars into my classpath. To test my installation, I have created a simple program based on the code in the Embedding FOP page. Here is the code: // import java.util.*; import java.io.*; import java.io.FileOutputStream; import org.apache.fop.apps.*; import org.xml.sax.*; import org.apache.avalon.framework.logger.*; import org.apache.log.*; public class PDFTest { public PDFTest() { Logger log = null; Hierarchy hierarchy = Hierarchy.getDefaultHierarchy(); log = hierarchy.getLoggerFor(fop); log.setPriority(Priority.WARN); String xmlFile = c:\\worktemp\\01M10_YVR_FA.xml; String xslFile = c:\\worktemp\\bidreport.xsl; String pdfFile = c:\\worktemp\\outFile.pdf; FileOutputStream output = null; try{ output = new FileOutputStream(pdfFile); Driver driver = new Driver(); driver.setLogger(log); driver.setRenderer(Driver.RENDER_PDF); XSLTInputHandler inputHandler = new XSLTInputHandler(new File(xmlFile), newFile(xslFile)); org.xml.sax.XMLReader parser = inputHandler.getParser(); driver.setOutputStream(output); driver.render(parser,inputHandler.getInputSource()); }catch (Exception ex){ ex.printStackTrace(); } } public static void main(String[] args) { PDFTest test = new PDFTest(); } } /*/ This file compiles with no problem. However, when I try to run it the following errors are encountered: org.apache.fop.apps.FOPException at org.apache.fop.apps.XSLTInputHandler.getParser(XSLTInputHandler.java:109) at PDFTest.init(PDFTest.java:29) at PDFTest.main(PDFTest.java:41) - java.lang.reflect.InvocationTargetException: org.apache.fop.apps.FOPException: javax.xml.parsers.FactoryConfigurationE at org.apache.fop.apps.TraxInputHandler.getXMLFilter(TraxInputHandler.java:103) at java.lang.reflect.Method.invoke(Native Method) at org.apache.fop.apps.XSLTInputHandler.getParser(XSLTInputHandler.java:102) at PDFTest.init(PDFTest.java:29) at PDFTest.main(PDFTest.java:41) - - org.apache.fop.apps.FOPException: javax.xml.parsers.FactoryConfigurationError: com.sun.xml.parser.SAXParserFactoryImpl at org.apache.fop.apps.TraxInputHandler.getXMLFilter(TraxInputHandler.java:103) at java.lang.reflect.Method.invoke(Native Method) at org.apache.fop.apps.XSLTInputHandler.getParser(XSLTInputHandler.java:102
Re: image on every pdf page
you are right my static-content region wasn't big enough. thanks for your help [EMAIL PROTECTED] wrote: I think you want height' and width NOT content-height and content-width on your external-graphic. Make your static-content region-before real big for testing (extent=2in), then trim it down. If the image doesn't fit in the static region it will be blank. I bet the static region is working when it's not showing, you just need to make the region larger because your graphic height and width are not sizeing correctly. I found I had to leave a buffer zone. Other Thoughts: make sure your using a repeatable-page-master of some type (not a single-page-master-reference) in your page-sequence-master. fop-dev-return-10566-jthaemlitz=oreillyauto.com@XML. APACHE.ORG To: [EMAIL PROTECTED] cc: 09/26/01 02:50 PM Subject: Re: image on every pdf page Please respond to fop-dev My code is listed below...the image does not show up in the pdf fo:static-content flow-name=xsl-region-before fo:block fo:external-graphic src=http://localhost:8100/somepic.gif; content-height=3cm content-width=8cm/ /fo:block /fo:static-content If i take out the static -content tag the picture shows up one page [EMAIL PROTECTED] wrote: You need to set up the static content areas (you probably already have region-before and region-after in your simple-page-master). You'll want to put in one of the following in your page-sequence depending on where you want it to show up. static-content flow-name=xsl-region-before (for English TOP area) static-content flow-name=xsl-region-after (for English BOTTOM area) static-content flow-name=xsl-region-start (for English LEFT area) static-content flow-name=xsl-region-end (for English RIGHT area) JohnPT fop-dev-return-10563-jthaemlitz=oreillyauto.com@XML. APACHE.ORG To: [EMAIL PROTECTED] cc: 09/26/01 01:05 PM Subject: image on every pdf page Please respond to fop-dev I have images working .. fo:block fo:external-graphic src=http://localhost:8100/somepic.gif content-height=3cm content-width=8cm/ /fo:block Is there a way so that this image is always on a page when a page break occurs in the pdf file.(kindda like page numbers..) thanks Amit - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Page Breaks
Is there a way to insert a bage break in the pdf that I am trying to generate using a xsl fo tag in my xsl file? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: colspan-type feature
Thank you all for helping out. I have both the number-columns-spanned and number-rows-spanned working Amit Amit wrote: hi all In my xsl file I want to basically have a feature like html's colspan. Anybody know the syntax ..I have tried looking a few places and haven't been able to find it. Any help would be appreciated. Thanks Amit - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
image on every pdf page
I have images working .. fo:block fo:external-graphic src=http://localhost:8100/somepic.gif content-height=3cm content-width=8cm/ /fo:block Is there a way so that this image is always on a page when a page break occurs in the pdf file.(kindda like page numbers..) thanks Amit - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: image on every pdf page
My code is listed below...the image does not show up in the pdf fo:static-content flow-name=xsl-region-before fo:block fo:external-graphic src=http://localhost:8100/somepic.gif; content-height=3cm content-width=8cm/ /fo:block /fo:static-content If i take out the static -content tag the picture shows up one page [EMAIL PROTECTED] wrote: You need to set up the static content areas (you probably already have region-before and region-after in your simple-page-master). You'll want to put in one of the following in your page-sequence depending on where you want it to show up. static-content flow-name=xsl-region-before (for English TOP area) static-content flow-name=xsl-region-after (for English BOTTOM area) static-content flow-name=xsl-region-start (for English LEFT area) static-content flow-name=xsl-region-end (for English RIGHT area) JohnPT fop-dev-return-10563-jthaemlitz=oreillyauto.com@XML. APACHE.ORG To: [EMAIL PROTECTED] cc: 09/26/01 01:05 PM Subject: image on every pdf page Please respond to fop-dev I have images working .. fo:block fo:external-graphic src=http://localhost:8100/somepic.gif content-height=3cm content-width=8cm/ /fo:block Is there a way so that this image is always on a page when a page break occurs in the pdf file.(kindda like page numbers..) thanks Amit - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: Running Fop using tomcat
Peter, Use a servlet instead of a a jsp page. There should be an example of how to do it in the path-to-fop\docs\examples Thanks Amit Peter Mathew wrote: Dear Friends, I'm in a fix,new to Fop and its termnologies Please help me, Thanks in advance I'm using Fop 0.17.0 DEV I need to create a pdf file using FOP,I've created the necessary xml,xsl file and is working fine using commandline instruction java org.apache.fop.apps.XalanCommandLine foo.xml foo.xsl foo.pdf Now the problem I'm writing a jsp file in which i'm creating a runtime object using Runtime.getRuntime(); Using the Runtime object I'm trying to run the above CommandLine instruction,it's afailure. What should I do.Any alternate way, Please help me out, Thanks once again, Peter __ Terrorist Attacks on U.S. - How can you help? Donate cash, emergency relief information http://dailynews.yahoo.com/fc/US/Emergency_Information/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
IE6
Hi all, I finally got all my stuff working in netscape but not in IE6. In IE6 there just a blank page. No errors nothing. I am on WInNT and using Acrobat reader5 Here is my code: public void makePDF(String xmlFile, String xslFile, HttpServletResponse response) throws ServletException { java.io.Reader reader; Writer writer = new StringWriter(); try { ByteArrayOutputStream out = new ByteArrayOutputStream(); XSLTransform.transform(xmlFile, xslFile, writer); writer.flush(); writer.close(); reader = new StringReader(writer.toString()); Driver driver = new Driver(new InputSource(reader), out); driver.setRenderer(Driver.RENDER_PDF); driver.run(); byte[] content = out.toByteArray(); response.setContentType(application/pdf); response.setContentLength(content.length); response.getOutputStream().write(content); response.getOutputStream().flush(); } catch (Exception ex) { throw new ServletException(ex); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: IE6
I finally got everything working in IE and Netscape .. thanks to all who helped out. Amit wrote: Hi all, I finally got all my stuff working in netscape but not in IE6. In IE6 there just a blank page. No errors nothing. I am on WInNT and using Acrobat reader5 Here is my code: public void makePDF(String xmlFile, String xslFile, HttpServletResponse response) throws ServletException { java.io.Reader reader; Writer writer = new StringWriter(); try { ByteArrayOutputStream out = new ByteArrayOutputStream(); XSLTransform.transform(xmlFile, xslFile, writer); writer.flush(); writer.close(); reader = new StringReader(writer.toString()); Driver driver = new Driver(new InputSource(reader), out); driver.setRenderer(Driver.RENDER_PDF); driver.run(); byte[] content = out.toByteArray(); response.setContentType(application/pdf); response.setContentLength(content.length); response.getOutputStream().write(content); response.getOutputStream().flush(); } catch (Exception ex) { throw new ServletException(ex); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
FOP WARNING
I am trying to generate PDFs using FOP-0.20.1. The input files are xml and xsl files I am using JRun3.0 with java1.2.2 Here is the error I get WARNING: Unknown formatting object ^root Anybody any ideas? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: FOP WARNING
I am trying this piece of code and it can't find the xml and xsl files... Anybody see anything that I am doing wrong? public void makePDF(String xmlFile, String xslFile, HttpServletResponse response) throws ServletException { java.io.Reader reader; Writer writer = new StringWriter(); try { ByteArrayOutputStream out = new ByteArrayOutputStream(); XSLTransform.transform(xmlFile, xslFile, writer); reader = new StringReader(writer.toString()); response.setContentType("application/pdf"); Driver driver = new Driver(new InputSource(reader), out); driver.setRenderer(Driver.RENDER_PDF); driver.run(); byte[] content = out.toByteArray(); response.setContentLength(content.length); response.getOutputStream().write(content); response.getOutputStream().flush(); } catch (Exception ex) { throw new ServletException(ex); } } Any help is greatly appreciated Semprini Davide wrote: Okay, The example that I give is only to explain that you can perform the PDF in two distinc phase 1) perform a trasformation 2) use driver You can use the "tranform method" with input like Dynamic xml (Dom Document) or urlXML and getting out a fo (Dom Document) or Writer object YOU HAVE A LOT OF TRANSFORM TO USE!! YOU HAVE TO SEE THE APIDOC FOR THE COMPLETE DOCUMENTATION For example in my project I use xalan transform and with some conversion I use the Fop driver and my XML is dynamic. WITH Transformer XALAN: StringWriter SstringWriter = new StringWriter(); /* this is the fo file */ StreamResult SstreamResult = new StreamResult(SstringWriter); transformer.transform(SstreamSourceXML, SstreamResult) /* convert the fo file in a right format for driver ByteArrayOutputStream outPDF = new ByteArrayOutputStream(); SResult = SstringWriter.toString(); ByteArrayInputStream str = new ByteArrayInputStream(SResult.getBytes()); Driver driver = new Driver(new InputSource(str), outPDF); Is this performance? I think yes!! Bye Amit wrote: [EMAIL PROTECTED]">Looking at your code I am guessing that you wrote the fo file out to the filesystem and then used the driver to convert it to PDF...how is performance on that? Instead of writing the file out to the file system did you try converting into some sorta stream and use the driver?? thanks for your help Amit Semprini Davide wrote: Hi, I have had the same problem Nobody give me a response! This code in FOP Home page don't work (for me!) ! Driver driver = new Driver(); driver.setRenderer(Driver.RENDER_PDF); InputHandler inputHandler = new XSLTInputHandler(xmlFile, xslFile); XMLReader parser = inputHandler.getParser(); driver.setOutputStream(new FileOutputStream(outFile)); driver.render(parser, inputHandler.getInputSource()); I have solved the problem using 2 phase: 1) generate the transformation using XSLTrasform, Xalan1Transform etc... (you can choose) code: XSLTransform traXSLT = new XSLTransform(); traXSLT.transform(urlXML, urlXSL, urlFoFile); You can choose 4 transform type (see the api documentation) 2) Apply the result at the driver FileInputStream file = new FileInputStream(urlFoFile); response.setContentType("application/pdf"); Driver driver = new Driver(new InputSource(file), out); driver.setRenderer(Driver.RENDER_PDF); driver.run(); byte[] content = out.toByteArray(); response.setContentLength(content.length); response.getOutputStream().write(content); response.getOutputStream().flush(); THIS CODE WORK FINE!!! Bye Amit wrote: [EMAIL PROTECTED]"> I am trying to generate PDFs using FOP-0.20.1. The input files are xml and xsl files I am using JRun3.0 with java1.2.2 Here is the error I get WARNING: Unknown formatting object ^root Anybody any ideas? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
FOP support for number-rows-spanned property
I'm not sure if this is the right place to ask such a question... if not, I would appreciate some information on where to find a solution to this problem :- I've been trying to use the number-rows-spanned property to generate tables in my PDF file using FOP 0.18.1. However, I keep getting errors - is the number-rows-spanned property not implemented in FOP yet? Thanks for your help amit - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]