Bug report - URIResolver and basic authentication working incorrect when EBCDIC codepage is used
Similar to my previous mail I have a problem retrieving images from a database that uses basic authentication. Looking at the code I think the problem is again in the EBCDIC codepage that is used on the server. The problem is bolded: protected void applyHttpBasicAuthentication(URLConnection connection, String username, String password) { String combined = username + : + password; try { ByteArrayOutputStream baout = new ByteArrayOutputStream(combined.length() * 2); Base64EncodeStream base64 = new Base64EncodeStream(baout); base64.write(combined.getBytes()); base64.close(); connection.setRequestProperty(Authorization, Basic + new String(baout.toByteArray())); } catch (IOException e) { //won't happen. We're operating in-memory. throw new RuntimeException(Error during base64 encodation of username/password); } } This function is defined in: src\java\org\apache\fop\apps\FOURIResolver.java I will try with base64.write(combined.getBytes(UTF-8)); Will keep you posted. Jelka
Re: Need help with compiling fop beta for java 1.3 - images not working
I now have more detail information about the trouble I have with my build. In my xml file that I am transforming I have an image reference to a non-existent image on a Domino application server where there is basic authentication needed. When I try to open the image in my browser I get a login page (text/html). When I use binary distribution of Fop beta version that I downloaded this error is printed in my log: 2006-12-15 10:39:31,393 137057 WARN [org.apache.fop.image.analyser.XMLReader] (AgentThread: JavaAgent:) Error while constructing image from XML org.xml.sax.SAXParseException: Open quote is expected for attribute REL associated with an element type LINK. at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) at javax.xml.parsers.DocumentBuilder.parse(Unknown Source) at org.apache.fop.image.analyser.XMLReader.createDocument(XMLReader.java:114) at org.apache.fop.image.analyser.XMLReader.loadImage(XMLReader.java:94) at org.apache.fop.image.analyser.XMLReader.verifySignature(XMLReader.java:64) at org.apache.fop.image.analyser.ImageReaderFactory.make(ImageReaderFactory.java:84) at org.apache.fop.image.ImageFactory.loadImage(ImageFactory.java:212) at org.apache.fop.image.ImageLoader.loadImage(ImageLoader.java:55) at org.apache.fop.image.ContextImageCache.getImage(ImageFactory.java:416) at org.apache.fop.image.ImageFactory.getImage(ImageFactory.java:149) at org.apache.fop.fo.flow.ExternalGraphic.bind(ExternalGraphic.java:66) at org.apache.fop.fo.FObj.processNode(FObj.java:120) at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:308) at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:184) at org.apache.xml.serializer.ToXMLSAXHandler.closeStartTag(ToXMLSAXHandler.java:204) at org.apache.xml.serializer.ToSAXHandler.flushPending(ToSAXHandler.java:277) at org.apache.xml.serializer.ToXMLSAXHandler.endElement(ToXMLSAXHandler.java:243) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1399) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1374) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1374) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:393) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:176) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1374) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1374) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:393) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:176) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411) at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2281) at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1367) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:709) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1284) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1262) at JavaAgent.convertXML2PDF(JavaAgent.java:213) at JavaAgent.NotesMain(JavaAgent.java:123) at lotus.domino.AgentBase.runNotes(Unknown Source) at lotus.domino.NotesThread.run(NotesThread.java:215) 2006-12-15 10:39:31,393 137057 ERROR [org.apache.fop.image.FopImage] (AgentThread: JavaAgent:) Error while recovering image information (http://tidra.atol.si/neki.gif) : null java.lang.NullPointerException at org.apache.fop.image.analyser.XMLReader.verifySignature(XMLReader.java:65) at org.apache.fop.image.analyser.ImageReaderFactory.make(ImageReaderFactory.java:84) at org.apache.fop.image.ImageFactory.loadImage(ImageFactory.java:212) at org.apache.fop.image.ImageLoader.loadImage(ImageLoader.java:55) at org.apache.fop.image.ContextImageCache.getImage(ImageFactory.java:416) at org.apache.fop.image.ImageFactory.getImage(ImageFactory.java:149) at
Re: Need help with compiling fop beta for java 1.3 - images not working
When I change my JAVA_HOME to jdk 1.3 this is what I get: init-avail: [echo] --- Apache FOP 0.92beta [1999-2006] [echo] See build.properties and build-local.properties for additional build settings [echo] Apache Ant version 1.6.5 compiled on June 2 2005 [echo] VM: 1.3.1_19-b03, Sun Microsystems Inc. [echo] JAVA_HOME: C:\Java\jdk1.3.1_19 [echo] Jimi Support PRESENT [echo] JAI Support NOT Present [echo] JCE Support NOT Present [echo] JUnit Support NOT Present - Committers are required to have JUnit wo rking [echo] XMLUnit Support NOT Present - you can get it from http://xmlunit.sou rceforge.net init-filters-jdk14: init-filters-jdk13: [echo] Use GraphicsConfiguration adapter for JDK 1.3 or earlier. init: codegen: [echo] Generating the java files from xml resources [mkdir] Created dir: C:\Fop beta\build\gensrc [mkdir] Created dir: C:\Fop beta\build\gensrc\org\apache\fop\fonts\base14 [style] Processing C:\Fop beta\src\codegen\encodings.xml to C:\Fop beta\buil d\gensrc\org\apache\fop\fonts\CodePointMapping.java [style] Loading stylesheet C:\Fop beta\src\codegen\code-point-mapping.xsl BUILD FAILED javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xa lan.processor.TransformerFactoryImpl not found Jeremias Maerki [EMAIL PROTECTED] wrote on 15.12.2006 13:50:41: You need to set the JAVA_HOME environment variable to you actually compile with JDK 1.3.1. You currently compile with a 1.5 class library and compiler as you can see in the first echos from the build. Be sure to do an ant clear before you build after switching.
Re: Need help with compiling fop beta for java 1.3 - images not working
Yes I see, It did the trick ... : ) It was strange because I had the fop lib in my classpath ... And building with ant and java 1.5 did not have this problems finding the fop lib jars ... Thank you for help, I hope I can now get to the main issues I have ... Jelka Jeremias Maerki [EMAIL PROTECTED] wrote on 15.12.2006 16:16:05: Copy xalan*.jar, xerces*.jar, serializer*.jar and xml-apis*.jar from FOP's lib directory into %ANT_HOME%/lib. That should do the trick. On 15.12.2006 16:02:16 jelka.kosir wrote: When I change my JAVA_HOME to jdk 1.3 this is what I get: init-avail: [echo] --- Apache FOP 0.92beta [1999-2006] [echo] See build.properties and build-local.properties for additional build settings [echo] Apache Ant version 1.6.5 compiled on June 2 2005 [echo] VM: 1.3.1_19-b03, Sun Microsystems Inc. [echo] JAVA_HOME: C:\Java\jdk1.3.1_19 [echo] Jimi Support PRESENT [echo] JAI Support NOT Present [echo] JCE Support NOT Present [echo] JUnit Support NOT Present - Committers are required to have JUnit wo rking [echo] XMLUnit Support NOT Present - you can get it from http://xmlunit.sou rceforge.net init-filters-jdk14: init-filters-jdk13: [echo] Use GraphicsConfiguration adapter for JDK 1.3 or earlier. init: codegen: [echo] Generating the java files from xml resources [mkdir] Created dir: C:\Fop beta\build\gensrc [mkdir] Created dir: C:\Fop beta\build\gensrc\org\apache\fop\fonts\base14 [style] Processing C:\Fop beta\src\codegen\encodings.xml to C:\Fop beta\buil d\gensrc\org\apache\fop\fonts\CodePointMapping.java [style] Loading stylesheet C:\Fop beta\src\codegen\code-point-mapping.xsl BUILD FAILED javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xa lan.processor.TransformerFactoryImpl not found Jeremias Maerki [EMAIL PROTECTED] wrote on 15.12.2006 13:50:41: You need to set the JAVA_HOME environment variable to you actually compile with JDK 1.3.1. You currently compile with a 1.5 class library and compiler as you can see in the first echos from the build. Be sure to do an ant clear before you build after switching. Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Need help with compiling fop beta for java 1.3 - images not working
I'm working on a problem I've posted earlier this week and I would need to rebuild fop since I've changed the source. I have problems building fop beta 0.92 for java 1.3 I have jdk1.5.0_06 and Apache Ant version 1.6.5 compiled on June 2 2005. I changed the build.properties file (uncommented the two lines that seemed to be correct) javac.source = 1.3 javac.target = 1.3 I added jimi-1.0.jar in lib folder This is what ant prints: init-avail: [echo] --- Apache FOP 0.92beta [1999-2006] [echo] See build.properties and build-local.properties for additional build settings [echo] Apache Ant version 1.6.5 compiled on June 2 2005 [echo] VM: 1.5.0_06-b05, Sun Microsystems Inc. [echo] JAVA_HOME: C:\Program Files\Java\jdk1.5.0_06 [echo] Jimi Support PRESENT [echo] JAI Support NOT Present [echo] JCE Support PRESENT [echo] JUnit Support NOT Present - Committers are required to have JUnit wo rking [echo] XMLUnit Support NOT Present - you can get it from http://xmlunit.sou rceforge.net init-filters-jdk14: [echo] Use GraphicsConfiguration adapter for JDK 1.4. init-filters-jdk13: init: It seems like my build.properties setting for building java 1.3 does not get recognized and GraficsConfiguration adapter used if for JDK 1.4 instead of 1.3 Build is sucessful but when I use it in my embedded environment on Domino, no images can be rendered, this error is displayed: java.lang.NoClassDefFoundError: javax/imageio/ImageIO A while ago I had simular problems when building trunk for java 1.3 but the addition of jimi did the trick. Any suggestions ?
Re: How to plug in Error Handling in Fop beta
Update so fa on the error handling issue I have: I've tried to implement my own ErrorListener that would propagate errors created in fop and transfer them to my java code scope. Still errors like Error while recovering image information when image is not found do not raise exception - I cannot catch them in my java agent. The code for ErrorListener that I implemented is trivial and looks like this --- ErrorListener implementation - import javax.xml.transform.ErrorListener; import javax.xml.transform.TransformerException; import org.apache.log4j.Logger; public class MyErrorListener implements ErrorListener { private static Logger logger = Logger.getLogger(JavaAgent.class); public MyErrorListener() { logger.info(MyErrorListener initialised); } public void warning(TransformerException arg0) throws TransformerException { logger.warn(MyErrorListener WARN:,arg0); throw arg0; } public void error(TransformerException arg0) throws TransformerException { logger.error(MyErrorListener ERROR:,arg0); throw arg0; } public void fatalError(TransformerException arg0) throws TransformerException { logger.fatal(MyErrorListener FATAL:,arg0); throw arg0; } } I set this ErrorListener to the transformer like this: Transformer transformer = factory.newTransformer(new StreamSource(xsltfile)); // Set the value of a param in the stylesheet transformer.setParameter(versionParam, 2.0); MyErrorListener myErrorListener = new MyErrorListener(); transformer.setErrorListener(myErrorListener); Errors like when tag missing in the xml input file that I'm transforming get propagated and raise exception, but errors like I've written above (image file returned null) do not get piped trough my ErrorListener implementation. Am I even on the right track ? Thank you Jelka [EMAIL PROTECTED] 12.12.2006 10:16 Please respond to fop-users@xmlgraphics.apache.org To fop-users@xmlgraphics.apache.org cc Subject How to plug in Error Handling in Fop beta Hi ! I was looking trough the mailing list, I am sure this question was already answered but I cannot find the specific mail. I use fop as embedded in a Notes / Domino Agent. I would need to implement error handling, for example when Error is produced in process of transformation xml to pdf I would need fop to throw exception so I could catch it in my Embedded agent and process further on. I also set up logging with Log4J and I would like in case of error in fop transformation to dump the contents of xml file to error log (to be able to reproduce the error). As I am not familiar in Java programming as much I am looking for any documentation I would follow to set up error handling as described. Could someone be so kind and instruct me on this matter (maybe paste a useful link if there is any)? Thank you Jelka
Re: DOMImplementation method not found
Hi I will just write a note that I succeeded to create fo - pdf with fop beta 0.92 on Domino 6.5.2 June 01, 2004 with java 1.3 I copied all needed *.jar in the Domino/jvm/lib/ext directory in notes.ini I've put: JavaUserClasses=C:\Lotus\Domino\jvm\lib\ext\xml-apis-1.3.02.jar Before I've put this to my notes.ini I was getting the same exception (DOMImplementation method not found) Did this not work for you? Bye, Jelka [EMAIL PROTECTED] wrote on 27.10.2006 16:23:09: Jeremias Maerki [EMAIL PROTECTED] wrote on 27.10.2006 15:52:10: No. FOP needs the namespace feature for the DOM if it wants to support stuff like XMP metadata. So if the DOM implementation in Notes 6.5 doesn't have that feature and can't be replaced you're out of luck. You can try to disable the whole XMP stuff in the source code because you probably don't need it anyway, but FOP may simply crash in a different place later. Ok, I think I'm not going to try it this way - if fop could crash in some cases. That sounds very very ugly. Notes 6.5 is also rather old. Maybe you should consider upgrading if you also upgrade FOP. Furthermore, J2SE 1.3 at the end of the end-of-life phase. We may even drop support for J2SE 1.3 at some point because it gets in our way more and more. There are a lot of bigger companys which use notes R6 and I think they don't want to offer a lot of money to upgreate to R7. - I think the only thing I could do is to stick on Version 0.20.5. That Version is working for me very well, even in R6 (6.5.1)
Re: Strange combination of fo:inline and fo:block produces text to disappear when page breaks
I can tell you that I tested exact same input that was troubling me in 0.20.5 (disappearing text on page break) also in fop trunk and the pdf was generated as should. Jelka Saurabh Gupta [EMAIL PROTECTED] Sent by: news [EMAIL PROTECTED] 11.04.2006 17:23 Please respond to fop-users@xmlgraphics.apache.org To fop-users@xmlgraphics.apache.org cc Subject Re: Strange combination of fo:inline and fo:block produces text to disappear when page breaks Hi Chris, is the fop beta same as fop alpha. i am also getting above problem. content is not displayed on page break. I tried with fop alpha but looks like not fixed saurabh - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Including special characters using FOP 0.20.5
Hi ! This will maybe be helpful although I do not know if it will solve your problem. I use a dtd for my xml input file where I include entity file definitions. I those files I defined all named entities (I render pdf from html so I need support for all kinds of special characters). This is example of how to define entity !ENTITY tilde #126; !ENTITY florin #131; You can then use tilde; in your xml without problems. Bye, Jelka Archana Visveswaran, ASDC Chennai [EMAIL PROTECTED] 06.04.2006 09:25 Please respond to fop-users@xmlgraphics.apache.org To fop-users@xmlgraphics.apache.org cc Subject Including special characters using FOP 0.20.5 Hi, When I have symbols like $,,or copyright symbol I have problems when the pdf is rendered. I tried using #169; or #174; for copyright or registered symbols. This works fine. How do I resolve this for other symbols? Now that I know that Webdings cannot be supported by FOP, I have problems while including some icons supported by this font. Is there a way to resolve the same? Thanks and Regards, Archana V -Original Message- From: Jeremias Maerki [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 05, 2006 9:06 PM To: fop-users@xmlgraphics.apache.org Subject: Re: Error while creating metric file See here: http://xmlgraphics.apache.org/fop/0.20.5/embedding.html#config-external On 05.04.2006 16:57:51 Archana Visveswaran, ASDC Chennai wrote: Right! When I used fop -c option from my command line, the file gets converted well. But I have a Java application that does this conversion. Executing this code is similar to execution fop from command line. How can I make this code work with the -c option. i.e how do I ensure that the correct config file is referred to? I have attached the Java File. snip/ Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to pass to fop user and password needed for basic authentication to get image resource from Notes database
Jeremias Maerki [EMAIL PROTECTED] wrote on 22.02.2006 18:50:07: Added a Wiki page, in case anybody needs that in the future: http://wiki.apache.org/xmlgraphics-fop/HowTo/BasicHttpAuthentication Seems easy enough even for me to implement :) thank you I have a feeling you overlooked some responses I made for you, so just to be sure here they are again. I need to know if there is something I have to do with my findings (maybe report somewhere ?) -- Jeremias wrote: On the other side it's strange that wget is able to get the image with the uid/pwd encoded in the URL and FOP is not. Maybe FOP 0.20.5 does something bad with the URL. It would be great if someone could check this case with FOP Trunk so we can fix any problems like that for the next release. I did try the http://username:[EMAIL PROTECTED]/resource.gif notation with the new FOP Trunk and I'm getting error 401 code (Unauthorized). This url works in wget. Should a bug report be submitted ? This is the error message that displays when I run Fop Trunk from command line: Error with opening URL '//user:[EMAIL PROTECTED]/image.gif': Server retu rned HTTP response code: 401 for URL: http://user:[EMAIL PROTECTED]/image.gif java.io.IOException: Server returned HTTP response code: 401 for URL: http://user:[EMAIL PROTECTED]/image.gif I also tried this notation in my custom config file (I use custom fonts because character set we use is Latin 2) I set basehttp://user:[EMAIL PROTECTED]//base and this produces Error 401 when I run FOP Trunk from command line (wget is able to retrieve with this url). Error with opening URL 'arial.xml': Server returned HTTP response code: 401 for URL: http://user:[EMAIL PROTECTED]/arial.xml java.io.IOException: Server returned HTTP response code: 401 for URL: http://user:[EMAIL PROTECTED]/arial.xml Mismatch: page-sequence (http://www.w3.org/1999/XSL/Format) vs. root (http://www .w3.org/1999/XSL/Format) Error with opening URL 'arial.xml': Server returned HTTP response code: 401 for URL: http://user:[EMAIL PROTECTED]/arial.xml java.io.IOException: Server returned HTTP response code: 401 for URL: http://user:[EMAIL PROTECTED]/arial.xml javax.xml.transform.TransformerException: java.lang.RuntimeException: Cannot loa d font: failed to create Source from metrics file arial.xml Exception javax.xml.transform.TransformerException: java.lang.RuntimeException: Cannot loa d font: failed to create Source from metrics file arial.xml
Re: how to pass to fop user and password needed for basic authentication to get image resource from Notes database
I have the FopTrunk version on my computer (JDK 1.3) and testing it for issues I had in previous version FOP, so I can decide if we change fop version. This (see history of this mail) was one of the issues I had (how to pass to fop basic authentication for retrieving resources from application server). I solved this with workaround that David suggested (created a Servlet that adds authentication and fetches image). Now I was wondering if this basic authentication can be done more elegant in new version and how to do it. Currently I'm testing from FOP command line and when I'm done testing I will use FOP embedded in application. Jeremias wrote: you will have the ability to plug in a URIResolver to manually fetch an InputStream to a resource based on a URI.) I'm quite week at Java programming and am not sure how to plug a URIResolver. I would need a few instructions how to do this. I guess I have to implement an URIResolver for the resources that need authentication and use the default one for resources that don't need authentication. Where do I create my class? Do I create it in my Java application that I call FOP from and how do I convince FOP to use my implementation when needed? I will be glad for any instructions/useful tips on my URIResolver. Thank you! Jelka In addition I add some responses to Jeremias: -- Jeremias wrote: On the other side it's strange that wget is able to get the image with the uid/pwd encoded in the URL and FOP is not. Maybe FOP 0.20.5 does something bad with the URL. It would be great if someone could check this case with FOP Trunk so we can fix any problems like that for the next release. I did try the http://username:[EMAIL PROTECTED]/resource.gif notation with the new FOP Trunk and I'm getting error 401 code (Unauthorized). This url works in wget. Should a bug report be submitted ? This is the error message that displays when I run Fop Trunk from command line: Error with opening URL '//user:[EMAIL PROTECTED]/image.gif': Server retu rned HTTP response code: 401 for URL: http://user:[EMAIL PROTECTED]/image.gif java.io.IOException: Server returned HTTP response code: 401 for URL: http://user:[EMAIL PROTECTED]/image.gif -- I also tried this notation in my custom config file (I use custom fonts because character set we use is Latin 2) I set basehttp://user:[EMAIL PROTECTED]//base and this produces Error 401 when I run FOP Trunk from command line (wget is able to retrieve with this url). Error with opening URL 'arial.xml': Server returned HTTP response code: 401 for URL: http://user:[EMAIL PROTECTED]/arial.xml java.io.IOException: Server returned HTTP response code: 401 for URL: http://user:[EMAIL PROTECTED]/arial.xml Mismatch: page-sequence (http://www.w3.org/1999/XSL/Format) vs. root (http://www .w3.org/1999/XSL/Format) Error with opening URL 'arial.xml': Server returned HTTP response code: 401 for URL: http://user:[EMAIL PROTECTED]/arial.xml java.io.IOException: Server returned HTTP response code: 401 for URL: http://user:[EMAIL PROTECTED]/arial.xml javax.xml.transform.TransformerException: java.lang.RuntimeException: Cannot loa d font: failed to create Source from metrics file arial.xml Exception javax.xml.transform.TransformerException: java.lang.RuntimeException: Cannot loa d font: failed to create Source from metrics file arial.xml -- Jeremias Maerki [EMAIL PROTECTED] 13.10.2005 16:49 Please respond to fop-users@xmlgraphics.apache.org To fop-users@xmlgraphics.apache.org cc Subject Re: how to pass to fop user and password needed for basic authentication to get image resource from Notes database BTW, the redesigned FOP will make things like that easier. You will have the ability to plug in a URIResolver to manually fetch an InputStream to a resource based on a URI. This will make work-arounds like David's servlet unnecessary. On the other side it's strange that wget is able to get the image with the uid/pwd encoded in the URL and FOP is not. Maybe FOP 0.20.5 does something bad with the URL. It would be great if someone could check this case with FOP Trunk so we can fix any problems like that for the next release. On 13.10.2005 16:26:33 David Delbecq wrote: Then i guess your solution is to write a servlet which access files using the api and get credits token lik this: http://domino.example.com/myServlet?doc=/0/A3402F5B583F538AC1257093004C41C8/$File/image.gifuser=someUserpass=somePass If image tag of .fo were to use the InputSource schem of xml document, you could have created an Inputsource which manage the authentification. Unfortunately, as i discovered some time before, fop does not use inputsource to load pictures. (really, it uses a simple URL()) I think this will be handled in next version, but if you followed this maling list, lots of things will change in next version, so it might not be availbe for a few time :) Ha yeah, you can also try to add your custom protocol to URL (like
fop Trunk - problems with fo:external-graphic when fetching image via http
Hi ! I'm using FopTrunk version and I have a problem with external graphics. If try to print an image to PDF from filesystem, works OK. For example, this works: fo:external-graphic src=C:\FOPTrunk\examples\fo\graphics\fop.jpg/ This error is printed when I try to print image from via http: Uncaught error fetching image: java.lang.NullPointerException at sun.awt.image.URLImageSource.getConnection(Unknown Source) at sun.awt.image.URLImageSource.getDecoder(Unknown Source) at sun.awt.image.InputStreamImageSource.doFetch(Unknown Source) at sun.awt.image.ImageFetcher.fetchloop(Unknown Source) at sun.awt.image.ImageFetcher.run(Unknown Source) I tried several notations: fo:external-graphic src=url('http://www.apache.org/images/asf_logo_wide.gif')/ fo:external-graphic src=url(http://www.apache.org/images/asf_logo_wide.gif)/ fo:external-graphic src=http://www.apache.org/images/asf_logo_wide.gif/ fo:external-graphic src='http://www.apache.org/images/asf_logo_wide.gif'/ I did not try my sources with BETA version, but in fop 0.20.5 same code works fine (no error retrieving image). Anyone has any idea what I'm doing wrong ? Thank you, Jelka
Re: fop Trunk - problems with fo:external-graphic when fetching image via http
I'm using JDK 1.3. I did try your suggestion and added JIMI. Now images work just fine ! Thank you !! Jeremias Maerki [EMAIL PROTECTED] 14.02.2006 17:09 Please respond to fop-users@xmlgraphics.apache.org To fop-users@xmlgraphics.apache.org cc Subject Re: fop Trunk - problems with fo:external-graphic when fetching image via http Please always state which JDK you're using! Almost certainly, this is FOP falling back to using the GifImage image wrapper which is not working as it should. Note that this class is more or less a hack. If FOP is falling back to using GifImage this means that you are using JDK 1.3 or you have not compiled FOP under JDK 1.4 or higher (thus enabling ImageIO support). Possibilities for JDK 1.3: - Add JAI or JIMI and rebuild FOP. Possibilities for JDK 1.4: - Rebuild FOP under JDK 1.4 or later - Add JAI or JIMI and rebuild FOP. More info: http://xmlgraphics.apache.org/fop/trunk/graphics.html#packages I hope that helps. On 14.02.2006 16:55:19 jelka.kosir wrote: Hi ! I'm using FopTrunk version and I have a problem with external graphics. If try to print an image to PDF from filesystem, works OK. For example, this works: fo:external-graphic src=""> This error is printed when I try to print image from via http: Uncaught error fetching image: java.lang.NullPointerException at sun.awt.image.URLImageSource.getConnection(Unknown Source) at sun.awt.image.URLImageSource.getDecoder(Unknown Source) at sun.awt.image.InputStreamImageSource.doFetch(Unknown Source) at sun.awt.image.ImageFetcher.fetchloop(Unknown Source) at sun.awt.image.ImageFetcher.run(Unknown Source) I tried several notations: fo:external-graphic src=""> url('http://www.apache.org/images/asf_logo_wide.gif')/ fo:external-graphic src=""> url(http://www.apache.org/images/asf_logo_wide.gif)/ fo:external-graphic src=""> / fo:external-graphic src=""> / I did not try my sources with BETA version, but in fop 0.20.5 same code works fine (no error retrieving image). Anyone has any idea what I'm doing wrong ? Thank you, Jelka Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Command line call to FOP
Hi all! I was just wondering, how could I use fop beta from Command prompt. In 0.20.5 version I used this line: java -cp C:\fopdir\fop.jar;C:\xalandir\xalan.jar org.apache.fop.apps.Fop -c C:\configdir\config.xml -xml C:\xmldir\test.xml -xsl C:\xsldir\test.xsl -pdf C:\pdfdir\test.pdf Now with the beta/Trunk version I notice this line retrieves error Exception in thread main java.lang.NoSuchMethodError: main How should my Command line call look in the new beta/Trunk version? Thank You Jelka
Re: Command line call to FOP
Yes, when I change org.apache.fop.apps.Fop to org.apache.fop.cli.Main all works fine except 2 things: 1.) Before in the 0.20.5 I was able to use this command from anywhere (no matter where my Command Prompt is positioned). Now it only works if I am positioned in the C:\FopTrunk directory on my computer. For example if my Command Prompt is positioned on C: this is the error that is retrieved: Unable to start FOP: java.lang.RuntimeException: fop.jar not found in directory: C:\ (or below) at org.apache.fop.cli.Main.getJARList(Main.java:57) at org.apache.fop.cli.Main.startFOPWithDynamicClasspath(Main.java:117) at org.apache.fop.cli.Main.main(Main.java:192) although I pass ClassPath: java -cp C:\FOPTrunk\build\fop.jar;C:\FOPTrunk\lib\xalan-2.7.0.jar. Is this OK ? 2.) And another thing: in the previous version some INFO displayed when I run Fop .. for example: [INFO] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser [INFO] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser [INFO] FOP 0.20.5 [INFO] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser [INFO] building formatting object tree [INFO] setting up fonts [INFO] [1] [INFO] [2] [INFO] Parsing of document complete, stopping renderer Now with the Trunk version there is no INFO displaying. Can I pass Fop any parameter to switch the INFO to display? Sorry if this is a trivial question. And thank you again, Jelka Jeremias Maerki [EMAIL PROTECTED] 31.01.2006 09:45 Please respond to fop-users@xmlgraphics.apache.org To fop-users@xmlgraphics.apache.org cc Subject Re: Command line call to FOP Because the main class is not org.apache.fop.apps.Fop anymore, but org.apache.fop.cli.Main now. If you want to know how the command-line should look, look at fop.bat in the root directory of the FOP distribution. If you use that batch file, everything will work fine. On 31.01.2006 09:38:40 jelka.kosir wrote: Hi all! I was just wondering, how could I use fop beta from Command prompt. In 0.20.5 version I used this line: java -cp C:\fopdir\fop.jar;C:\xalandir\xalan.jar org.apache.fop.apps.Fop -c C:\configdir\config.xml -xml C:\xmldir\test.xml -xsl C:\xsldir\test.xsl -pdf C:\pdfdir\test.pdf Now with the beta/Trunk version I notice this line retrieves error Exception in thread main java.lang.NoSuchMethodError: main How should my Command line call look in the new beta/Trunk version? Thank You Jelka Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: New User - Fop error.
Would be helpful if you also write down: What FOP are you using ? (0.20.5 or beta 0.91) Would be helpful if you attached the xsl and xml files or just copy code. IT Department - Coleshill [EMAIL PROTECTED] 26.01.2006 13:15 Please respond to fop-users@xmlgraphics.apache.org To fop-users@xmlgraphics.apache.org cc Subject New User - Fop error. Hi there I hope this is the correct place to post. Ive only just come to looking at XML/FOP in the last few days so please excuse any ignorance. I am running FOP from a DOS shell on windows XP pro. I have just installed the latest JRE. I have put the files I am trying to convert into the same directory as the Fop.bat file, these are afx.xml and afx.xsl. I run fop using : fop -xsl afx.xsl -xml afx.xml -pdf afx.pdf and it returns an error : javax.xml.transform.TransformerException: java.lang.IllegalStateException: endElement() called for html where there is no current element. Exception javax.xml.transform.TransformerException: java.lang.IllegalStateException: endElement() called for html where there is no current element. If anyone has any ideas or is able to point me in the right direction I would be most appreciative. Thankyou. Matt. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem with external-graphics
There was a note that said that GIF is not supported quote: RTF output currently doesn't support GIF images. Please convert them to PNG. This was a answer sent by Jeremias Maerki Subject: Re: problem with FOP 0.9 and fo:external-graphics yesterday Maybe png does not work either ?? Jelka
Re: Strange combination of fo:inline and fo:block produces text to disappear when page breaks
Thank you both, I will review my options to move application to FOP 0.91 beta Chris Bowditch [EMAIL PROTECTED] wrote on 18.01.2006 09:38:41: J.Pietschmann wrote: [EMAIL PROTECTED] wrote: I'm using fop 0.20.5 and I noticed a strange behaviour when certain combination of fo:inline and fo:block tries to print to pdf. ... Note that text disappears only when page breaks. That's a known bug. Is there any way I could go around this bug without having to change the input xml data ?? You should consider upgrading to FOP 0.91beta, which doesn't have this particular bug. snip/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: fo:external-graphic limitation?
I use xsl:variable and works for me. xsl:variable name=logo_path select='C:/MyPath/tmp/smartdocument.loan/logo.jpg'/ (notice path on filesystem !!! - I allways use absolute) And when I refer to variable image I use {} (don't know if necessary but works for me fo:external-graphic src=""> Try If it works for you Bye Jelka mike [EMAIL PROTECTED] Sent by: news [EMAIL PROTECTED] 23.11.2005 17:21 Please respond to fop-users@xmlgraphics.apache.org To fop-users@xmlgraphics.apache.org cc Subject fo:external-graphic limitation? Hi all, I would like to load an external graphic through a parameter value? Because it does not seem to work for me ;-( For example, the following produces the error: [ERROR] Error while creating area : Error with image URL: $logo_path (No such file or directory) and no base URL is specified ?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:param name=logo_path select='/tmp/smartdocument.loan/logo.jpg'/ xsl:template match=/ fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format fo:layout-master-set fo:simple-page-master master-name=simple page-height=29.7cm page-width=21cm margin-top=1cm margin-bottom=1cm margin-left=8mm margin-right=8mm fo:region-body margin-top=0cm margin-bottom=0cm/ fo:region-before extent=5cm/ fo:region-after extent=5cm/ /fo:simple-page-master fo:page-sequence-master master-name=page-sequence fo:single-page-master-reference master-reference=simple/ /fo:page-sequence-master /fo:layout-master-set fo:page-sequence master-reference=page-sequence fo:flow flow-name=xsl-region-body fo:block font-family=sans-serif font-size=10pt text-align=left fo:table table-layout=fixed fo:table-column column-width=95mm/ fo:table-column column-width=95mm/ fo:table-body fo:table-row fo:table-cell padding=2mm fo:block fo:external-graphic src=""> /fo:block [...] I've checked the value of logo_path and it is correct. Maybe there's another way to do it ... Any idea? thanx, --mike - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
how to pass to fop user and password needed for basic authentication to get image resource from Notes database
I will describe my situation. I have an application server (Domino) and on it running a web application. On this web application users have a basic editor (uses xhtml) to input basic text/formats/tables and upload images that are included in the document Images are uploaded in notes database and url is passed into this editor (xml source for this is standard html like img src="" /) and I parse it like this: part of xsl file: .xsl:template match=img fo:block space-after=12pt fo:external-graphic src="" PROTECTED] xsl:if test=@width xsl:attribute name=widthxsl:choosexsl:when test=contains(@width, 'px')xsl:value-of select=@width//xsl:whenxsl:otherwisexsl:value-of select=concat(@width, 'px')//xsl:otherwise/xsl:choose/xsl:attribute /xsl:if xsl:if test=@height xsl:attribute name=heightxsl:choosexsl:when test=contains(@height, 'px')xsl:value-of select=@height//xsl:whenxsl:otherwisexsl:value-of select=concat(@height, 'px')//xsl:otherwise/xsl:choose/xsl:attribute /xsl:if /fo:external-graphic /fo:block /xsl:template Users have a possibility to create pdf of created document from this application. All works fine - I generate xml on demand and transform it with xsl file that is prepared. The problem is when transformer fetches image from database I do not know how to pass username and password for authentication and the process that requests the image now gets a Login Page instead (html response) and when trying to include it into PDF an error that is printed in the log: [ERROR] Could not load external SVG: White spaces are required between publicId and systemId. [ERROR] Error while creating area : No ImageReader for this type of image (http://domino.example.com/database.nsf/0/A3402F5B583F538AC1257093004C41C8/$File/image.gif) So my question is: Is there a way to set username and password for fop to use when fetching image from publicly not accessible database resources? Thank you all for helping. Jelka
Re: how to pass to fop user and password needed for basic authentication to get image resource from Notes database
Yes, I did try this notation and the error came up the same (Could not load external SVG: ... error) If I try to use such url in a web browser for example, when first requesting this url a page not found is displayed and all next responses to this same request retrieve an empty page (there is some html but the body tag is empty so blank page is displayed). I also noticed that with using wget with this type of url, the image is retrieved from the server correctly. Thank you David for the suggestion, I was kind of sad to notice that this doesn't work as I thought it would. David Delbecq [EMAIL PROTECTED] 13.10.2005 15:33 Please respond to fop-users@xmlgraphics.apache.org To fop-users@xmlgraphics.apache.org cc Subject Re: how to pass to fop user and password needed for basic authentication to get image resource from Notes database Did you try this kind of url? http://user:[EMAIL PROTECTED]/database.nsf/0/A3402F5B583F538AC1257093004C41C8/$File/image.gif [EMAIL PROTECTED] a écrit : I will describe my situation. I have an application server (Domino) and on it running a web application. On this web application users have a basic editor (uses xhtml) to input basic text/formats/tables and upload images that are included in the document Images are uploaded in notes database and url is passed into this editor (xml source for this is standard html like img src=""> /) and I parse it like this: part of xsl file: .xsl:template match=img fo:block space-after=12pt fo:external-graphic src="" PROTECTED] xsl:if test=@width xsl:attribute name=widthxsl:choosexsl:when test=contains(@width, 'px')xsl:value-of select=@width//xsl:whenxsl:otherwisexsl:value-of select=concat(@width, 'px')//xsl:otherwise/xsl:choose/xsl:attribute /xsl:if xsl:if test=@height xsl:attribute name=heightxsl:choosexsl:when test=contains(@height, 'px')xsl:value-of select=@height//xsl:whenxsl:otherwisexsl:value-of select=concat(@height, 'px')//xsl:otherwise/xsl:choose/xsl:attribute /xsl:if /fo:external-graphic /fo:block /xsl:template Users have a possibility to create pdf of created document from this application. All works fine - I generate xml on demand and transform it with xsl file that is prepared. The problem is when transformer fetches image from database I do not know how to pass username and password for authentication and the process that requests the image now gets a Login Page instead (html response) and when trying to include it into PDF an error that is printed in the log: [ERROR] Could not load external SVG: White spaces are required between publicId and systemId. [ERROR] Error while creating area : No ImageReader for this type of image (http://domino.example.com/database.nsf/0/A3402F5B583F538AC1257093004C41C8/$File/image.gif) So my question is: Is there a way to set username and password for fop to use when fetching image from publicly not accessible database resources? Thank you all for helping. Jelka - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]