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]
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 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
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
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 prolems there alos? 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]