RE: Newbie questions ...
I'll give it a try, the FopServlet.java comments say to use 2.0.0 though, thanks! -Original Message- From: Kumar, Sunil [mailto:[EMAIL PROTECTED] Sent: Monday, June 17, 2002 4:28 PM To: [EMAIL PROTECTED] Subject: RE: Newbie questions ... use xalann-3.1.x jar file -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, June 17, 2002 3:27 PM To: [EMAIL PROTECTED] Subject: RE: Newbie questions ... I'm new to FOP and have a couple of questions. I'm trying to take a XML and convert it to FO using XSLT in order to display PDF from a servlet. I started with a static FO file and used the FopServlet to display it. This worked fine. However, I've tried using the XML/XSL parameters and I always get an error on the XSLTInputHandler which is caused by Provider org.apache.xalan.processor.TransformerFactoryImpl not found. I have put xalan-2.0.0.jar in my WEB-INF/lib directory. The URL I used to get this was: http://localhost/fop/servlet/fop?xml=C:\jakarta\fop-0.20.3\docs\xml-docs\f op\running.xmlxsl=C:\jakarta\fop-0.20.3\docs\xml-docs\xml2pdf.xsl Also, I'm putting the stack trace at the bottom of this email if anyone wants a look at it. My second question has to do with which XML object to use. Right now, I just have my XML in a file, but I want to generate it on the fly. The documentation says you can do this with DOM or SAX. Is there any problem doing it with JDOM? If not, does anyone know where I can find an example. Thank you, Mike Witt Stack Trace: Error: 500 Location: /fop/servlet/fop Internal Servlet Error: javax.servlet.ServletException at FopServlet.renderXML(FopServlet.java:125) at FopServlet.doGet(FopServlet.java:67) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405) at org.apache.tomcat.core.Handler.service(Handler.java:287) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java: 812) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(Htt pConnectionHandler.java:213) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501) at java.lang.Thread.run(Thread.java:484) Root cause: org.apache.fop.apps.FOPException at org.apache.fop.apps.XSLTInputHandler.getParser(XSLTInputHandler.java:109) at FopServlet.renderXML(FopServlet.java:118) at FopServlet.doGet(FopServlet.java:67) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405) at org.apache.tomcat.core.Handler.service(Handler.java:287) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java: 812) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(Htt pConnectionHandler.java:213) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501) at java.lang.Thread.run(Thread.java:484) - java.lang.reflect.InvocationTargetException: javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not found at javax.xml.transform.TransformerFactory.newInstance(TransformerFactory.java :110) at org.apache.fop.apps.TraxInputHandler.getXMLFilter(TraxInputHandler.java:72 ) at java.lang.reflect.Method.invoke(Native Method) at org.apache.fop.apps.XSLTInputHandler.getParser(XSLTInputHandler.java:102) at FopServlet.renderXML(FopServlet.java:118) at FopServlet.doGet(FopServlet.java:67) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405) at org.apache.tomcat.core.Handler.service(Handler.java:287) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java: 812) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(Htt
Multi-Level list
Subject: Multi-Level list From: Owen Thomas [EMAIL PROTECTED] === I have an xml file that will contain a list and each list item can contain sub items So the HTML page will need to look something like 1 Section A 1.1 Sub section 1.2 Sub section 1.2.1 Sub Sub section 1.2.2 Sub Sub section 1.3 Sub section 2 Section B 3 Section C 3.1 Sub section 3.2 Sub section ETC ETC ETC The number will be stored as an attribute of the element so the xml will look like Data Section listid=1Section A/Section Section listid=1.1Sub section/Section Section listid=1.2Sub section/Section Section listid=1.2.1Sub Sub section/Section Section listid=1.2.2Sub Sub section/Section Section listid=1.3Sub section/Section Section listid=2Section B/Section Section listid=3Section C/Section Section listid=3.1Sub section/Section Section listid=3.2Sub section/Section /Data The fo:list-block has the attributes start-indent and end-indent on the list-item-label and list-item-body so is there any way to specify the amount of indent dependant on an attribute. Cheers Owen
Re: barcodes
According to [EMAIL PROTECTED] on Mon, Jun 17, 2002 at 11:03:19PM +0200: Hi, I am using IdAutomation API (There also exists JBarCodeBean) in order to produce (code128) barcode images (either as GIF or JPEG format). The API I propose you use something like the perl module Code128.pm for the algorithm and then from the generated numbers it is real easy to generate svg or fo for the bar code itself. If you need help you may let me know off list. -- Eric Smith
embed static pdf?
Hi Group, is there a possibility to embed static pdf-documents in the dynamically generated pdf using fop? Thanks in advace -- Keith Sauvant Aspera OHG Dennewartstr. 25-27, D-52068 Aachen Telefon : +49-241-963-1221 Fax : +49-241-963-1229 eMail : [EMAIL PROTECTED]
Re: embed static pdf?
i haven't done that yet with FOP, because i couldn't find a way... if you are welcoming all possibilities, try iText... Jochen Maes ICT Development KBC Securities (kbcsecurities.com) Havenlaan 12 Avenue du Port SIF 8683 B-1080 Brussels Belgium Tel: +32 2 429 96 81 GSM: +32 496 57 90 99 E-mail : [EMAIL PROTECTED] This message and any attachments hereto are for the named person's use only. It may contain confidential, proprietary or legally privileged information. You may not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. If you have received this e-mail message without being the intended recipient, please notify KBC Securities promptly and delete this e-mail. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorised to state them to be the views of KBC Securities. KBC Securities reserves the right to monitor all e-mail communications through its networks and any messages addressed to, received or sent by KBC Securities or its employees are deemed to be professional in nature. The sender or recipient of any messages to or of KBC Securities agrees that those may be read by other employees of KBC Securities than the stated recipient or sender in order to ensure the continuity of work-related activities and allow supervision thereof. KBC Securities does not accept liability for the correct and complete transmission of the information, nor for any delay or interruption of the transmission, nor for damages arising from the use of, or reliance on, the information.
Re: RedHat 7.3, JBoss-2.4.4-tomcat-4.0.1 - embedded FOP not working
This has driven me crazy, but I eventually found out that the problem is the Crimson parser! I don't know why, but Crimson goes wrong on RedHat 7.3. If I explicitly set the XMLReader to org.apache.xerces.parsers.SAXParser, then it works. [EMAIL PROTECTED] on 17/06/2002 15:52:49 Please respond to [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc: Subject: Re: RedHat 7.3, JBoss-2.4.4-tomcat-4.0.1 - embedded FOP not working what is the encoding you use on the machines? UTF-8 or ISO-8859-1 encoding, etc... what is your machines regional settings do they differ? and if they differ try to set them alike... what are the characters that were replaced by the ? if you find them try to write them through the #XXX; way... hope this helped a bit Jochen Maes ICT Development KBC Securities (kbcsecurities.com) Havenlaan 12 Avenue du Port SIF 8683 B-1080 Brussels Belgium Tel: +32 2 429 96 81 GSM: +32 496 57 90 99 E-mail : [EMAIL PROTECTED] This message and any attachments hereto are for the named person's use only. It may contain confidential, proprietary or legally privileged information. You may not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. If you have received this e-mail message without being the intended recipient, please notify KBC Securities promptly and delete this e-mail. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorised to state them to be the views of KBC Securities. KBC Securities reserves the right to monitor all e-mail communications through its networks and any messages addressed to, received or sent by KBC Securities or its employees are deemed to be professional in nature. The sender or recipient of any messages to or of KBC Securities agrees that those may be read by other employees of KBC Securities than the stated recipient or sender in order to ensure the continuity of work-related activities and allow supervision thereof. KBC Securities does not accept liability for the correct and complete transmission of the information, nor for any delay or interruption of the transmission, nor for damages arising from the use of, or reliance on, the information. Regards, Simon Godden
Re: RedHat 7.3, JBoss-2.4.4-tomcat-4.0.1 - embedded FOP not working
thank you for the update, i'll try to remember that one :D Jochen Maes ICT Development KBC Securities (kbcsecurities.com) Havenlaan 12 Avenue du Port SIF 8683 B-1080 Brussels Belgium Tel: +32 2 429 96 81 GSM: +32 496 57 90 99 E-mail : [EMAIL PROTECTED] This message and any attachments hereto are for the named person's use only. It may contain confidential, proprietary or legally privileged information. You may not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. If you have received this e-mail message without being the intended recipient, please notify KBC Securities promptly and delete this e-mail. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorised to state them to be the views of KBC Securities. KBC Securities reserves the right to monitor all e-mail communications through its networks and any messages addressed to, received or sent by KBC Securities or its employees are deemed to be professional in nature. The sender or recipient of any messages to or of KBC Securities agrees that those may be read by other employees of KBC Securities than the stated recipient or sender in order to ensure the continuity of work-related activities and allow supervision thereof. KBC Securities does not accept liability for the correct and complete transmission of the information, nor for any delay or interruption of the transmission, nor for damages arising from the use of, or reliance on, the information.
Re: barcodes
According to [EMAIL PROTECTED] on Mon, Jun 17, 2002 at 11:03:19PM +0200: Hi, I am using IdAutomation API (There also exists JBarCodeBean) in order to produce (code128) barcode images (either as GIF or JPEG format). The API I propose you use something like the perl module Code128.pm for the algorithm and then from the generated numbers it is real easy to generate svg or fo for the bar code itself. If you need help you may let me know off list. -- Eric Smith Hi, In fact, I have just found a font and the corresponding algorithm coded in Java on http://www.bizfonts.com. So i am now trying to incorporate the demo font they provide into FOP but I get the following exception trace when I use fop's TTFReader class in order to generate the font metrics file: C:\software\fopc:\software\jdk131\bin\java -cp .\build\fop.jar;.\lib\batik.jar;.\lib\xalan-2.0.0.jar;.\lib\xerces-1.2.3.jar;.\lib\avalon-framework-4.0.jar;lib\logkit-1.0.jar;.\lib\jimi-1.0.jar org.apache.fop.fonts.apps.TTFReader -enc ansiC:\WINNT\fonts\SadC128b.ttf barcodettfcm.xml TTF Reader v1.1.1 Reading C:\WINNT\fonts\SadC128b.ttf... Number of glyphs in font: 134 Unicode cmap table not present java.util.NoSuchElementException: Vector Enumeration at java.util.Vector$1.nextElement(Vector.java:288) at org.apache.fop.fonts.TTFFile.createCMaps(TTFFile.java:398) at org.apache.fop.fonts.TTFFile.readFont(TTFFile.java:387) at org.apache.fop.fonts.apps.TTFReader.loadTTF(TTFReader.java:181) at org.apache.fop.fonts.apps.TTFReader.main(TTFReader.java:143) which has me thinking that the font does not support unicode ? It is trying to create a character map for unicode I believe ! Anyone has an idea ? Pascal.
RE: tiff problem
Thanks for the response. The problem was I'm using 0.20.3 wich doesn't have jimi installed (I guess I should have read the release notes...) I downloaded jimi and built fop and now it works fine. Thanks, Bill -Original Message- From: J.Pietschmann [mailto:[EMAIL PROTECTED] Sent: Monday, June 17, 2002 5:35 PM To: [EMAIL PROTECTED] Subject: Re: tiff problem Bill Collins wrote: Hi All, I'm having a problem with tiff images. I'm doing somthing like this: fo:block fo:external-graphic src=file:testTiff.tif width=100px height=50px/ /fo:block and I get the following error: [ERROR]: Error while creating area : Error creating FopImage object (Error creat ing FopImage object (file:/C:/MyStuff/fopTest/testTiff.tif) : org.apache.fop. image.JimiImage Jimi doesn't understand all possible compressions allowed in TIFF. Use uncompressed or RLE compressed TIFFs. J.Pietschmann
-unsubscribe
-unsubscribe
RE: PNG with FOP
You cannot just add jimi to the lib you must add it and recompile fop. Be sure to add it in the build file as well. I went though the same issue yesterday (with tiff images) and this method fixed my problem. -Bill Collins -Original Message- From: Vikram Verma [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 18, 2002 8:55 AM To: [EMAIL PROTECTED]; fop-dev@xml.apache.org Subject: PNG with FOP Hi, I am trying to incorporate a PNG image file in a PDF through FOP. The release notes say that I need to have JIMI also in the codebase. But despite adding JIMI its not generating the PNG format images in the resultant PDF whereas I can do the same for a GIF image file. any guess why ?? Regards, Vikram Verma
setBufferFile
Anyone having trouble with the Driver.setBufferFile( java.io.File ) method? It seems to create the file, but it is always 0 bytes, and doesn't appear to be used in any way. Thanks, Steve Johnson
Re: Configuring Portrait/landscape from PSRenderer
Is it possible to do the same thing with pdf? Yes, it is, if someone's going to implement it. Another question is if it makes sense to do this, or better: is it really necessary? I haven't investigated that, yet. I'm printing in portrait mode usually... I wonder what you're trying to do. AFAIK pdf doesn't have info about page orientation, and as a sequence, you have to pass the orientation to the printing application (eg acrobat) so that it prints corectly, but I need someone to assert this info.. That's correct. PDF doesn't contain info about page orientation. Also, the page size (A3, A4, letter, etc..), AFAIK pdf doesn't have info about it either. so even with the right page sizes you cant configure your pdf print application to choose the correct paper size form within the pdf. again, you have to pass/set the page size into the application. right? The PDF contains the extent of each page (width and height) but not a paper size as in A4 or letter. Acrobat Reader has a lot of options in the GUI to rotate and scale a page before it is printed. The unix command line of Acrobat Reader has options that need to be set (ex. -size a4) so the page is transformed to PostScript correctly. What is your application? What about formats other than ps and pdf? There are probably similar issues. Cheers, Jeremias Märki
The newbie questions continue ...
Thanks for the answers to my previous questions. I've gotten past my earlier errors and now have a new set of problems. I have created a HelloWorld xml file and a xsl file and attempted to use FopServlet to display it in pdf. Unfortunately it only displays a blank pdf page. So, I downloaded saxon.exe and converted the file manually, then used FopServlet to display the resulting fo file. This file displayed my HelloWorld message just fine. Any thoughts? Thanks for any help, Mike Here are my files: helloworld.xml: ?xml version=1.0 encoding=UTF-8 ? hello helloworldHello World!/helloworld /hello helloworld.xsl: ?xml version=1.0? xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform; version=1.0 xmlns:fo=http://www.w3.org/1999/XSL/Format; xsl:template match=/ fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; fo:layout-master-set fo:simple-page-master master-name=only fo:region-body region-name=xsl-region-body margin-top=0.7in padding=6pt / fo:region-before region-name=xsl-region-before extent=0.7in / fo:region-after region-name=xsl-region-after extent=0.7in / /fo:simple-page-master /fo:layout-master-set fo:page-sequence master-reference=only fo:flow flow-name=xsl-region-body fo:block font-size=20pt font-family=serif line-height=30pt xsl:value-of select=/hello/helloworld/ /fo:block /fo:flow /fo:page-sequence /fo:root /xsl:template /xsl:stylesheet helloworld.fo: ?xml version=1.0 encoding=utf-8? fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; fo:layout-master-set fo:simple-page-master master-name=only fo:region-body region-name=xsl-region-body margin-top=0.7in padding=6pt/ fo:region-before region-name=xsl-region-before extent=0.7in/ fo:region-after region-name=xsl-region-after extent=0.7in/ /fo:simple-page-master /fo:layout-master-set fo:page-sequence master-reference=only fo:flow flow-name=xsl-region-body fo:block font-size=20pt font-family=serif line-height=30pt Hello World! /fo:block /fo:flow /fo:page-sequence /fo:root
RE: DOM or SAX?
u were right, Saxon wasn't any faster with my PDF generation. -Original Message- From: J.Pietschmann [mailto:[EMAIL PROTECTED] Sent: Monday, June 17, 2002 6:52 PM To: [EMAIL PROTECTED] Subject: Re: DOM or SAX? Argyn Kuketayev wrote: Are you sure the parser is the bottleneck? no. I'm not sure. But I want to try another parser first, since it seems the easiest thing to do. Easy or not, the time spent on replacing the parser is most likely wasted. Get a good profiler and *measure* where your program uses processor cycles. I'm pretty sure that you'll find the parser uses only neglible ressources. I didn't find how to configure FOP to run with parsers from Saxon 6.5.2 distribution. Can I get any help on that? I just use saxon.jar instead of xalan.jar+xerces.jar without any problem. I used 6.5. J.Pietschmann
Re: The newbie questions continue ...
[EMAIL PROTECTED] wrote: I have created a HelloWorld xml file and a xsl file and attempted to use FopServlet to display it in pdf. Unfortunately it only displays a blank pdf page. Probably something wrong with servlet's parameters? Show us how do you invoke servlet. Make sure servlat is able to find your xml and xsl. -- Oleg Tkachenko Multiconn International Ltd, Israel
RE: DOM or SAX?
u were right, Saxon wasn't any faster with my PDF generation. Easy or not, the time spent on replacing the parser is most likely wasted. Just as an FYI to anybody interested, the version of the parser does seem to make a difference. I was using Xalan 2.1.0 as the SAX parser, and as the size of the XML increased, the average rendering time per page using FOP increased. When I switched to Xalan 2.3.1, the rendering time per page stayed the same regardless of how big the XML was.
RE: The newbie questions continue ...
I was able to create a pdf file in a servlet using fop successfully but when i set content type to application/pdf and write the pdf content to response object the pdf doesn't show up in the browser ( instead an empty page is shown) -Original Message- From: Oleg Tkachenko [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 18, 2002 1:06 PM To: [EMAIL PROTECTED] Subject: Re: The newbie questions continue ... [EMAIL PROTECTED] wrote: I have created a HelloWorld xml file and a xsl file and attempted to use FopServlet to display it in pdf. Unfortunately it only displays a blank pdf page. Probably something wrong with servlet's parameters? Show us how do you invoke servlet. Make sure servlat is able to find your xml and xsl. -- Oleg Tkachenko Multiconn International Ltd, Israel
Re: fop build questions...newbie.
Carter, Will wrote: 1. I just downloaded fop-0.20.3-src.tar.gz and unzipped it into a dir called c:\fopsrc. 2. When I execute build.bat at my command line, it starts chugging away but then gets the following compiling error. [javac] Compiling 720 source files to C:\fopsrc\fop-0.20.3\build\classes [javac] C:\fopsrc\fop-0.20.3\build\src\org\apache\fop\render\awt\AWTFontMetrics.java :287: No variable TRUETYPE_FONT defined in class java.awt.Font. [javac] cashedFont = Font.createFont(Font.TRUETYPE_FONT,fontStream); [javac] ^ [javac] Note: C:\fopsrc\fop-0.20.3\build\src\org\apache\fop\tools\anttasks\CompileXMLFiles .java uses or overrides a deprecated API. Recompile with -deprecation for details. [javac] 1 error, 1 warning BUILD FAILED C:\fopsrc\fop-0.20.3\build.xml:589: Compile failed, messages should have been provided. Total time: 3 minutes 13 seconds 3. Why do I get this error? Which jdk version are you using? That is probably the old one, try 1.3. 4. Does this build.bat recompile all the java files that are part of the fop application to make a new fop.jar? Yes, it's supposed to create fop.jar in build directory. 5. Say if I edit Driver.java and want to see the results of changes, I would run this build.bat to recompile and get a fop.jar that reflects changes? Right and don't edit java sources in build/src directory - they are copied from src directory during build process. 6. Should this question be in the developer listserv instead? They say fop-dev list is indented for the fop developers, not for developers dealing with fop :), so the answer depends on what are you trying to achieve - or just customize fop for you own needs or to patch it or to improve somehow. -- Oleg Tkachenko Multiconn International Ltd, Israel
Re: The newbie questions continue ...
That can be something wrong in code (show us what have you changed in FopServlet) or just usual IE bug (see http://marc.theaimsgroup.com/?l=fop-userm=102084375612518w=2). Kumar, Sunil wrote: I was able to create a pdf file in a servlet using fop successfully but when i set content type to application/pdf and write the pdf content to response object the pdf doesn't show up in the browser ( instead an empty page is shown) -Original Message- From: Oleg Tkachenko [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 18, 2002 1:06 PM To: [EMAIL PROTECTED] Subject: Re: The newbie questions continue ... [EMAIL PROTECTED] wrote: I have created a HelloWorld xml file and a xsl file and attempted to use FopServlet to display it in pdf. Unfortunately it only displays a blank pdf page. Probably something wrong with servlet's parameters? Show us how do you invoke servlet. Make sure servlat is able to find your xml and xsl. -- Oleg Tkachenko Multiconn International Ltd, Israel
RE: The newbie questions continue ...
given below is the code from my servlet class pdfFilePath is the pdf file name (path) responseContent = FileUtil.contentsOfFileAsString(pdfFilePath); response.setContentType(application/pdf); response.getOutputStream().write(responseContent.getBytes()); -Original Message- From: Oleg Tkachenko [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 18, 2002 2:54 PM To: [EMAIL PROTECTED] Subject: Re: The newbie questions continue ... That can be something wrong in code (show us what have you changed in FopServlet) or just usual IE bug (see http://marc.theaimsgroup.com/?l=fop-userm=102084375612518w=2). Kumar, Sunil wrote: I was able to create a pdf file in a servlet using fop successfully but when i set content type to application/pdf and write the pdf content to response object the pdf doesn't show up in the browser ( instead an empty page is shown) -Original Message- From: Oleg Tkachenko [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 18, 2002 1:06 PM To: [EMAIL PROTECTED] Subject: Re: The newbie questions continue ... [EMAIL PROTECTED] wrote: I have created a HelloWorld xml file and a xsl file and attempted to use FopServlet to display it in pdf. Unfortunately it only displays a blank pdf page. Probably something wrong with servlet's parameters? Show us how do you invoke servlet. Make sure servlat is able to find your xml and xsl. -- Oleg Tkachenko Multiconn International Ltd, Israel
RE: The newbie questions continue ...
Mike- This looks like the problem IE has with getting nonstandard files straight from a script. Nonstandard is a bad term, but I had this same problem with an ASP that created .m3u files for Winamp. When I hit the page with IE, it wouldn't handle the .m3u until I changed the name of the page to have a .m3u extension, and set up an ASPI filter for it. I believe the root of the problem is that IE is ignoting the Content-type header, and you need to let it know it's getting a PDF through the URL. You can either change the extension of the ASP page, like I did (which is messy -- I wish I knew about the other option a while ago), or you can add a dummy parameter to the QueryString, which has the string .pdf in it. For example, change your existing URL to: http://localhost:8080/fop?fo=C:\temp\helloworld3.fooutput=.pdf Hope that helps. I have not implemented this yet, so I may have messed up my example. All of my FOP work is creating PDFs on a filesystem, so I haven't had to deal with this yet. Hopefully, other members of the list will correct any misinformation contained above. -Jeff [EMAIL PROTECTED] eywell.com To: [EMAIL PROTECTED] cc: 06/18/2002 Subject: RE: The newbie questions continue ... 01:14 PM Please respond to fop-user Happy to oblige ... I'm using: http://localhost:8080/fop?xml=c:\temp\helloworld.xmlxsl=c: \temp\helloworld3 .xsl to invoke. I added a System.out.println to FopServlet to print out the filenames and it shows: Starting service Tomcat-Standalone Apache Tomcat/4.0.4-b3 Starting service Tomcat-Apache Apache Tomcat/4.0.4-b3 Running xml: c:\temp\helloworld.xml and xsl: c:\temp\helloworld3.xsl Handler: or [EMAIL PROTECTED] As far as the servlet getting to the files, if I do: http://localhost:8080/fop?fo=C:\temp\helloworld3.fo I get the hello world pdf with no problem. Thanks again, Mike -Original Message- From: Oleg Tkachenko [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 18, 2002 1:06 PM To: [EMAIL PROTECTED] Subject: Re: The newbie questions continue ... [EMAIL PROTECTED] wrote: I have created a HelloWorld xml file and a xsl file and attempted to use FopServlet to display it in pdf. Unfortunately it only displays a blank pdf page. Probably something wrong with servlet's parameters? Show us how do you invoke servlet. Make sure servlat is able to find your xml and xsl. -- Oleg Tkachenko Multiconn International Ltd, Israel
RE: fop build questions...newbie.
jdk 1.3 worked...thanks. I was able to rebuild fop.jar and it reflected changes made in driver.java will -Original Message- From: Oleg Tkachenko [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 18, 2002 1:49 PM To: [EMAIL PROTECTED] Subject: Re: fop build questions...newbie. Carter, Will wrote: 1. I just downloaded fop-0.20.3-src.tar.gz and unzipped it into a dir called c:\fopsrc. 2. When I execute build.bat at my command line, it starts chugging away but then gets the following compiling error. [javac] Compiling 720 source files to C:\fopsrc\fop-0.20.3\build\classes [javac] C:\fopsrc\fop-0.20.3\build\src\org\apache\fop\render\awt\AWTFontMetrics.java :287: No variable TRUETYPE_FONT defined in class java.awt.Font. [javac] cashedFont = Font.createFont(Font.TRUETYPE_FONT,fontStream); [javac] ^ [javac] Note: C:\fopsrc\fop-0.20.3\build\src\org\apache\fop\tools\anttasks\CompileXMLFiles .java uses or overrides a deprecated API. Recompile with -deprecation for details. [javac] 1 error, 1 warning BUILD FAILED C:\fopsrc\fop-0.20.3\build.xml:589: Compile failed, messages should have been provided. Total time: 3 minutes 13 seconds 3. Why do I get this error? Which jdk version are you using? That is probably the old one, try 1.3. 4. Does this build.bat recompile all the java files that are part of the fop application to make a new fop.jar? Yes, it's supposed to create fop.jar in build directory. 5. Say if I edit Driver.java and want to see the results of changes, I would run this build.bat to recompile and get a fop.jar that reflects changes? Right and don't edit java sources in build/src directory - they are copied from src directory during build process. 6. Should this question be in the developer listserv instead? They say fop-dev list is indented for the fop developers, not for developers dealing with fop :), so the answer depends on what are you trying to achieve - or just customize fop for you own needs or to patch it or to improve somehow. -- Oleg Tkachenko Multiconn International Ltd, Israel
RE: The newbie questions continue ...
Thanks for pointing this out! I put the dummy=.pdf on my URL and it worked. Question though, why does the fo test always seem to work and the xml/xsl test never work? Mike -Original Message- From: Oleg Tkachenko [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 18, 2002 2:54 PM To: [EMAIL PROTECTED] Subject: Re: The newbie questions continue ... That can be something wrong in code (show us what have you changed in FopServlet) or just usual IE bug (see http://marc.theaimsgroup.com/?l=fop-userm=102084375612518w=2). Kumar, Sunil wrote: I was able to create a pdf file in a servlet using fop successfully but when i set content type to application/pdf and write the pdf content to response object the pdf doesn't show up in the browser ( instead an empty page is shown) -Original Message- From: Oleg Tkachenko [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 18, 2002 1:06 PM To: [EMAIL PROTECTED] Subject: Re: The newbie questions continue ... [EMAIL PROTECTED] wrote: I have created a HelloWorld xml file and a xsl file and attempted to use FopServlet to display it in pdf. Unfortunately it only displays a blank pdf page. Probably something wrong with servlet's parameters? Show us how do you invoke servlet. Make sure servlat is able to find your xml and xsl. -- Oleg Tkachenko Multiconn International Ltd, Israel
Re: DOM or SAX?
[EMAIL PROTECTED] wrote: Just as an FYI to anybody interested, the version of the parser does seem to make a difference. I was using Xalan 2.1.0 as the SAX parser, and as the size of the XML increased, the average rendering time per page using FOP increased. When I switched to Xalan 2.3.1, the rendering time per page stayed the same regardless of how big the XML was. You are talking about the XSLT processor, not about an XML parser. The most likely explanation is that the older Xalan builds an internal tree representation of the whole XML and then processes it, thereby perhaps trying to apply templates to every node. The newer Xalan probably uses by default streaming processing, which analyzes the templates statically (during style sheet compilation) and can decide from this whether templates can be applied to a certain node without having read the whole XML. This decreases memory load and can speed up processing considerably. As for parsers, the only real trap to watch out is to check for a DOCTYPE declaration, especially if it points to a DTD on a non-local file system or (yuk!) retrieved by HTTP (the dreaded XHTML DTD link). Complicated DTDs like full DocBook take a lot of time to read and parse even if fetched from local storage. Enabled validation may also waste some additional processor cycles, but XSLT proccessors usually take care to prevent this. J.Pietschmann
Re: Why is there a margin at the top?
Vollmer, Thomas - CannonSA wrote: I'm using FOP 0.20.3 to create PDF from SVG and I'm encountering a problem with an unexpected margin at the top of the PDF page. ... I'm new to XSL-FO so I might be overlooking something here. Or is this a FOP bug? I'd say it's a bug. J.Pietschmann
Re: setBufferFile
Steve Johnson wrote: Anyone having trouble with the Driver.setBufferFile( java.io.File ) method? It seems to create the file, but it is always 0 bytes, and doesn't appear to be used in any way. The functionality indeed appears to have been removed. The buffer file was used to store text. The anchor in FOText has been commented out. J.Pietschmann
Re: The newbie questions continue ...
Kumar, Sunil wrote: I was able to create a pdf file in a servlet using fop successfully but when i set content type to application/pdf and write the pdf content to response object the pdf doesn't show up in the browser ( instead an empty page is shown) A blank IEx window usually indicates that the content length was not set. The FOP example servlet buffers the PDF in a ByteArrayOutputStream in order to get the PDF lengths and to set the content-length header. Refer to the code provided with the FOP distribution. J.Pietschmann
Re: embed static pdf?
Subject: Re: embed static pdf? From: Wim Sandra [EMAIL PROTECTED] === Be careful with iText because it does not copy the whole pdf. For instance, bookmarks/outlines (generated with the fop fox-extensions) are not copied when one processes a pdf file with iText. see http://www.mail-archive.com/itext-questions@lists.sourceforge.net/msg01053.h tml Remark: you can only copy content (text and graphics); all Annotations, Outlines,... will be lost. Wim [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] i haven't done that yet with FOP, because i couldn't find a way... if you are welcoming all possibilities, try iText... Jochen Maes ICT Development KBC Securities (kbcsecurities.com) Havenlaan 12 Avenue du Port SIF 8683 B-1080 Brussels Belgium Tel: +32 2 429 96 81 GSM: +32 496 57 90 99 E-mail : [EMAIL PROTECTED] This message and any attachments hereto are for the named person's use only. It may contain confidential, proprietary or legally privileged information. You may not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. If you have received this e-mail message without being the intended recipient, please notify KBC Securities promptly and delete this e-mail. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorised to state them to be the views of KBC Securities. KBC Securities reserves the right to monitor all e-mail communications through its networks and any messages addressed to, received or sent by KBC Securities or its employees are deemed to be professional in nature. The sender or recipient of any messages to or of KBC Securities agrees that those may be read by other employees of KBC Securities than the stated recipient or sender in order to ensure the continuity of work-related activities and allow supervision thereof. KBC Securities does not accept liability for the correct and complete transmission of the information, nor for any delay or interruption of the transmission, nor for damages arising from the use of, or reliance on, the information.
Re: Using FOP on a ASP.NET server to convert FO to PDF
Subject: Re: Using FOP on a ASP.NET server to convert FO to PDF From: Wim Sandra [EMAIL PROTECTED] === I've integrated FOP in a ASP.NET server by implementing a COM component. The COM components export a very simple interface with a method that takes some XML data, a XSL-FO stylesheet and writes a PDF file (or writes the PDF data to some memory). The COM component calls the FOP java methods with JNI (Java Native Interface). Ultimately, in your C# ASP.NET application, we more or less write: FOPLib.Fop fop = new FOPLib.Fop(); fop.fop2File(xmlData,xsltData,outputFileName); Response.Redirect(outputFileName); or FOPLib.Fop fop = new FOPLib.Fop(); uint numBytes = fop.fop2Memory(xmlData,xsltData); byte [] bytes = new byte [numBytes]; renderer.read(bytes); Response.Expires = 0; Response.Buffer = true; Response.ContentType = @application/pdf; Response.BinaryWrite(bytes); Response.End(); Wim Balaji Loganathan [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, Did u able to install Tomcat with IIS.if so then integrating FOP with .NET server is easy. My suggestion is , 1.Try to install Tomcat and run some sample servlet examples. 2.Try to configure FOP with Tomcat so that u can run the FopServlet(a sample servlet which convert FO/XSL to pdf)from the browser. 3.Try to configure Tomcat with IIS 4.Then u can do the same with .NET server. Documentation/steps/guidelines are available from Tomcat,FOP packages. Just give another try.It will work. Rgds Balaji http://www.sold.com.au - SOLD.com.au - Find yourself a bargain!
Re: The newbie questions continue ...
[EMAIL PROTECTED] wrote: Thanks for pointing this out! I put the dummy=.pdf on my URL and it worked. Question though, why does the fo test always seem to work and the xml/xsl test never work? That's easy: http://localhost:8080/fop?xml=xsl ends in .xsl, which is most probably a registered file type (or however this is really called), i.e. IEx. has a default action assiciated with it, which is to interpret it as XSL style sheet. Because the PDF is not XSL, Iex just blanks out. The .fo is probably not used, so IEx actually reads and uses the content type to decide what to do with the response. Want to have fun? Double-click on an arbitrary .fo file. There should be an open with... dialog pop up. Select IEx, and check the always use this application... box. Press ok, and enter the fop?fo=hello.fo URL into IEx. You'll probably get a blank now. Use the explorer's option/file-type dialog to get rid of the asssociation of .fo to IEx. J.Pietschmann
Re: Multi-Level list
FOP Newsgroup (@Basebeans.com) wrote: The fo:list-block has the attributes start-indent and end-indent on the list-item-label and list-item-body so is there any way to specify the amount of indent dependant on an attribute. You are generating the FO with XSLT? Try something like fo:list-block start-indent={$scale-factor * string-length(listid)} ... Make every line it's own list block rather than a single list block with multiple fo:list-item elements. Though the latter should be possible too if you use the indent both as start-indent of the fo:list-item-label as well as adding it to the start-indent of the list-item-body. J.Pietschmann
Fop Servlet Problems
Dear All, I am up and running with my first ever servlets in Tomcat4.03 (although they only run in the examples folder). So, I put all five of the latest version of the jar files as instructed in FOP servlets into the lib directory ( avalon-framework-4.1.2.jar batik-all-1.5b1.jar fop-0.20.3rc.jar logkit-1.0.1.jar and xalan-2.3.1.jar) and complied servlets OK as well. However, following this I've tried everything I can think possible to make a servelt produce a pdf from fo and still no joy and very soar eyes now as well! First I ran them without an fo file but they error as follows: http://localhost:8080/examples/servlet/FopPrintServlet? or http://localhost:8080/examples/servlet/FopServlet? Results in: FopServlet Error No 'fo' or 'xml/xsl' request param given. So then I assume I it is just a case of not finding an file.fo but when I try to give in one http://localhost:8080/examples/servlet/FopServlet?fo=border.fo and it always causes a status 500 internal service error (maybe something to do with it running only in the examples folder I have no idea!). I also found a mail a while ago from the group saying to put the fo files in the C:\Apache-Tomcat\bin file but still I get the same errors. Please can someone help? G. PS. I have also found a servlet in saxon for FOP has anyone tried this out is it easier to get working! _ Send and receive Hotmail on your mobile device: http://mobile.msn.com