xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roberto Nunnari <roberto.nunn...@supsi.ch>
Subject Re: fop in a servlet in 0.91beta very different from 0.20.5
Date Fri, 10 Feb 2006 19:14:06 GMT
Hello Jeremias.

Yes. You're right. There was a problem with the FO document..
in effect it was the same as the one I had a week ago caused
by the title element.

Anyways, I managed to move from 0.20.5 to 0.91beta and have it
generate correctly the pdf.

The only problem was with the trick I had used in 0.20.5
with the last marker so that the last page would not have the
subtotal on the last page. The difference:
- 0.20.5: <marker marker-class-name="subtotalvalue"></marker>
- 0.91beta: <marker marker-class-name="subtotalvalue"> </marker>

as you see, the only difference is that in 0.91beta a space
is necessary to have fop use an empty string on the last page
instead of the last non empty marker.

Also, 0.91beta correctly renders the subtotal in bold while
0.20.5 doesn't.

Ok. Next week I'll deploy 0.91beta in the production environment
and if all will be well, after a couple of weeks I'll report

Just one more question:
I need be sure a small table will be shown all on the same page
and not split across two pages.. What is the best way to go
with 0.91beta ? Is it possible to achive that using several table-row
or should I use put all content in a single table-row?

Thank you and best regards.

Jeremias Maerki wrote:
> I can't reproduce the problem. Here's what I've done:
> - Created a new servlet cass extending from HttpServlet.
> - Copy/pasted the sample code from http://xmlgraphics.apache.org/fop/0.91/servlets.html#xslt
> into the servlet class (in an empty doGet() method)
> - Added a try/catch around everything to get rid of the exception errors.
> - Removed the Source for the stylesheet so I get an identity
> transformation.
> - I then ran the servlet in Jetty and the PDF was generated just fine.
> - Then, I did the same with the code you posted. I only replaced your
> offer stuff with a simple StreamSource to an existing FO file.
> - I then ran the servlet in Jetty and the PDF was generated just fine.
> Concerning Constants.RENDER_PDF: I forgot to update that part when I
> updated the docs for the last release. This is fixed on the web. But you
> obviously found the right thing to change.
> So, I think your code is ok (except for the offer stuff which I find
> very suboptimal from a performance POV). It must be something else.
> Since you catch any exception with an e.printStackTrace() (probably not
> the best idea) I assume you got an exception in your code and didn't
> check the log output of your web container. The web container probably
> sends back an empty document to the browser in this case.
> BTW, it's a good idea to extract the FOP-specific code into a separate
> class which you can test and debug outside the web container.
> On 10.02.2006 12:30:12 Roberto Nunnari wrote:
>>Hello list.
>>I'm trying to move from 0.20.5 to 0.91beta.
>>Here's a problem I'm facing: following the instruction
>>in the documentation that comes the 0.91beta, lead to
>>code that doesn't compile.
>>So I modified it as follows to be able to compile, but
>>the result I get executing it wrong.. I get an empty
>>text/html document instead of the expected application/pdf
>>below's the code in the get/post servlet method and probably
>>the main difference from the documentation is the parameter
>>in the Fop constructor MimeConstants.MIME_PDF vs Constants.RENDER_PDF).
>>Note that this code is the same I used with FOP 0.20.5 with
>>just a few modification:
>>1) no Driver, but Fop
>>2) no driver.run() but transformer.transform()
> <snip/>
> Jeremias Maerki
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org

               Roberto Nunnari -software engineer-
  Scuola Universitaria Professionale della Svizzera Italiana
              Dipartimento Tecnologie Innovative
  Via Cantonale                        tel: +41-91-6108561
  6928 Manno                 """       fax: +41-91-6108570
  Switzerland               (o o)

To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org

View raw message