IE reloads the PDF document generated from servlet multiple times (2 times!)
Hi FOP Users, Has anyone come across the problem of Servlet getting called multiple times by IE (ver 5.5) I use the following to render PDF using an input source, however I see in log that that IE calls my servlet 2 times! I use the following code as in the example for embedding fop in servlet - -- response.setContentType(application/pdf); Driver driver = new Driver(inputSource, response.getOutputStream()); driver.setRenderer(Driver.RENDER_PDF); driver.run(); -- Aparently I noticed that after the first time my servlet is done processing the XSLT, IE 5.5 launches the PDF pluggin!, The PDF pluggin again repeats the whole XSLT transform, and only then it display the PDF output. Anybody has similar experience with IE 5.5 ? any ideas/suggestions are appreciated. Thanks!, Dharmendra
RE: IE reloads the PDF document generated from servlet multiplet imes (2 times!)
Hi Savino, Thanks so much, it works for me. It definitely saves the extra time spent in reload of servlet. However I used the cache-control directive for IE :- -- response.setHeader(Cache-Control, max-age=10); // workaround so IE does not refresh/reload PDF page again/twice -- regds, Dharmendra -Original Message- From: Savino, Matt C [mailto:[EMAIL PROTECTED] Sent: Thursday, March 07, 2002 1:51 PM To: '[EMAIL PROTECTED]' Subject: RE: IE reloads the PDF document generated from servlet multiplet imes (2 times!) This is a known issue. There seem to be several approaches, which may depend on your particular situation. There's a full discusssion of this on the fop-dev list under the subject 'FO - PDF works with Netscape, not with IE' which has the code for my solution (you can find it in the archives if not subscribed). I believe this is also going to be in the FAQ soon. Please let me know if you have more questions. -Matt -Original Message- From: Sharan, Dharmendra [mailto:[EMAIL PROTECTED] Sent: Thursday, March 07, 2002 9:41 AM To: [EMAIL PROTECTED] Subject: IE reloads the PDF document generated from servlet multiple times (2 times!) Hi FOP Users, Has anyone come across the problem of Servlet getting called multiple times by IE (ver 5.5) I use the following to render PDF using an input source, however I see in log that that IE calls my servlet 2 times! I use the following code as in the example for embedding fop in servlet - -- response.setContentType(application/pdf); Driver driver = new Driver(inputSource, response.getOutputStream()); driver.setRenderer(Driver.RENDER_PDF); driver.run(); -- Aparently I noticed that after the first time my servlet is done processing the XSLT, IE 5.5 launches the PDF pluggin!, The PDF pluggin again repeats the whole XSLT transform, and only then it display the PDF output. Anybody has similar experience with IE 5.5 ? any ideas/suggestions are appreciated. Thanks!, Dharmendra
Dynamic Header in Page Sequence [region-before]
Hi XSL FOP Developers, I want to ask if it is possible to have a dynamic Header implemented in a Page-Sequence. something like ... fo:static-content flow-name=xsl-region-start fo:block font-size=16pt font-weight=bold font-family=sans-serif xsl:text From: /xsl:text xsl:value-of select=@tableStart/ xsl:text To: /xsl:text xsl:value-of select=@tableStart/ /fo:block /fo:static-content fo:static-content flow-name=xsl-region-body !-- XSL FO code to process the xml goes here... -- !-- This body content gets page header using the xsl-region-start above -- !-- Is is possible to have a different header for this/each page -- !-- depending on the data being processed eg. let's say we have a xml having car schema -- !-- would it be possible to have the page header vary depending on the car detail being displayed ??? -- !-- (assuming each car gets displayed on its own page i.e. separate page for each car) -- /fo:static-content Assuming an XML like :- Vehicle type=4 wheel drive car category=sedan !-- Car details here... -- /car car category=sports !-- Car details here... -- /car /Vehicle Any ideas ? Is there a better way to achieve the same results ? Any helps/hints/suggestions appreciated. Thanks!, Dharmendra
Recall: Dynamic Header in Page Sequence [region-before]
Sharan, Dharmendra would like to recall the message, Dynamic Header in Page Sequence [region-before].
RE: Does fo:basic-link work with 0.20.1 ?
Hi Anil, use something like... fo:block font-size=8pt font-family=sans-serif text-align=justify fo:inline font-style=italic URL: /fo:inline !-- text-med-blue -- fo:basic-link color=#99 text-decoration=underline external-destination=[EMAIL PROTECTED] fo:inline font-size=8pt xsl:value-of select=@applicableUrl/ /fo:inline /fo:basic-link /fo:block [EMAIL PROTECTED] may be replaced with your URL...eg.http://www.oracle.com or as a variable shown in example above hth, Dharmendra -Original Message- From: Anil Pinto [mailto:[EMAIL PROTECTED] Sent: Sunday, January 27, 2002 7:53 PM To: [EMAIL PROTECTED] Subject: Does fo:basic-link work with 0.20.1 ? Hi all, I was trying out the fo:basic-link but couldn't get it to work. Was wondering if has successfully used it I am using the tag within a fo:block as follows fo:block fo:basic-link external-destination=http://www.oracle.com; color=blue text-decoration=underlineOracle fo:basic-link /fo:block any help will be greatly appreciated :-) Anil. __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com
Unsatisfied link error on Unix: using FOP for PDF output with GIFs
Hi, I was trying to generate PDF file using XSL:FO and when the path to image(gif) is incorrect the PDF does shows up without the GIF. however, when the path is corrrect, it tries to load the GIF it runs into Unsatidfied Link Error. I was wondering if FOP needs any particular X11 library on Unix for drawing the Gifs Parsing of document complete, stopping renderer java.lang.UnsatisfiedLinkError: exception occurred in JNI_OnLoad at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1382) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1298) at java.lang.Runtime.loadLibrary0(Runtime.java:749) at java.lang.System.loadLibrary(System.java:820) at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:53) at java.security.AccessController.doPrivileged(Native Method) at sun.awt.image.NativeLibLoader.loadLibraries(NativeLibLoader.java:41) at sun.awt.image.GifImageDecoder.clinit(GifImageDecoder.java:367) at sun.awt.image.InputStreamImageSource.getDecoder(InputStreamImageSource.java: 222) at sun.awt.image.URLImageSource.getDecoder(URLImageSource.java:142) at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:251 ) at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:217) at sun.awt.image.ImageFetcher.run(ImageFetcher.java:185) Any ideas ? What must be included in LD_LIBRARY_PATH ? Thanks (in anticipation!), Dharmendra
alignment of leader/rule ?
Hi, I am using Fop-0.20.1 and have been trying to have a fo:leader to be aligned in the middle/center, however it defaults to the baseline/bottom. ie. it is currently like the following :- THIS IS A TITLE LINE _ here are the details on the tile - However I want it to be as follows :- THIS IS A TITLE LINE [this line should be a solid line as shown in above, but vertically aligned in the center/middle] here are the details on the tile - I have looked at 'alignment-adjust' and 'alignment-baseline' however I get the warning that it is not implemented yet!. Is there a different approach to the same ? or anything I am missing something here ? pls. help. Thanks (in anticipation!), Dharmendra
Using FOP in Servlet - *dynamically* generating XSL:FO using XML and XSLT
Hi, I am trying to have use XSL:FOP through servlet and I was hoping to use XML and XSLT to dynamically generate the XSL:FOP format file to be passed to Driver for rendering as PDF. The example which comes with distribution uses xmlFile and xslFile, however I wanted to generate the XML and XSL at run time and to be able to pass the output into the Driver for rendering a PDF. However I found that currently XSLTInputHandler constructor only accepts xmlFile and xslFile? Is there a possible way where I can have the xsl:fo be generated dynamically and be able to pass it to Driver as an InputSource for rendering. (since InputSource constructor does accept/allow InputStream) Am I missing something ? or Do I need to write my own handler ? I am lost here... pls. help. Thanks (in anticipation!), Dharmendra
Unix - FOP throwing classdef not found error
Hi, I am getting java runtime errors on Unix, I had copied all the relevant jars ie. fop.jar xalan-2.0.0.jar batik.jar jimi-1.0.jar xalanj1compat.jar, however I am using an older version of xerces (xerces.jar) instead of xerces.jar-1.2.3.jar since the rest of classes that I am using require that. I do not get any errors on the fonts and I do the messages from the driver.run() call... here's the stackTrace for the same :- Is there anything I am missing ?? Is there anything I am missing on the LD_LIBRARY_PATH ?? or could be caused by the older version of xerces ??? I am reading the xsl:fo file and am using font-family as 'sans-serif' in the xsl:fo format file for PDF generation. The same however does work on WinNT with SP6. Any pointers/help would be appreciated. Thanks (in anticipation!), Dharmendra PS: PDF generation is really cool! ;-) -- [1Tue Aug 28 16:41:40 EDT 2001:E ServletContext-General Servlet failed with Exception java.lang.NoClassDefFoundError at org.apache.fop.layout.LineArea.addSpacedWord(LineArea.java:1307) at org.apache.fop.layout.LineArea.addText(LineArea.java:324) at org.apache.fop.fo.FOText.addRealText(FOText.java:272) at org.apache.fop.fo.FOText.addText(FOText.java:239) at org.apache.fop.fo.FOText.layout(FOText.java:151) at org.apache.fop.fo.flow.BasicLink.layout(BasicLink.java:118) at org.apache.fop.fo.flow.Block.layout(Block.java:260) at org.apache.fop.fo.flow.Flow.layout(Flow.java:150) at org.apache.fop.fo.flow.Flow.layout(Flow.java:109) at org.apache.fop.fo.pagination.PageSequence.format(PageSequence.java:295) at org.apache.fop.apps.StreamRenderer.render(StreamRenderer.java:166) at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:155) at org.apache.xerces.parsers.SAXParser.endElement(SAXParser.java:1398) at org.apache.xerces.validators.common.XMLValidator.callEndElement(XMLValidator .java:1019) at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XM LDocumentScanner.java:1256) at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner. java:381) at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:948) at org.apache.fop.apps.Driver.render(Driver.java:424) at org.apache.fop.apps.Driver.run(Driver.java:508) at com.gs.eq.horizon.view.ReportServlet.renderFO(ReportServlet.java:64) at com.gs.eq.horizon.view.ReportServlet.process(ReportServlet.java:44) at com.gs.eq.horizon.view.HorizonBase.doProcess(HorizonBase.java:98) at com.gs.eq.horizon.view.HorizonBase.doGet(HorizonBase.java:30) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:865) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java :124) at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp l.java:755) at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp l.java:703) at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext Manager.java:247) at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:361) at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:261) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120) --