RE: servlet called thrice on IE 4.0
I can't specify the source of this advice exactly, because I forgot it (it was somewhere on Microsoft's website), but what the article said was that when IE sends these multple requests, they are actually different in something like UserAgent http header (a better header they couldn't find!). Only the last request needs to return the actual PDF document, the first one or two requests only look for Content-Type of the response. If you investigate (by dumping all fields from the HttpServletRequest) and find something of this kind, please post to the list. YS -Original Message- From: David Frankson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 20, 2001 4:02 PM To: [EMAIL PROTECTED] Subject: Re: servlet called thrice on IE 4.0 It is a behavior that is unavoidable in IE. I cache the pdf and return it on the second hit. Dave - Original Message - From: Savino, Matt C [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 20, 2001 11:09 AM Subject: servlet called thrice on IE 4.0 I know this has been discussed here before, but I just wanted to ask in case anyone has discovered a solution. Basically I'm etting that problem where IE is calling the FOP servelt twice. Only on Weblogic, the second call seems to be causing a socket error. The net result is that the servelt has to be called three times to actually work (I've pasted the output below). I've verified that IE 4.72 and beyond don't see this problem. Just wondering if anyone ever found a fix. Thanks a lot, Matt Below is the output from ONE call to http://localhost:7001/resultview/ReportGenerator.jsp?counter=25 (the 'counter=' piece is put in to avoid IE-early-version caching problem): servlet: session ID = O1qHKkV5IXQWz0y11xfOSj8vbLdv3Uzl9lVf5mSDqcEHTJtX7mca!-2004853107!-1675706787 !7001!7002!1006274346312 ReportGeneratorServlet says hiTue Nov 20 09:09:49 PST 2001 srd.contentType = pdf srd.reportId = 1001 reportProps.getProperty(report1001) = lr Writing XML source to: C:\bea\wlserver6.1\ReportOutput.xml Writing FO source to: C:\bea\wlserver6.1\ReportOutput.xml building formatting object tree setting up fonts [1] [2] Parsing of document complete, stopping renderer Initial heap size: 45687Kb Current heap size: 52679Kb Total memory used: 6991Kb Memory use is indicative; no GC was performed These figures should not be used comparatively Total time used: 1688ms Pages rendererd: 2 Avg render time: 844ms/page servlet: session ID = O1qHKkV5IXQWz0y11xfOSj8vbLdv3Uzl9lVf5mSDqcEHTJtX7mca!-2004853107!-1675706787 !7001!7002!1006274346312 ReportGeneratorServlet says hiTue Nov 20 09:09:51 PST 2001 srd.contentType = pdf srd.reportId = 1001 reportProps.getProperty(report1001) = lr Writing XML source to: C:\bea\wlserver6.1\ReportOutput.xml Writing FO source to: C:\bea\wlserver6.1\ReportOutput.xml building formatting object tree setting up fonts [1] [2] Parsing of document complete, stopping renderer Initial heap size: 53805Kb Current heap size: 61054Kb Total memory used: 7249Kb Memory use is indicative; no GC was performed These figures should not be used comparatively Total time used: 1563ms Pages rendererd: 2 Avg render time: 781ms/page Nov 20, 2001 9:09:53 AM PST Error HTTP [WebAppServletContext(1024240,RVWebApp1,/RVWebApp1)] Root cause of ServletException java.net.SocketException: Connection aborted by peer: socket write error at java.net.SocketOutputStream.socketWrite(Native Method) at java.net.SocketOutputStream.write(SocketOutputStream.java:83) at weblogic.servlet.internal.ChunkUtils.writeChunkNoTransfer(ChunkUtils.java:20 2) at weblogic.servlet.internal.ChunkUtils.writeChunks(ChunkUtils.java:167) at weblogic.servlet.internal.ChunkOutput.flush(ChunkOutput.java:248) at weblogic.servlet.internal.ChunkOutput.checkForFlush(ChunkOutput.java:306) at weblogic.servlet.internal.ChunkOutput.write(ChunkOutput.java:197) at weblogic.servlet.internal.ChunkOutputWrapper.write(ChunkOutputWrapper.java:1 25) at weblogic.servlet.internal.ServletOutputStreamImpl.write(ServletOutputStreamI mpl.java:155) at java.io.OutputStream.write(OutputStream.java:61) at com.questdiagnostics.applications.resultview.servlet.ReportGeneratorServlet. renderPdf(ReportGeneratorServlet.java:171) at com.questdiagnostics.applications.resultview.servlet.ReportGeneratorServlet. renderReport(ReportGeneratorServlet.java:120) at com.questdiagnostics.applications.resultview.servlet.ReportGeneratorServlet. service(ReportGeneratorServlet.java:67) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java :265) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java :200) at
RE: New FOP Code Don't Work
I could not get driver.setLogger(logger); to compile. The versions I have of FOP (0.19 and 0.20.1) do not have a ^^^ Wow! You neglected to mention that, didn't you? ;-) I guess I had to be more specific about which version of FOP I use when I posted the code. 0.20.1 never worked for me at all, I had to build from CVS until 0.20.2RC came out. With 0.19 the method works, but FOP doesn't really produce the PDF on the fly, instead it builds the whole FO tree in memory, and after the parsing is done you have to call driver.format(); driver.render(); In other words, you don't buy much by using SAX events with 0.19. 0.20.2RC has a major improvement for more streamlined processing. Yuri. -Original Message- From: Jim Urban [mailto:[EMAIL PROTECTED]] Sent: Monday, November 19, 2001 3:02 PM To: [EMAIL PROTECTED] Subject: RE: New FOP Code Don't Work The method that calls my renderFo creates the iInputSource as follows: Source iInputSource= new StreamSource(new StringReader(xmlString)); My translator is cached, and worked fine with my orginal code. I get no exceptions. Where would I see error messages? I could not get driver.setLogger(logger); to compile. The versions I have of FOP (0.19 and 0.20.1) do not have a org.apache.fop.apps.Driver.setLogger(org.apache.log.Logger) method. I am using Xalan/Xerces, does this matter? Jim -Original Message- From: Shkuro, Yuri [mailto:[EMAIL PROTECTED]] Sent: Monday, November 19, 2001 1:42 PM To: '[EMAIL PROTECTED]' Subject: RE: New FOP Code Don't Work As far as I can tell, the code is correct (although you didn't indicate how you create iInputSource). Are you sure you are not getting any exceptions, error messages, etc.? -Original Message- From: Jim Urban [mailto:[EMAIL PROTECTED]] Sent: Monday, November 19, 2001 2:38 PM To: [EMAIL PROTECTED] Subject: New FOP Code Don't Work Recently someone suggested using SAX events to run XML through XSLT then FOP and to send the PDF back to the browser from a servlet. I tried implmenting this (see code below) but all I don't get any output back. I even routed the output to a file, and the file was empty. My old code worked great, but I was told I was wasting memory. Can someone tell me why this code does not work? Thanks, Jim Urban Product Manager Netsteps Inc. Suite 505E 1 Pierce Pl. Itasca, IL 60143 Voice: (630) 250-3045 x2164 Fax: (630) 250-3046 public void renderFO(Transformer pdfTransformer, Source iInputSource, HttpServletResponse uResponse) { try { OutputStream out = uResponse.getOutputStream(); uResponse.setContentType(application/pdf); Driver driver = new Driver(); driver.setRenderer(driver.RENDER_PDF); driver.setOutputStream(out); // --- // Create SAXResult based on FOP Driver content handler // which will accept SAX events and build FOP tree // --- Result saxResult = new SAXResult(driver.getContentHandler()); // Use the Transformer to transform an XML Source and // send the output to a Result object. Implicitely it will // create the FOP tree by firing SAX events. pdfTransformer.transform(iInputSource, saxResult); // The user is already viewing the PDF! out.flush(); out.close(); } catch (TransformerException e1) { System.err.println(Unable to generate PDF: + e1.toString()); } catch (IOException e2) { System.err.println(File error: + e2.toString()); } } - 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]
RE: Question on XSLTInputHandler
If your string XML is going to be run through XSLT like Xalan, it WILL BE parsed anyway, and most likely it will be parsed using a SAX parser (the default Xalan behavior). Therefore there is no overhead whatsoever compared to what you would do in any other solution. In fact, if you look at the code I sent yesterday, the main issue was not with parsing the original XML (this is given), but with avoiding the necessity to store the intermediate xsl:fo document that comes out of the transformer before being fed into FOP. By using SAX events at this point you save a lot of memory and streamline the process. Yuri. -Original Message- From: Ulrich Mayring [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 13, 2001 4:24 AM To: [EMAIL PROTECTED] Subject: Re: Question on XSLTInputHandler [EMAIL PROTECTED] wrote: You can use org.apache.fop.apps.Driver to get the org.xml.sax.helpers.DefaultHandler and fire sax events on that. Well, my XML is unparsed and in the form of a java.lang.String, so parsing it just to fire SAX events seems to be a bit of an overhead, no? You're probably wondering where my XML is coming from, if it is unparsed, a String and not from a file. Well, here goes: I load an XML document from a file. I receive some XML fragments via a socket connection and merge it rather unceremoniously with the XML from the file (via textual replace basically). Then I do some database stuff, which gives me more XML fragments, and I merge them in as well. So, the XML document I have in the end is a java.lang.String and it has been created without any parsing or other standard XML procedures. I'm looking for speed in this case, not intelligence :-) Anyway, thanks everyone for the many tips, I think I'll be able to solve my problem :) cheers, Ulrich -- Ulrich Mayring DENIC eG, Systementwicklung - 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: NameSpace??
I had this problem when I had old IBM's parser.jar hanging around in the classpath. Even putting xerces.jar in front didn't help, I had to explicitely set up the parser factory: System.setProperty( javax.xml.parsers.SAXParserFactory, org.apache.xerces.jaxp.SAXParserFactoryImpl ); However, your problem may be completely unrelated. YS -Original Message- From: Gerard van Wijk [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 30, 2001 5:41 AM To: '[EMAIL PROTECTED]' Subject: NameSpace?? Hello, ClassLoader loader = this.getClass().getClassLoader(); URL url = loader.getResource(cv.xsl); System.out.println(url); TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformer = tFactory.newTransformer(new StreamSource(new File(url.getFile(; [2001/10/30 11:35:02][1 ][I]: ** Transformer Factory error [2001/10/30 11:35:02][1 ][I]: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: Namespace not supported by SAXParser Does anyone know this error? Gerard - 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: Table Column-Headers
Chris, I am using fo:table-caption successfully. Not sure what kind of feedback you are looking for. BTW, I don't know what you mean by fo:table-caption can host a table - it should contain row definitions, just as fo:table-body, with the same number of columns (the columns widths will be defined prior to that, as usual for fo:table-body). The only difference between caption and body is that the latter will be repated if the table spans multiple pages. Yuri. -Original Message- From: West, Chris [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 24, 2001 7:50 PM To: '[EMAIL PROTECTED]' Subject: Table Column-Headers I'm dynamically generating a table that can have a variable number of rows. In the situation where the table spans multiple pages, I would like to have the first row contain the column labels. I've been able to do this using a style sheet, but it requires that the height of each row be fixed (which I would like to avoid). From the documentation, fo:table-caption can host a table, which could be set up to be a one-row table that contains the column headers. From what I've read, this caption can be made to repeat after crossing a page boundary. Before trying this, I'd like to get some feed back from those more experienced with FOP regarding this approach. I'm using the latest version, 20.2. Thanks in advance, Chris W. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: Table Column-Headers
Sorry, what I said applies to f:table-header, which I am using. Don't know about table-caption. -Original Message- From: Shkuro, Yuri Sent: Monday, October 29, 2001 9:42 AM To: '[EMAIL PROTECTED]' Subject: RE: Table Column-Headers Chris, I am using fo:table-caption successfully. Not sure what kind of feedback you are looking for. BTW, I don't know what you mean by fo:table-caption can host a table - it should contain row definitions, just as fo:table-body, with the same number of columns (the columns widths will be defined prior to that, as usual for fo:table-body). The only difference between caption and body is that the latter will be repated if the table spans multiple pages. Yuri. -Original Message- From: West, Chris [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 24, 2001 7:50 PM To: '[EMAIL PROTECTED]' Subject: Table Column-Headers I'm dynamically generating a table that can have a variable number of rows. In the situation where the table spans multiple pages, I would like to have the first row contain the column labels. I've been able to do this using a style sheet, but it requires that the height of each row be fixed (which I would like to avoid). From the documentation, fo:table-caption can host a table, which could be set up to be a one-row table that contains the column headers. From what I've read, this caption can be made to repeat after crossing a page boundary. Before trying this, I'd like to get some feed back from those more experienced with FOP regarding this approach. I'm using the latest version, 20.2. Thanks in advance, Chris W. - 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: Making PDFby combining different XML files???
How about this: echo '?xml version=1.0 encoding=ISO-8859-1?' book.xml cat chapter*.xml | grep -v '?xml' book.xml fop.sh -xsl rajeev.xsl -xml book.xml -pdf rajeev.pdf ? -Original Message- From: sunitha nair [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 24, 2001 1:21 AM To: [EMAIL PROTECTED] Subject: RE:Making PDFby combining different XML files??? hello sir, Thanx for ur prompt response.but i think u couldn't understand my question.In the commandline i'm using java -cp org.apache.fop.apps.Fop -xsl rajeev.xsl -xml rajeev.xml -pdf rajeev.pdf that is rajeev.xml is the final xml file which contain lot of chapter xml files.I need chapter files because i want to make pdf of individual chapter other than pdf of entire book as user demands. so my question is how i combine all that chapter files into a single xml file so that i can use the above command line and make the book pdf. as per the above commandline i'm inputting .xml and .xsl(eventhough using the xsl-fo tags). how i make pdf of a book ,if there are two chapter xml files...chapter1.xml chapter2.xml using fop with the same .xsl file for styling. please take cocern. regards sunitha --- Shkuro, Yuri [EMAIL PROTECTED] wrote: Why do you need entities in FOP input? If you use different stylesheets for different chapters, write a Makefile to XSLT them into fo files, then merge and feed into FOP. If you use the same XSL for all chapters, then you can use xsl:include to pull all chapters into a single XML file and transform it to FO. FOP is FO-2-PDF converter, not XML-2-PDF, so it's really up to you how to create an FO file from multiple XML files. YS -Original Message- From: sunitha nair [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 23, 2001 5:54 AM To: [EMAIL PROTECTED] Subject: making pdf by combining different xml files??? Hi all, Is it possible to make pdf from different xml data files using fop. my real need is to make a book on pdf format.I made different xml file for different chapters and an xsl file for styling.If it possible to use dtd entity to combine all xml files and make pdf by that final xml file.Since fop needs an xml and xsl file it is necessary for me to make a xsl for the final xml file(combination of individual chapter XMLs) to make the final book.What xsl I use for component(chapter) xml files.if i use href=.. in chapter xml files will the convertion take place correctly.I tried many ways. but was invain.Is FOP supportDTD and entity references? can anyone please help me. regards sunitha *NEW* Connect to Yahoo! Messenger through your mobile phone *NEW* Visit http://in.mobile.yahoo.com/smsmgr_signin.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] *NEW* Yahoo! Messenger for SMS *NEW* Now on your ORANGE phone Visit http://in.mobile.yahoo.com/smsmgr_signin.html - 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: making pdf by combining different xml files???
Why do you need entities in FOP input? If you use different stylesheets for different chapters, write a Makefile to XSLT them into fo files, then merge and feed into FOP. If you use the same XSL for all chapters, then you can use xsl:include to pull all chapters into a single XML file and transform it to FO. FOP is FO-2-PDF converter, not XML-2-PDF, so it's really up to you how to create an FO file from multiple XML files. YS -Original Message- From: sunitha nair [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 23, 2001 5:54 AM To: [EMAIL PROTECTED] Subject: making pdf by combining different xml files??? Hi all, Is it possible to make pdf from different xml data files using fop. my real need is to make a book on pdf format.I made different xml file for different chapters and an xsl file for styling.If it possible to use dtd entity to combine all xml files and make pdf by that final xml file.Since fop needs an xml and xsl file it is necessary for me to make a xsl for the final xml file(combination of individual chapter XMLs) to make the final book.What xsl I use for component(chapter) xml files.if i use href=.. in chapter xml files will the convertion take place correctly.I tried many ways. but was invain.Is FOP supportDTD and entity references? can anyone please help me. regards sunitha *NEW* Connect to Yahoo! Messenger through your mobile phone *NEW* Visit http://in.mobile.yahoo.com/smsmgr_signin.html - 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: DO NOT REPLY [Bug 4377] New: - JDK 1.1 non-compliance
JDK 1.1 support was voted to be discontinued about a month ago. You may find relevant discussion in the list archive. Please invalidate your bug report. YS -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 23, 2001 3:46 PM To: [EMAIL PROTECTED] Subject: DO NOT REPLY [Bug 4377] New: - JDK 1.1 non-compliance DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4377. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4377 JDK 1.1 non-compliance Summary: JDK 1.1 non-compliance Product: Fop Version: all Platform: All OS/Version: All Status: NEW Severity: Major Priority: Other Component: pdf renderer AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] There is a requirement that Fop run on JDK 1.1.x. It currently will not run on anything earlier than JDK 1.2. I tested this on JDK 1.1.3 for the Sun. The reason is because the code is calling a method that was introduced in JDK 1.2. Namely, java.io.File.getParentFile(). This call is being made from: Options.java line 96 as well as 3 other files. Here is the error reported upon execution of Fop: java org.apache.fop.apps.Fop cv_2001.fo cv_2001.pdf java.lang.NoSuchMethodError: java.io.File: method getParentFile()Ljava/io/File; not found at org.apache.fop.apps.Options.setCommandLineOptions(Compiled Code) at org.apache.fop.apps.CommandLineStarter.init(Compiled Code) at org.apache.fop.apps.CommandLineOptions.getStarter(Compiled Code) at org.apache.fop.apps.Fop.main(Compiled Code) BTW- The version options on this form are (0.15, 0.16, 0.17), which seems to be outdated. I found this defect in version 0.20.1 and 0.20.2. ANOTHER (possible) defect: I don't know if this is related to the defect above, but when I try to build the application on a Sun Ultra 10 with 512 megs of memory, I get this error: java.lang.OutOfMemoryError at java.io.BufferedReader.init(Compiled Code) at java.io.BufferedReader.init(Compiled Code) at sun.tools.java.ScannerInputStream.init(Compiled Code) at sun.tools.java.Scanner.useInputStream(Compiled Code) at sun.tools.java.Scanner.init(Compiled Code) at sun.tools.java.Parser.init(Compiled Code) at sun.tools.javac.BatchParser.init(Compiled Code) at sun.tools.javac.BatchEnvironment.parseFile(Compiled Code) at sun.tools.javac.Main.compile(Compiled Code) at org.apache.tools.ant.taskdefs.compilers.Javac12.execute(Compiled Code) at org.apache.tools.ant.taskdefs.Javac.execute(Compiled Code) at org.apache.tools.ant.Target.execute(Compiled Code) at org.apache.tools.ant.Project.runTarget(Compiled Code) at org.apache.tools.ant.Project.executeTarget(Compiled Code) at org.apache.tools.ant.Project.executeTargets(Compiled Code) at org.apache.tools.ant.Main.runBuild(Compiled Code) at org.apache.tools.ant.Main.main(Compiled Code) [javac] error: An error has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi). [javac] 1 error BUILD FAILED /home/jgombos/tools/package/Fop-0.20.1/build.xml:544: Compile failed, messages should have been provided. I have not investigated this error, but thought it may be useful to document it. - 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: Problems with embedding graphics using fo:instream-foreign-object and svg...
Could somebody please point out what is the benefit of using fo:instream-foreign-object...svg:image ... instead of fo:external-graphic ... ? Thanks, YS -Original Message- From: Beer, Christian [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 18, 2001 4:02 AM To: Fop-liste (E-Mail) Subject: Problems with embedding graphics using fo:instream-foreign-object and svg... Hi Folks! I wanted to embed images using: fo:instream-foreign-object svg:svg width=25mm height=85mm svg:image xlink:href={CompanyLogo/@src} image-rendering=optimizeQuality x=0 y=0 width=25mm height=35mm/ /svg:svg /fo:instream-foreign-object But I get the SVG-Error-Image. Before I updatet to the newest SVG-Version that worked fine... What has happend??? Christian __ DIRON Wirtschaftsinformatik GmbH Co. KG Christian Beer ([EMAIL PROTECTED]) Daimlerweg 39-41Tel. : +49(251)979-200 48163 Muenster Fax : +49(251)979-2020 Germany 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: Problems with embedding graphics using fo:instream-foreign-object and svg...
Jim, Your example is clear to me, but it's different from Christian's case - he does embed external files, that's why I was curious why do it via svg. Maybe his files are svg, that would explain it. I though he meant GIFs or something. Yuri. -Original Message- From: Jim Urban [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 18, 2001 9:36 AM To: [EMAIL PROTECTED] Subject: RE: Problems with embedding graphics using fo:instream-foreign-object and svg... We generate our PDFs on the fly dynamically. These PDFs include dynamically generated graphs. It is vary convenient to embed the graphs (as SVG images) inline rather then creating .svg files and then deleting them after generating the PDFs. Jim -Original Message- From: Shkuro, Yuri [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 18, 2001 8:27 AM To: '[EMAIL PROTECTED]' Subject: RE: Problems with embedding graphics using fo:instream-foreign-object and svg... Could somebody please point out what is the benefit of using fo:instream-foreign-object...svg:image ... instead of fo:external-graphic ... ? Thanks, YS -Original Message- From: Beer, Christian [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 18, 2001 4:02 AM To: Fop-liste (E-Mail) Subject: Problems with embedding graphics using fo:instream-foreign-object and svg... Hi Folks! I wanted to embed images using: fo:instream-foreign-object svg:svg width=25mm height=85mm svg:image xlink:href={CompanyLogo/@src} image-rendering=optimizeQuality x=0 y=0 width=25mm height=35mm/ /svg:svg /fo:instream-foreign-object But I get the SVG-Error-Image. Before I updatet to the newest SVG-Version that worked fine... What has happend??? Christian __ DIRON Wirtschaftsinformatik GmbH Co. KG Christian Beer ([EMAIL PROTECTED]) Daimlerweg 39-41Tel. : +49(251)979-200 48163 Muenster Fax : +49(251)979-2020 Germany 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]
RE: Table Headings
I do have cells like that - some have only one line of text, some have two or more. Since the border is for the cell, not the fo:block inside the cell, it works fine. YS -Original Message- From: Scott Moore [mailto:[EMAIL PROTECTED]] Sent: Monday, October 15, 2001 2:49 PM To: '[EMAIL PROTECTED]' Subject: RE: Table Headings Have one of the cells wrap text so it grows taller than the other cells. Then you'll see the problem. Scott -Original Message- From: Shkuro, Yuri [mailto:[EMAIL PROTECTED]] Sent: Monday, October 15, 2001 2:47 PM To: '[EMAIL PROTECTED]' Subject: RE: Table Headings I put the borders under each cell, and it works fine. fo:table-cell border-bottom-color=black border-bottom-width=1.0pt border-bottom-style=solid Yuri -Original Message- From: Scott Moore [mailto:[EMAIL PROTECTED]] Sent: Monday, October 15, 2001 2:37 PM To: '[EMAIL PROTECTED]' Subject: RE: Table Headings Karen, I have another table related question. I'm trying to add gridlines into the table body by specifying: border-width=1px border-color=black border-bottom-style=solid on the fo:block/ underneath each cell. This only works if each cell is the same height. Although the text is all rows start on the same line, the blocks are only as big as they need to be, thus making the border impossible to line up per cell, if some cells have to wrap text. I've tried putting those attributes on the fo:table-row object, but they are ignored. Is there a way to make gridlines work for variable height cells? Thanks, Scott -Original Message- From: Karen Lease [mailto:[EMAIL PROTECTED]] Sent: Sunday, October 14, 2001 11:46 AM To: [EMAIL PROTECTED] Subject: Re: Table Headings Hi Scott, It sounds like you may be putting the background on the block containing the text. Try putting it on the table-cell itself or even on the row. HTH, Karen Scott Moore wrote: I'm creating tables for FOP that have a black background with white text in the table header. The rest of the table (the data) is inverse, with black characters and white background. If the header text in a column doesn't fit on one line, it will wrap, which is a good thing. The problem is the rest of the headers that don't wrap, their black backgrounds stay on one line. Therefore, the whole table header looks uneven and ugly. Here's an example, the # are the black background: - -#Column#1##|#This#is#column| - |2##| - - Table data| blah blah blah| - Are there any settings that can automatically fix this? I've tried using padding-bottom='1em' for the first column, and that kinda works, but it's still slightly off. The problem is I won't always know which column headings wrap because the fonts are user configurable. Thanks for any help! Scott - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: Embedding fop in IE..Help!!!
I used JSP to stream out PDF files successfully. What may be happenning in your case is that the whitespace between %!% %% is written to the output stream before you start writing the PDF content. Try calling clearBuffer() on the output stream first. YS -Original Message- From: Rajagopal. V [mailto:[EMAIL PROTECTED]] Sent: Monday, October 15, 2001 2:49 PM To: [EMAIL PROTECTED] Subject: Re: Embedding fop in IE..Help!!! Hi Im using a JSP to generate this PDF. I am able to open other Static pdfs. This is what i do, i create a bytearrayoutputstream which will hold the output of the render and then use a pageContext.getOut().print(bytearrayoutputstreamobject); and this results in printing binary content on the screen.. I assume this is bcoz IE doesnt recognize the content type and print jst prints it on the screen, whereas Netscape understands the Content Type and displays it as a PDF. I tried to create a servlet which will generate the PDF(using streams to generate the output) and it works in IE and Netscape. Now, is it not possible to render a PDF using JSP(especially on IE)?? IS there a way? Thanks Raj --- Amit [EMAIL PROTECTED] wrote: Can you open other pdf files (via a link in a html page) in IE? Rajagopal. V wrote: Hi All I have an XML file which i combine with a XSL to generate the FO file and render it. It works fine with Netscape but im having a tough time with IE. It is displaying garbage on teh screen. All i get is binary characters for the PDF File. I have IE 5.5 Sp1. and i tried all the workarounds. These are the ones I tried 1) Changed the name of the file to be .pdf so that IE will look at the extension and treat it as PDF 2) Bloated the file size to be more than 8k so that there is no buffer problem with IE 3) Downloaded the Fo file generated and ran the fo command line and it generates the PDF properly(as an application). So there is nothing wrong with the FO. IS there any other way to get a PDF on IE? Im not sure why im getting binary content all over the screen? Please HElpp... TIA Raj __ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] __ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com - 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: Table Layout with Page Breaks
Corinna, Indeed, keep-with-next does work when set for each row. But you scared me with the endless loop comment, so for now I would keep my stylesheets the way I had them. Somewhat related question: I am using space-before for those short tables to leave some white space between them, but if the page break happens right after a table, the following table on the next page will be shifted down, e.g. __ page 1 starts table 1 --- required gap table 2 --- required gap table 3 __ page 2 starts --- unnecessary gap table 4 Is there any way to avoid this gap? YS -Original Message- From: Corinna Hischke [mailto:[EMAIL PROTECTED]] Sent: Friday, October 12, 2001 12:56 PM To: [EMAIL PROTECTED] Subject: Re: Table Layout with Page Breaks Hi, Yuri, generally the property keep-with-next should work. I tested it with FOP 0.20.1 successfully. I'm not quite sure if the hassle Darren creates by using nested tables is a must-have. You should achieve the same results by using keep-with-next for every row on your table. Single disadvantage (as in Darren's solution): if somehow a table doesn't fit on a single page (or Darrens row becomes bigger than a page) you might run into an endless loop. That is a known problem and (hopefully ;)) being worked on. HTH, Corinna - Original Message - From: West, Chris mailto:[EMAIL PROTECTED] To: '[EMAIL PROTECTED]' mailto:'[EMAIL PROTECTED]' Sent: Thursday, October 11, 2001 1:30 AM Subject: Table Layout with Page Breaks I'm using fop to generate tables that vary in length, so I need to be able set attributes such that the table layout will accommodate page breaks. I've tried using keep-with-next applied to fo:table-row and height applied to fo:table (plus many others) to setup the table layout so that it isn't truncated by a new page, but haven't had much success. Does FOP support this functionality? Chris W. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: Table Layout with Page Breaks
I think what Chris was asking is what needs to be done to make sure the table that doesn't fit on a page is started from the next page. I have a similar need. So far I just used table-header to at least make sure that even if the table crosses the page, at least the header will be repeated, but since my tables usually have only 5-6 rows, I would prefer for it to start from the next page if it can't fit on the previous page. Wouldn't break-before=page start EACH table from a new page? This is not what I would want. keep-with-next didn't work for me either. YS -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 11, 2001 3:10 PM To: [EMAIL PROTECTED] Subject: Re: Table Layout with Page Breaks Make sure your table is in the xsl-region-body and not in the xsl-region-before or xsl-region-after. I have tables that go on for many pages without problems. You can then use the xsl-region-before for table headers at the top of each page. If you start your tables with the break-before=page attribute you will start a new page for each table. So you could have a 100 row table that goes across 3 pages, a 2 row table on 1 page then a 50 row table on 2 pages if that's what your wanting. John fop-dev-return-10770-jthaemlitz=oreillyauto.com@XML. APACHE.ORG To: '[EMAIL PROTECTED]' [EMAIL PROTECTED] 10/10/01 06:30 PM cc: Please respond to fop-dev Subject: Table Layout with Page Breaks I'm using fop to generate tables that vary in length, so I need to be able set attributes such that the table layout will accommodate page breaks. I've tried using keep-with-next applied to fo:table-row and height applied to fo:table (plus many others) to setup the table layout so that it isn't truncated by a new page, but haven't had much success. Does FOP support this functionality? Chris W. - 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 WARNING
Two problem with this approach. First, you are using a lot of memory to store intermediate XML result in a string buffer. Second, you have to parse that XML again (FOP will do it for you, but it takes time). A better solution, as I already said before, is to register FOP as a receiver of SAX events fired by XALAN on the first transformation - this was you eliminate both problems and do all your work in one pass. Just create a Transformer from the stylesheet and do // 3. Create FOP driver and set rendering mode and output stream org.apache.fop.apps.Driver driver = new org.apache.fop.apps.Driver(); driver.setRenderer(driver.RENDER_PDF); driver.setOutputStream( whatever you writing to ); // 4. Create SAXResult based on FOP Driver content handler which // will accept SAX events and build FOP tree javax.xml.transform.sax.SAXResult saxResult = new javax.xml.transform.sax.SAXResult( driver.getContentHandler() ); // 5. Use the Transformer to transform an XML Source and send the output // to a Result object. //Implicitely it will create the FOP tree by firing SAX events transformer.transform( whatever XML source you have, saxResult ); YS -Original Message- From: Semprini Davide [mailto:[EMAIL PROTECTED]] Sent: Monday, September 24, 2001 9:42 AM To: [EMAIL PROTECTED] Subject: Re: FOP WARNING 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: 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: I am trying to generate PDFs using FOP-0.20.1. The input files are xmland xsl filesI am using JRun3.0 with java1.2.2Here is the error I getWARNING: Unknown formatting object ^rootAnybody any ideas?-T o unsubscribe, e-mail: [EMAIL PROTECTED] additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: Generating PDF on Fly
Yes. See attached JSP. Without a parameter it reads static XML file and displays it in HTML format, with 'fo' parameter it reads the .fo file and displays PDF, and also has a link to display static XML as PDF. It's easy to modify this to read external XML file and output PDF. It used to work with FOP 0.19 - you may need to tweak it a little for FOP 0.20 due to API changes (namely, comment out driver.render() and driver.format()). YS -Original Message- From: Semprini Davide [mailto:[EMAIL PROTECTED]] Sent: Friday, September 21, 2001 10:34 AM To: fop-dev Subject: Generating PDF on Fly Hi, I have a question: Is possible to generate and VISUALIZE with a common Browser with Acrobat Reader plug-in a PDF using a JSP that take in input a Dynamic XML? Tanks! D.Semprini - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] equity.jsp - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: Does render(dom) actually work?
Matt, Why don't you do it all in one pass? I have a servlet, that calls some bean to get XML document in a DOM format (actually JDOM), then registers fop driver as receiver of SAX events and runs XSLT on the JDOM tree. // 1. Generate XML tree Document xmlSummary = DataLoader.getSummary(); // 2. Get stylesheet transformer Transformer transformer = transformerFactory.getTransformer( xsl-file ); // 3. Create FOP driver and set rendering mode and output stream org.apache.fop.apps.Driver driver = new org.apache.fop.apps.Driver(); driver.setRenderer(driver.RENDER_PDF); driver.setOutputStream( out ); // 4. Create SAXResult based on FOP Driver content handler which will accept // SAX events and build FOP tree javax.xml.transform.sax.SAXResult saxResult = new javax.xml.transform.sax.SAXResult( driver.getContentHandler() ); // 5. Use the Transformer to transform an XML Source and send the output // to a Result object. // Implicitely it will create the FOP tree by firing SAX events transformer.transform( new org.jdom.transform.JDOMSource( xml ), saxResult ); YS -Original Message- From: Savino, Matt C [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 19, 2001 4:33 PM To: '[EMAIL PROTECTED]' Subject: Does render(dom) actually work? Hello everyone. By any chance can someone point me to some example code which uses render(dom)? No matter what combination of driver methods or Fop versions (.17,.19,.20.1) I use I seem to get the same error: building formatting object tree setting up fonts java.lang.NullPointerException at java.util.Hashtable.get(Hashtable.java:320) at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:191) at org.apache.fop.tools.DocumentReader.parse(DocumentReader.java:444) at org.apache.fop.apps.Driver.render(Driver.java:449) at FOtoPDF.applyFop(FOtoPDF.java:83) at FOtoPDF.main(FOtoPDF.java:24) Here is the source I'm using under v.0.20.1: org.apache.fop.apps.Driver driver = new org.apache.fop.apps.Driver(); driver.setRenderer(org.apache.fop.apps.Driver.RENDER_PDF); driver.setOutputStream(new FileOutputStream(pdfFilename)); driver.setupDefaultMappings() ; driver.addElementMapping(org.apache.fop.fo.StandardElementMapping); driver.addElementMapping(org.apache.fop.svg.SVGElementMapping); driver.addElementMapping(org.apache.fop.extensions.ExtensionElementMapping ); driver.render(dom); I have tried it with and without any of the mapping methods. I am building the Dom object from a file. The sax input handler created from the same file works fine in render(parser, inputSource). I have read through the dev archives and found a few suggestions but none helped. Is there some configuration I'm missing? Or did this break a long time ago as someone suggested in the archives? I am hoping to use FOP in a major production app, but if I can't solve this I may not be able to. I am currently receiving a DOM object (a small report) from some database access classes. I then perform an XSLT transform which outputs my FO input as another DOM object. I suppose I could pipe the output of that to SAX? I'd really rather not have to do anything klugy like serialize it to a stream and then feed it in as SAX. But I'll consider anything that doesn't cause too much of a performace hit. We definitely don't want to have temp files sitting around, for a host of reasons. Thank you very much for your help. Matt Savino - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]