thanks for the idea. I will check out getLogger(). Your first suggestion looks like the best bet.
my fop servlet sends the pdf outputstream to a file, not the browser, so all I have to do is redirect the log output to the browser somehow...instructing it to reload every time there is a log event....or something like that. It would be possible to create a progress bar from that log info, which would be very cool as well. thanks for the help. will -----Original Message----- From: J.Pietschmann [mailto:[EMAIL PROTECTED] Sent: Saturday, June 08, 2002 3:51 PM To: [EMAIL PROTECTED] Subject: Re: embedded fop...show progress? Carter, Will wrote: > I am using fop in a servlet. Has anyone ever come up with a way to report > back to the browser where it's at in the converting process from an fo file > to a to pdf? I haven't tried personally but you can try various approaches. One could be to send back a text/html and redirect the FOP log into the servlet's output stream (look into the source of Driver.java:getLogger(), create a target with the servlet output stream instead of System.out), after FOP finished insert a JavaScript redirecting to another URL or simply reloading, intercept the new request and send the buffered PDF. Of course, this requires JavaScript or some other client side script language enabled. Another possiblity could be to send a MIME multipart reply, first some HTML as described above, then the PDF as second part or attachment. I have no real good idea how this should work, and it is quite possible that different browsers will react differently, however, the user should at least be offered to download and save the PDF. Consult a guru for the HTTP and MIME realm for details. Yet another possibiility is to use an applet (yes, applet), which "phones home", i.e. opens a connection back to the server which can be used to push progress info to the client and finally the PDF itself. This could be problematic for clients behind firewalls or with rather strict security policies for the Java sandbox. You see, there is no sure-fire solution, though something will work at least in a controlled environment link an intranet. > when I run fop at my command line in debug mode, it reports along the way > when a page is completes. Anybody know how I could get that info when fop > is running in a servlet? Look at getLogger() in Driver.java. J.Pietschmann
