Re: Problem using FOP in IBMs J9 for CDC Personal Profile
Not sure, but I assume the CDC Personal Profile doesn't include Swing. FOP hasn't been designed and maintained with the CDC in mind. If FOP works at all on the Personal Profile you might need to consider writing a replacement viewer that doesn't use Swing. Depending on your needs there might be other possible solutions. I suspect FOP is generally a little heavy for such devices. I don't know your requirements but maybe you should consider rendering your FO documents on a server and transfer bitmap images or PDFs to the client if that's an option. On 23.10.2006 09:49:19 Carsten Stiller wrote: Carsten Stiller wrote: I'm trying to use FOP for rendering documents to awt-images for an application running on PDAs using IBMs latest J9 virtual machine. It implements CDC Personal Profile 1.1. To integrate FOP into my application I used some code parts of the AWT viewer application and it works quite well with Suns J2SE 5.0 virtual machine. Running the same application on the PDA results in a NoClassDefFoundError for org.apache.fop.renderer.awt.AWTRenderer. As I'm pretty sure the classpath is set correct and is containing FOP and the other libs needed (batik, avalon ...) and other FOP classes are instanciated before (i.e. org.apache.fop.viewer.Translator) I don't see where the problem might be. Did anyone managed to run FOP under IBMs J9 VM or has any idea what might be the problem? Hmmm, maybe some code examples (copied from the example AWT viewer application with my debug-outputs) to demonstrate the problem: [...] translator = getResourceBundle(TRANSLATION_PATH + resources. + language); translator.setMissingEmphasized(false); System.err.println(Class exists: + (translator instanceof org.apache.fop.viewer.Translator)); renderer = new org.apache.fop.render.awt.AWTRenderer(translator); System.err.println(Class exists: + (renderer instanceof org.apache.fop.render.awt.AWTRenderer)); [...] On SUNs VM the output is as expected Class exists: true Class exists: true on the IBM VM only the first println is reached, as the instantiation of the AWTRenderer results in a NoClassDefFoundError. Carsten Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Table Border Help needed
It could very well be that there is no mistake. I'm fairly sure that the problem goes away if you disable anti-aliasing in Acrobat Reader and that the problem doesn't occur in print. Is that so? If that's the case, you might be asking if there's a way to avoid that effect. I don't think it's worth the effort but if the PDF renderer were extended with some smart algorithm that can combine border elements to larger combinations this effect could be avoided. On 24.10.2006 15:41:19 Dirk Bromberg wrote: Hi, i've written an generic table modell which creates the fo code for a table. Inline is a sample of the table as screenshot. My problem are the borders in cell which don't have a top and bottom border, here the line in the middle. You can see that the border is thicker than the border in the first and last line... The Table has border-collapse=separate and each Cell has a: border-top=[EMAIL PROTECTED] border-bottom=[EMAIL PROTECTED] border-left=[EMAIL PROTECTED] border-right=[EMAIL PROTECTED] with: none or 1mm solid gray as value. Is there a better was to create such borders? What is the mistake? Thanks. Dirk Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Table Border Help needed
Very thanks, that was it. I've disabled the Acrobat anti-aliasing Smooth line art and now it works fine in the Reader. But when i print the page the borders are like before... is there a Smooth line art setting in the Adobe Reader print settings? I can't find something like that. Dirk Jeremias Maerki schrieb: It could very well be that there is no mistake. I'm fairly sure that the problem goes away if you disable anti-aliasing in Acrobat Reader and that the problem doesn't occur in print. Is that so? If that's the case, you might be asking if there's a way to avoid that effect. I don't think it's worth the effort but if the PDF renderer were extended with some smart algorithm that can combine border elements to larger combinations this effect could be avoided. On 24.10.2006 15:41:19 Dirk Bromberg wrote: Hi, i've written an generic table modell which creates the fo code for a table. Inline is a sample of the table as screenshot. My problem are the borders in cell which don't have a top and bottom border, here the line in the middle. You can see that the border is thicker than the border in the first and last line... The Table has border-collapse=separate and each Cell has a: border-top=[EMAIL PROTECTED] border-bottom=[EMAIL PROTECTED] border-left=[EMAIL PROTECTED] border-right=[EMAIL PROTECTED] with: none or 1mm solid gray as value. Is there a better was to create such borders? What is the mistake? Thanks. Dirk Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Logging in FOP 0.9
Hello,I am using fop 0.9. I am not sure if in fop 0.9 i can get log messages while the pdf is being rendered, as we get in fop 0.2. In fop 0.2 i use to set driver.setLogger(log), to get the log messages. But how do i do it in fop0.9.Please suggest.Once i have set up say log4j and used commong-logging, but how would i give this logger to fop . Like in fop 0.5 we use to have the following code with driver.setLogger(loggger); Driver driver = new Driver(foSource, l_baOutStream);driver.setLogger(loggger);driver.setRenderer(Driver.RENDER_PDF);driver.run();Below are the log messages which i used to get in fop 0.2[INFO]: Using org.apache.xerces.parsers.SAXParser as SAX2 Parser[INFO]: building formatting object tree[INFO]: setting up fonts[INFO]: [1][INFO]: [2][DEBUG]: Last page-sequence produced 2 pages.[INFO]: [3][INFO]: [4] [INFO]: [5][INFO]: [6][INFO]: [7][INFO]: [8][DEBUG]: Last page-sequence produced 6 pages.[INFO]: Parsing of document complete, stopping renderer[DEBUG]: Initial heap size: 122162Kb[DEBUG]: Current heap size: 101839Kb [DEBUG]: Total memory used: -20322Kb[DEBUG]: Memory use is indicative; no GC was performed[DEBUG]: These figures should not be used comparatively But with fop 0.9, below is how pdf is being rendered. In this code how do i set logger so that fop messages are redirected to log4j // configure foUserAgent as desiredFOUserAgent foUserAgent = fopFactory.newFOUserAgent();fopFactory.setStrictValidation(false); // Construct fop with desired output format Fop fop =fopFactory.newFop(MimeConstants.MIME_PDF,foUserAgent,l_baOutStream); // Setup JAXP using identity transformer TransformerFactory factory = TransformerFactory.newInstance();Transformer transformer = factory.newTransformer(); // Resulting SAX events (the generated FO) must be piped through to FOP Result res = new SAXResult(fop.getDefaultHandler()); // Start XSLT transformation and FOP processing transformer.transform(foSource, res); Best Regards,Ruchika
Re: Problem using FOP in IBMs J9 for CDC Personal Profile
Jeremias Maerki wrote: Not sure, but I assume the CDC Personal Profile doesn't include Swing. FOP hasn't been designed and maintained with the CDC in mind. If FOP works at all on the Personal Profile you might need to consider writing a replacement viewer that doesn't use Swing. Depending on your needs there might be other possible solutions. I suspect FOP is generally a little heavy for such devices. I don't know your requirements but maybe you should consider rendering your FO documents on a server and transfer bitmap images or PDFs to the client if that's an option. Hmmm, Swing doesn't seem to be the problem as I wasn't going to use the viewer included in FOP. But as I found out the CDC implementation of AWT doesn't include java.awt.print.* which is extensively used in the rending part of FOP. PDF documents are no alternative for my needs, as I need to access and display the documents from within my application. Right now I'm using bitmap images but I'm looking for a way to be more flexible (font size, colors, images ...) and to cut down the used bandwith for transfering the documents. I guess I've got to look for something else (maybe a html renderer) or implement my own renderer for my documents. Carsten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
background-image oversized
Hello, I want to set a background-image in the region-before. The image is a gif, 26,42 in width, 3,88 in height and 72 dpi. I know that the useragent uses a dpi of 72 as default value. When I render the pdf the image is bigger than the content. I thought that it would fit with that size?! fo:layout-master-set fo:simple-page-master margin=10mm 10mm 10mm 20mm page-height=297mm page-width=210mm master-name=A4Page fo:region-before background-image=url('C:\\...\headpicture.gif') background-repeat=no-repeat extent=38mm / fo:region-body margin-top=39mm/ /fo:simple-page-master /fo:layout-master-set There are no compilation errors. I'm using FOP 0.92 beta. best regards Tobias
Re: Table Border Help needed
Hm, i'll try some older versions of the Reader... Thanks. Dirk Jeremias Maerki schrieb: No, there's no setting for print. But so far I've never seen anti-aliasing artifacts in print with Acrobat Reader. That's weird but short of investing a lot of time to improve border painting I have no idea how to solve this. On 25.10.2006 09:23:30 Dirk Bromberg wrote: Very thanks, that was it. I've disabled the Acrobat anti-aliasing Smooth line art and now it works fine in the Reader. But when i print the page the borders are like before... is there a Smooth line art setting in the Adobe Reader print settings? I can't find something like that. Dirk Jeremias Maerki schrieb: It could very well be that there is no mistake. I'm fairly sure that the problem goes away if you disable anti-aliasing in Acrobat Reader and that the problem doesn't occur in print. Is that so? If that's the case, you might be asking if there's a way to avoid that effect. I don't think it's worth the effort but if the PDF renderer were extended with some smart algorithm that can combine border elements to larger combinations this effect could be avoided. On 24.10.2006 15:41:19 Dirk Bromberg wrote: Hi, i've written an generic table modell which creates the fo code for a table. Inline is a sample of the table as screenshot. My problem are the borders in cell which don't have a top and bottom border, here the line in the middle. You can see that the border is thicker than the border in the first and last line... The Table has border-collapse=separate and each Cell has a: border-top=[EMAIL PROTECTED] border-bottom=[EMAIL PROTECTED] border-left=[EMAIL PROTECTED] border-right=[EMAIL PROTECTED] with: none or 1mm solid gray as value. Is there a better was to create such borders? What is the mistake? Thanks. Dirk Jeremias Maerki Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
FOP 0.9x, line-height and svn..
Hi, Having a small problem to actually acquire FOP 0.93: update -r HEAD D:/work/workspace/fop-trunk RA layer request failed svn: REPORT request failed on '/repos/asf/!svn/vcc/default' svn: REPORT of '/repos/asf/!svn/vcc/default': 400 Bad Request (http://svn.apache.org) And it seems Gump is down as well, so I can't get nightlys either. But that wasn't actually my main question, more of a problem is when I'm trying to migrate software from FOP 0.20.5 to FOP 0.93 (which is hopefully the first production-quality version). It seems there's something weird with fonts and line-height. Everything looks fine, but with equal line-height, FOP 0.92beta creates more free-space around it. My tables are somewhat getting 'fat', since line-height=12pt in 0.20.5 equals line-height=11pt in 0.92beta. Both are running as 'pure', with no font-configurations or other settings. Any idea how to adjust this? I have bunch of XSL-files to migrate, and this is unfortunately serious slowdown, not to mention I have to remove all 0.20.5 workarounds people have created ;) Second, what really got me interested in 0.93 is what's said on some mail, that's it noticeable faster than 0.92beta and fixes some bugs as well. Perhaps above issue is a bug, I was hoping that ;) I also noticed someone said 0.20.5 is faster than 0.9x, but I can't confirm this, quite opposite. I've done some experimenting, since we process thousand of documents daily, and noticed there's 50-100% speed gain from 0.20.5 - 0.92beta. This is great news, and a reason enough for me to migrate, but I'm always welcoming some more ;). Also I found out that 0.92beta was faster than commercial applications (embedded). So if anyone has ideas to make transition from 0.20 - 0.9x less painful, thanks in advance ;) - Yak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
browser hangs (recent trunk)...
Hello. I am in the process of converting from 0.20.5 to a recent trunk. It now executes with throwing an exception, but I see nothing in the browser. The browser just hangs after a few seconds (after the FOP process completes). Ive done some searching in the mailing list, etc and I found a few instances of this. But none of the resolutions (if present) have helped. An excerpt of the code is below. The System.out that I added shows a non-zero value, as expected. Ive stripped the XSL doc down to pretty much nothing (just some text in a table) because the original version had a lot on non-compliant stuff. This is exactly how I handled the output stream in the old version of FOP and it worked perfectly. Any assistance is greatly appreciated. Chris ByteArrayOutputStream out = new ByteArrayOutputStream(); FopFactory fopFactory = FopFactory.newInstance(); FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); try { // Construct fop with desired output format Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out); TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(new StreamSource(xslURI.toString())); transformer.setParameter(versionParam, 2.0); Source src = "" StreamSource(new StringReader(xmlString)); Result res = new SAXResult(fop.getDefaultHandler()); transformer.transform(src, res); byte[] content = out.toByteArray(); System.out.println(FOT.render content.length:+content.length); response.setContentLength(content.length); response.getOutputStream().write(content); response.getOutputStream().flush(); } finally { out.close(); }