Re: Problems with FOP and image
Ok yeah the log4j its having isuees to find the configuration log4j:WARN No appenders could be found for logger (org.apache.fop.util.ContentHandlerFactoryRegistry). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. i go to the faq guide and it say try loading the class or resource yourself. If you can't find it, neither will log4j. aaa i dont know where to set this also here its my xlst http://old.nabble.com/file/p31835645/FacturasOMF.xsl FacturasOMF.xsl and the fo file that generate the editix http://old.nabble.com/file/p31835645/Prueba.fo Prueba.fo Rob Sargent-4 wrote: The first thing is to really dig into what you did to netbeans to get it to work... I've forgotten what your stylesheet looked like, so maybe if you show us again how you're referencing your images we might notice a problem. It might also help to see the fo generated during your transformation. Can you grab that just after xslt and just before fop calls. Are you sure there is no error being logged somewhere when you run from the command line? (Where is log4j writing and at what level?) Oscar.Flores wrote: You where absolutly rigth i miss a few libraries to add into the jar file, i modified the build.xml to add the package and jar that i need, now the error message is not there but still the images dont show in the pdf i remeber that i do something in netbeans so they can add to the pdf but i cant remeber i dont now if there is still a library that is missing or i am adding more than it should be This is what i use : cfdi-base-0.1.6-SNAPSHOT.jar guava-r09.jar guava-r09-gwt.jar jaxb-impl-2.1.10.jar avalon-framework-api-4.3.jar avalon-framework-cvs-20020806.jar avalon-logkit-2.1.jar not-yet-commons-ssl-0.3.11.jar commons-codec-1.5.jar commons-codec-1.5-sources.jar log4j-1.2.16.jar fop.jar jdom.jar xmlgraphics-commons-1.4.jar commons-io-1.3.1.jar fop-pdf-images-2.0.1.SNAPSHOT.jar pdfbox-app-1.5.0.jar fontbox-1.3.1.jar jempbox-1.3.1.jar xercesImpl-2.7.1.jar batik-all-1.7.jar xml-apis-1.3.04.jar xml-apis-ext-1.3.04.jar avalon-framework-4.2.0.jar xalan-2.7.0.jar serializer-2.7.0.jar commons-logging-1.0.4.jar jai_codec.jar jai_core.jar batik-ext.jar jai_imageio-1.1-sources.jar Thanks Rob for the help Rob Sargent-4 wrote: I suspect running from your jar does not have/use the same classpath that is in effect while you're in the debugger. By what mechanism do you generate the jar? Is it an executable jar or are you running java -classpath your-jar-here:other-jars Main? Make your IDE (netbeans) display the classpath it uses to run your app and compare that with the above. On 06/09/2011 07:21 PM, Oscar.Flores wrote: aaa ok well my problem is that when i do the pdf in netbean the pdf is fine with images and evething but when i run the jar file in command it give me a error GRAVE: Error while processing image: I:\cfd\rfc.jpg (image/jpeg) org.apache.xmlgraphics.image.loader.ImageException: Cannot load image (no suitable loader/converter combination available) for I:\cfd\rfc.jpg (image/jpeg) so i dont no what its not working and if i have to add something to my code so the images can load i am s desperate what i am doing wrong?? i am sorry for the trouble and if a dont explain my self very good jejeje Rob Sargent-4 wrote: Not at all sure what your problem is. All I can do is show you what works for us. Our source xml looks like this: image image-id=381623861 reference-id=ref-220 width=750 height=750 image-space-id=space-1 position=5 image-pool-position=31 pos=4 file=ref_10_1002108221 !-- an actual file (.jpeg copied the working directory of the transformer -- fields / caption / annotations arrow_positions origHeight=750 origWidth=750 / /annotations /image Our xslt looks like this for each image needed. xsl:template name=image xsl:param name=img/ !-- This is the xml node from the source xml above -- xsl:param name=width/ xsl:param name=height select=$width/ xsl:param name=ignoreHeightfalse/xsl:param fo:block fo:external-graphic src={$img/@file} height={$height} width={$width} content-height=scale-to-fit content-width=scale-to-fit border=0.5pt solid black border-collapse=separate xsl:if test=$ignoreHeight != 'true' xsl:attribute name=height xsl:value-of select=$height/ /xsl:attribute /xsl:if /fo:external-graphic /fo:block /xsl:template Our generated fo looks like this: fo:table-cell fo:block fo:external-graphic border-collapse=separate border=0.5pt solid black content-width=scale-to-fit content-height=scale-to-fit width=2.5in height=2.5in src=ref_10_1002108221 / /fo:block /fo:table-cell And the generated pdfs include the image and are shipped to the printer. How does this stack up with
Re: Problems with FOP and image
Do you have a config file for log4j. Usually it's in a resource tree. Are you copying that to your deployment? Is your ant script including the config file in the jar of your application? On 06/13/2011 10:12 AM, Oscar.Flores wrote: Ok yeah the log4j its having isuees to find the configuration log4j:WARN No appenders could be found for logger (org.apache.fop.util.ContentHandlerFactoryRegistry). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. i go to the faq guide and it say try loading the class or resource yourself. If you can't find it, neither will log4j. aaa i dont know where to set this also here its my xlst http://old.nabble.com/file/p31835645/FacturasOMF.xsl FacturasOMF.xsl and the fo file that generate the editix http://old.nabble.com/file/p31835645/Prueba.fo Prueba.fo Rob Sargent-4 wrote: The first thing is to really dig into what you did to netbeans to get it to work... I've forgotten what your stylesheet looked like, so maybe if you show us again how you're referencing your images we might notice a problem. It might also help to see the fo generated during your transformation. Can you grab that just after xslt and just before fop calls. Are you sure there is no error being logged somewhere when you run from the command line? (Where is log4j writing and at what level?) Oscar.Flores wrote: You where absolutly rigth i miss a few libraries to add into the jar file, i modified the build.xml to add the package and jar that i need, now the error message is not there but still the images dont show in the pdf i remeber that i do something in netbeans so they can add to the pdf but i cant remeber i dont now if there is still a library that is missing or i am adding more than it should be This is what i use : cfdi-base-0.1.6-SNAPSHOT.jar guava-r09.jar guava-r09-gwt.jar jaxb-impl-2.1.10.jar avalon-framework-api-4.3.jar avalon-framework-cvs-20020806.jar avalon-logkit-2.1.jar not-yet-commons-ssl-0.3.11.jar commons-codec-1.5.jar commons-codec-1.5-sources.jar log4j-1.2.16.jar fop.jar jdom.jar xmlgraphics-commons-1.4.jar commons-io-1.3.1.jar fop-pdf-images-2.0.1.SNAPSHOT.jar pdfbox-app-1.5.0.jar fontbox-1.3.1.jar jempbox-1.3.1.jar xercesImpl-2.7.1.jar batik-all-1.7.jar xml-apis-1.3.04.jar xml-apis-ext-1.3.04.jar avalon-framework-4.2.0.jar xalan-2.7.0.jar serializer-2.7.0.jar commons-logging-1.0.4.jar jai_codec.jar jai_core.jar batik-ext.jar jai_imageio-1.1-sources.jar Thanks Rob for the help Rob Sargent-4 wrote: I suspect running from your jar does not have/use the same classpath that is in effect while you're in the debugger. By what mechanism do you generate the jar? Is it an executable jar or are you running java -classpath your-jar-here:other-jars Main? Make your IDE (netbeans) display the classpath it uses to run your app and compare that with the above. On 06/09/2011 07:21 PM, Oscar.Flores wrote: aaa ok well my problem is that when i do the pdf in netbean the pdf is fine with images and evething but when i run the jar file in command it give me a error GRAVE: Error while processing image: I:\cfd\rfc.jpg (image/jpeg) org.apache.xmlgraphics.image.loader.ImageException: Cannot load image (no suitable loader/converter combination available) for I:\cfd\rfc.jpg (image/jpeg) so i dont no what its not working and if i have to add something to my code so the images can load i am s desperate what i am doing wrong?? i am sorry for the trouble and if a dont explain my self very good jejeje Rob Sargent-4 wrote: Not at all sure what your problem is. All I can do is show you what works for us. Our source xml looks like this: image image-id=381623861 reference-id=ref-220 width=750 height=750 image-space-id=space-1 position=5 image-pool-position=31 pos=4 file=ref_10_1002108221 !-- an actual file (.jpeg copied the working directory of the transformer -- fields / caption / annotations arrow_positions origHeight=750 origWidth=750 / /annotations /image Our xslt looks like this for each image needed. xsl:template name=image xsl:param name=img/ !-- This is the xml node from the source xml above -- xsl:param name=width/ xsl:param name=height select=$width/ xsl:param name=ignoreHeightfalse/xsl:param fo:block fo:external-graphic src={$img/@file} height={$height} width={$width} content-height=scale-to-fit content-width=scale-to-fit border=0.5pt solid black border-collapse=separate xsl:if test=$ignoreHeight != 'true' xsl:attribute name=height xsl:value-of select=$height/ /xsl:attribute /xsl:if /fo:external-graphic /fo:block /xsl:template Our generated fo looks like this: fo:table-cell fo:block fo:external-graphic border-collapse=separate border=0.5pt solid black content-width=scale-to-fit content-height=scale-to-fit width=2.5in height=2.5in src=ref_10_1002108221 / /fo:block /fo:table-cell And the
Re: Problems with FOP and image
ok i dont thik i have a configuracion file i find the code that i put in the other post i think its the basic Rob Sargent-4 wrote: Do you have a config file for log4j. Usually it's in a resource tree. Are you copying that to your deployment? Is your ant script including the config file in the jar of your application? On 06/13/2011 10:12 AM, Oscar.Flores wrote: Ok yeah the log4j its having isuees to find the configuration log4j:WARN No appenders could be found for logger (org.apache.fop.util.ContentHandlerFactoryRegistry). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. i go to the faq guide and it say try loading the class or resource yourself. If you can't find it, neither will log4j. aaa i dont know where to set this also here its my xlst http://old.nabble.com/file/p31835645/FacturasOMF.xsl FacturasOMF.xsl and the fo file that generate the editix http://old.nabble.com/file/p31835645/Prueba.fo Prueba.fo Rob Sargent-4 wrote: The first thing is to really dig into what you did to netbeans to get it to work... I've forgotten what your stylesheet looked like, so maybe if you show us again how you're referencing your images we might notice a problem. It might also help to see the fo generated during your transformation. Can you grab that just after xslt and just before fop calls. Are you sure there is no error being logged somewhere when you run from the command line? (Where is log4j writing and at what level?) Oscar.Flores wrote: You where absolutly rigth i miss a few libraries to add into the jar file, i modified the build.xml to add the package and jar that i need, now the error message is not there but still the images dont show in the pdf i remeber that i do something in netbeans so they can add to the pdf but i cant remeber i dont now if there is still a library that is missing or i am adding more than it should be This is what i use : cfdi-base-0.1.6-SNAPSHOT.jar guava-r09.jar guava-r09-gwt.jar jaxb-impl-2.1.10.jar avalon-framework-api-4.3.jar avalon-framework-cvs-20020806.jar avalon-logkit-2.1.jar not-yet-commons-ssl-0.3.11.jar commons-codec-1.5.jar commons-codec-1.5-sources.jar log4j-1.2.16.jar fop.jar jdom.jar xmlgraphics-commons-1.4.jar commons-io-1.3.1.jar fop-pdf-images-2.0.1.SNAPSHOT.jar pdfbox-app-1.5.0.jar fontbox-1.3.1.jar jempbox-1.3.1.jar xercesImpl-2.7.1.jar batik-all-1.7.jar xml-apis-1.3.04.jar xml-apis-ext-1.3.04.jar avalon-framework-4.2.0.jar xalan-2.7.0.jar serializer-2.7.0.jar commons-logging-1.0.4.jar jai_codec.jar jai_core.jar batik-ext.jar jai_imageio-1.1-sources.jar Thanks Rob for the help Rob Sargent-4 wrote: I suspect running from your jar does not have/use the same classpath that is in effect while you're in the debugger. By what mechanism do you generate the jar? Is it an executable jar or are you running java -classpath your-jar-here:other-jars Main? Make your IDE (netbeans) display the classpath it uses to run your app and compare that with the above. On 06/09/2011 07:21 PM, Oscar.Flores wrote: aaa ok well my problem is that when i do the pdf in netbean the pdf is fine with images and evething but when i run the jar file in command it give me a error GRAVE: Error while processing image: I:\cfd\rfc.jpg (image/jpeg) org.apache.xmlgraphics.image.loader.ImageException: Cannot load image (no suitable loader/converter combination available) for I:\cfd\rfc.jpg (image/jpeg) so i dont no what its not working and if i have to add something to my code so the images can load i am s desperate what i am doing wrong?? i am sorry for the trouble and if a dont explain my self very good jejeje Rob Sargent-4 wrote: Not at all sure what your problem is. All I can do is show you what works for us. Our source xml looks like this: image image-id=381623861 reference-id=ref-220 width=750 height=750 image-space-id=space-1 position=5 image-pool-position=31 pos=4 file=ref_10_1002108221 !-- an actual file (.jpeg copied the working directory of the transformer -- fields / caption / annotations arrow_positions origHeight=750 origWidth=750 / /annotations /image Our xslt looks like this for each image needed. xsl:template name=image xsl:param name=img/ !-- This is the xml node from the source xml above -- xsl:param name=width/ xsl:param name=height select=$width/ xsl:param name=ignoreHeightfalse/xsl:param fo:block fo:external-graphic src={$img/@file} height={$height} width={$width} content-height=scale-to-fit content-width=scale-to-fit border=0.5pt solid black border-collapse=separate xsl:if test=$ignoreHeight != 'true' xsl:attribute name=height xsl:value-of select=$height/ /xsl:attribute /xsl:if /fo:external-graphic /fo:block /xsl:template
Re: Problems with FOP and image
Try this log4j.xml: Place it at the root of your jar file ?xml version=1.0 encoding=UTF-8? !DOCTYPE log4j:configuration SYSTEM log4j.dtd log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/; debug=false appender name=CONSOLE class=org.apache.log4j.ConsoleAppender param name=Target value=System.out/ param name=Threshold value=DEBUG/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%d{ABSOLUTE} %-5p [%c{1}] %m%n/ /layout /appender category name=org priority value=DEBUG/ /category category name=org.apache priority value=WARN/ /category category name=org.springframework priority value=WARN/ /category category name=org.hibernate priority value=DEBUG/ /category category name=net priority value=ERROR/ /category category name=javax priority value=ERROR/ /category category name=java priority value=ERROR/ /category category name=sun priority value=ERROR/ /category category name=org.jboss priority value=INFO/ /category category name=org.jboss.seam priority value=ERROR/ /category root appender-ref ref=CONSOLE/ /root /log4j:configuration On 06/13/2011 11:06 AM, Oscar.Flores wrote: ok i dont thik i have a configuracion file i find the code that i put in the other post i think its the basic Rob Sargent-4 wrote: Do you have a config file for log4j. Usually it's in a resource tree. Are you copying that to your deployment? Is your ant script including the config file in the jar of your application? On 06/13/2011 10:12 AM, Oscar.Flores wrote: Ok yeah the log4j its having isuees to find the configuration log4j:WARN No appenders could be found for logger (org.apache.fop.util.ContentHandlerFactoryRegistry). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. i go to the faq guide and it say try loading the class or resource yourself. If you can't find it, neither will log4j. aaa i dont know where to set this also here its my xlst http://old.nabble.com/file/p31835645/FacturasOMF.xsl FacturasOMF.xsl and the fo file that generate the editix http://old.nabble.com/file/p31835645/Prueba.fo Prueba.fo Rob Sargent-4 wrote: The first thing is to really dig into what you did to netbeans to get it to work... I've forgotten what your stylesheet looked like, so maybe if you show us again how you're referencing your images we might notice a problem. It might also help to see the fo generated during your transformation. Can you grab that just after xslt and just before fop calls. Are you sure there is no error being logged somewhere when you run from the command line? (Where is log4j writing and at what level?) Oscar.Flores wrote: You where absolutly rigth i miss a few libraries to add into the jar file, i modified the build.xml to add the package and jar that i need, now the error message is not there but still the images dont show in the pdf i remeber that i do something in netbeans so they can add to the pdf but i cant remeber i dont now if there is still a library that is missing or i am adding more than it should be This is what i use : cfdi-base-0.1.6-SNAPSHOT.jar guava-r09.jar guava-r09-gwt.jar jaxb-impl-2.1.10.jar avalon-framework-api-4.3.jar avalon-framework-cvs-20020806.jar avalon-logkit-2.1.jar not-yet-commons-ssl-0.3.11.jar commons-codec-1.5.jar commons-codec-1.5-sources.jar log4j-1.2.16.jar fop.jar jdom.jar xmlgraphics-commons-1.4.jar commons-io-1.3.1.jar fop-pdf-images-2.0.1.SNAPSHOT.jar pdfbox-app-1.5.0.jar fontbox-1.3.1.jar jempbox-1.3.1.jar xercesImpl-2.7.1.jar batik-all-1.7.jar xml-apis-1.3.04.jar xml-apis-ext-1.3.04.jar avalon-framework-4.2.0.jar xalan-2.7.0.jar serializer-2.7.0.jar commons-logging-1.0.4.jar jai_codec.jar jai_core.jar batik-ext.jar jai_imageio-1.1-sources.jar Thanks Rob for the help Rob Sargent-4 wrote: I suspect running from your jar does not have/use the same classpath that is in effect while you're in the debugger. By what mechanism do you generate the jar? Is it an executable jar or are you running java -classpath your-jar-here:other-jars Main? Make your IDE (netbeans) display the classpath it uses to run your app and compare that with the above. On 06/09/2011 07:21 PM, Oscar.Flores wrote: aaa ok well my problem is that when i do the pdf in netbean the pdf is fine with images and evething but when i run the jar file in command it give me a error GRAVE: Error while processing image: I:\cfd\rfc.jpg (image/jpeg) org.apache.xmlgraphics.image.loader.ImageException: Cannot load image (no suitable loader/converter combination available) for I:\cfd\rfc.jpg (image/jpeg) so i dont no what its not working and if i have to add something to my code so the images can load i am s desperate what i am doing wrong?? i am sorry for the trouble and if a dont explain my self very good jejeje Rob Sargent-4 wrote: Not at all sure what your problem is. All I can do is show you what works for us. Our source
Re: block-progression-dimension: how it works?
Hi Giuseppe, This is a FOP limitation, as you found out the hard way. FOP does not make use of the flexibility in block-progression-dimension to adjust the height of the block according to the content. It uses only the optimum value. Likewise for tables: a table row will only grow as much as necessary to accommodate all its content, but the potential slack will not be used. Sorry, Vincent On 23/05/11 12:49, Giuseppe Briotti wrote: No way in a more simple structure too: ?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=PM fo:region-body margin-top=20mm margin-left=20mm margin-right=20mm margin-bottom=20mm/ fo:region-before extent=20mm / fo:region-after extent=20mm / /fo:simple-page-master /fo:layout-master-set fo:page-sequence master-reference=PM fo:flow flow-name=xsl-region-body !-- block container for the whole table -- fo:block-container block-progression-dimension=20cm !-- first table row -- fo:block-container block-progression-dimension.minimum=2cm block-progression-dimension.optimum=6cm block-progression-dimension.maximum=9cm border=solid 1pt background-color=yellow fo:block fo:inline Blocco 1. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. /fo:inline /fo:block /fo:block-container !-- second row -- fo:block-container block-progression-dimension.minimum=2cm block-progression-dimension.optimum=8cm block-progression-dimension.maximum=9cm border=solid 1pt fo:block fo:inline Blocco 2. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Blocco 2. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. /fo:inline /fo:block /fo:block-container !-- last row -- fo:block-container block-progression-dimension.minimum=2cm block-progression-dimension.optimum=6cm block-progression-dimension.maximum=9cm border=solid 1pt background-color=yellow fo:blockfo:inline Blocco 3. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit
Text fill color in external SVG is not preserved
Hello Everyone, I use external graphics (SVG) in my FO document and when it is processed with FOP, color definition of some texts is ignored (they are black in the output). I can see the correct result in common browsers as well as in the Batik Squiggle utility. I think it is somehow connected to the transformation. Especially it happens at third sibling of the same group. Reduced SVG test case with FO file and final FOP output can be found at http://hroska.cz/other/test_case_fill.zip I use Fop - nightly build on Win7/64 bit + Java 6. All the a, b, c, d labels should be red (first two are red, the rest is black) All the Text (1, 2, 3) should be white (first two are white, the third is black) Is there any workaround? Regards, Jan - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Text Overflows into adjacent cell
Hi, I am upgrading fop from .25 to .95 and facing the below issue. Please help. 1. I have fo:block hyphenate=true wrap-option='wrap' fo:table-cell keep-together.within-column=always case 1 : Long text with space behaves properly (text wrapped properly inside the cell) eg : Really Really Long Text With WhiteSpace Case 2: Long text with No white space like eg: ReallyReallyLongTextNoWhiteSpace then the text flows- overlaps the next column. Please help with my issue. Thanks, Chetan V S - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Problems with FOP and image
ok well i put the xml in scr of my proyect i see that i still have the same issues of the image render of any image i dont now if the xml its in place i put the code down to see if something its missing 15:45:07,827 ERROR [render] Error while processing image: c:\cfd\nombregp.bmp (i mage/bmp) org.apache.xmlgraphics.image.loader.ImageException: Cannot load image (no suitab le loader/converter combination available) for c:\cfd\nombregp.bmp (image/bmp) at org.apache.xmlgraphics.image.loader.ImageManager.getImage(ImageManage import mx.bigdata.sat.cfd.schema.Comprobante; import mx.bigdata.sat.cfd.CFDv2; import mx.bigdata.sat.security.KeyLoader; import org.jdom.*; import org.jdom.input.SAXBuilder; import org.jdom.output.XMLOutputter; import org.jdom.output.Format; import org.jdom.transform.JDOMSource; //Java import java.io.File; import java.io.OutputStream; //JAXP import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.Source; import javax.xml.transform.Result; import javax.xml.transform.stream.StreamSource; import javax.xml.transform.sax.SAXResult; //FOP import org.apache.fop.apps.FOUserAgent; import org.apache.fop.apps.Fop; import org.apache.fop.apps.FopFactory; import org.apache.fop.apps.MimeConstants; //log4j import org.apache.log4j.*; import org.apache.log4j.xml.DOMConfigurator; public final class Main { @SuppressWarnings(unchecked) static Logger logger = Logger.getLogger(Main.class); public static void main(String[] args) throws Exception { DOMConfigurator.configure(D:/Mis documentos/NetBeansProjects/Factura/src/factura/log4j.xml); logger.info(Entering application.); try { File file = new File(args[0]); Comprobante comp = CFDv2.newComprobante(new FileInputStream(file)); CFDv2 cfd = new CFDv2(comp); PrivateKey key = KeyLoader.loadPKCS8PrivateKey(new FileInputStream(args[1]),(args[2])); X509Certificate cert = KeyLoader.loadX509Certificate(new FileInputStream(args[3])); Comprobante sellado = cfd.sellarComprobante(key, cert); String cadena = cfd.getCadenaOriginal(); String sello = sellado.getSello(); // Creamos el builder basado en SAX SAXBuilder builder = new SAXBuilder(); // Construimos el arbol DOM a partir del fichero xml Document documentJDOM = builder.build(new FileInputStream(args[0])); Element raiz = documentJDOM.getRootElement();//toma el nodo raiz del documento. raiz.setAttribute(sello, sello); raiz.setAttribute(certificado, sellado.getCertificado()); //System.out.println(raiz.getAttributeValue(sello)); //System.out.println(raiz.getAttributeValue(certificado)); // Recorremos los hijos de la etiqueta raíz ListElement hijosRaiz = raiz.getChildren(); boolean Bandera=false; for(Element hijo: hijosRaiz) { // Obtenemos el nombre y su contenido de tipo texto String nombre = hijo.getName(); if (nombre.equals(Addenda)) { ListElement subHijo = hijo.getChildren(); for(Element hij: subHijo) { hij.setAttribute(CadenaOriginal, cadena); //System.out.println(CadenaOriginal: +hij.getAttributeValue(CadenaOriginal)); Bandera=true; break; } } if (Bandera) { XMLOutputter out = new XMLOutputter(Format.getPrettyFormat()); File nuevoXML = new File(args[0]); try{ FileOutputStream archivoXML= new FileOutputStream (nuevoXML); out.output(documentJDOM, archivoXML); } catch (Exception ex){System.out.println(ex.getMessage());} // Para generar el pdf a partir de un archivo.xsl y un // archivo.xml } } // configure fopFactory as desired FopFactory fopFactory = FopFactory.newInstance(); FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); // configure foUserAgent as desired // Setup output File pdffile = new File(args[5]); OutputStream out = new java.io.FileOutputStream(pdffile); out = new java.io.BufferedOutputStream(out); try { // Construct fop with desired output format Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out); // Setup XSLT TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer =
Re: How to determine which block are fo:table-row from XML-AT output?
On 13 Jun 2011, at 12:05, Vincent Hennebert wrote: On 10/06/11 18:32, Andreas L. Delmelle wrote: The area tree XML stores the specified id as a prod-id attribute. There can definitely be multiple areas with the same prod-id, as a block can be broken over multiple columns or pages. Since prod-id is FOP proprietary anyway, I don't immediately see anything against a convention of allowing this to be a separated list of producer-ids. Section 6.1.1 of the XSL-FO 1.1 Recommendation [1] mentions the ‘generated-by’ and ‘returned-by’ traits that XSL-FO processors are supposed to create, and that would probably prove handy in such situations. [1] http://www.w3.org/TR/xsl11/#define-returned-by Interesting catch! Yep, generated-by almost seems synonymous to the current prod-id, if we substitute the 'formatting object' with its 'id'. Granted, we do not auto-generate ids just yet... For the returned-by trait, in order to be able to serialize/externalize it, there is obviously the question of the format for the separator. Have to make sure to point out to users that they should preferably not use those (sequences of) characters in values for the 'id' property, if they use the AT or IF formats. Or at least, make the implementation robust enough to account for the (remote) possibility of brackets and commas appearing in an ID. Regards Andreas --- - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Text Overflows into adjacent cell
On 13 Jun 2011, at 22:53, Chetan Shirol wrote: Hi Chetan I am upgrading fop from .25 to .95 and facing the below issue. Please help. snip / Case 2: Long text with No white space like eg: ReallyReallyLongTextNoWhiteSpace then the text flows- overlaps the next column. FOP implements Unicode line-breaking rules, and those do not allow to break the sample text fragment anywhere. The usually suggested workaround is to alter the stylesheet, so that ZWSPs (U+200B) are inserted that give FOP a chance to break. So, you should get the equivalent of: R#x200B;e#x200B;a#x200B;l#x200B;l#x200B;y... That will effectively lead to a 'wrapping' effect, i.e. FOP will place as many characters as possible in a line, and break at the next ZWSP. This is currently the only around this, AFAIK. Hope this helps! Regards Andreas --- - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Problems with FOP and image
Then it seems to me netbeans (if it's producing good output == assumptionA) is still using something that the command-line isn't. And given assumptionA, you're java code is correct in terms of FOP and your configuration isn't for ImageIO. Show your ImageIO related code and are you sure it's in your app. Use the logger to show a message when you add your loader. Or list all ImageIO services: IIORegistry.getServiceProviders() On 06/13/2011 03:01 PM, Oscar.Flores wrote: ok well i put the xml in scr of my proyect i see that i still have the same issues of the image render of any image i dont now if the xml its in place i put the code down to see if something its missing 15:45:07,827 ERROR [render] Error while processing image: c:\cfd\nombregp.bmp (i mage/bmp) org.apache.xmlgraphics.image.loader.ImageException: Cannot load image (no suitab le loader/converter combination available) for c:\cfd\nombregp.bmp (image/bmp) at org.apache.xmlgraphics.image.loader.ImageManager.getImage(ImageManage import mx.bigdata.sat.cfd.schema.Comprobante; import mx.bigdata.sat.cfd.CFDv2; import mx.bigdata.sat.security.KeyLoader; import org.jdom.*; import org.jdom.input.SAXBuilder; import org.jdom.output.XMLOutputter; import org.jdom.output.Format; import org.jdom.transform.JDOMSource; //Java import java.io.File; import java.io.OutputStream; //JAXP import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.Source; import javax.xml.transform.Result; import javax.xml.transform.stream.StreamSource; import javax.xml.transform.sax.SAXResult; //FOP import org.apache.fop.apps.FOUserAgent; import org.apache.fop.apps.Fop; import org.apache.fop.apps.FopFactory; import org.apache.fop.apps.MimeConstants; //log4j import org.apache.log4j.*; import org.apache.log4j.xml.DOMConfigurator; public final class Main { @SuppressWarnings(unchecked) static Logger logger = Logger.getLogger(Main.class); public static void main(String[] args) throws Exception { DOMConfigurator.configure(D:/Mis documentos/NetBeansProjects/Factura/src/factura/log4j.xml); logger.info(Entering application.); try { File file = new File(args[0]); Comprobante comp = CFDv2.newComprobante(new FileInputStream(file)); CFDv2 cfd = new CFDv2(comp); PrivateKey key = KeyLoader.loadPKCS8PrivateKey(new FileInputStream(args[1]),(args[2])); X509Certificate cert = KeyLoader.loadX509Certificate(new FileInputStream(args[3])); Comprobante sellado = cfd.sellarComprobante(key, cert); String cadena = cfd.getCadenaOriginal(); String sello = sellado.getSello(); // Creamos el builder basado en SAX SAXBuilder builder = new SAXBuilder(); // Construimos el arbol DOM a partir del fichero xml Document documentJDOM = builder.build(new FileInputStream(args[0])); Element raiz = documentJDOM.getRootElement();//toma el nodo raiz del documento. raiz.setAttribute(sello, sello); raiz.setAttribute(certificado, sellado.getCertificado()); //System.out.println(raiz.getAttributeValue(sello)); //System.out.println(raiz.getAttributeValue(certificado)); // Recorremos los hijos de la etiqueta raíz ListElement hijosRaiz = raiz.getChildren(); boolean Bandera=false; for(Element hijo: hijosRaiz) { // Obtenemos el nombre y su contenido de tipo texto String nombre = hijo.getName(); if (nombre.equals(Addenda)) { ListElement subHijo = hijo.getChildren(); for(Element hij: subHijo) { hij.setAttribute(CadenaOriginal, cadena); //System.out.println(CadenaOriginal: +hij.getAttributeValue(CadenaOriginal)); Bandera=true; break; } } if (Bandera) { XMLOutputter out = new XMLOutputter(Format.getPrettyFormat()); File nuevoXML = new File(args[0]); try{ FileOutputStream archivoXML= new FileOutputStream (nuevoXML); out.output(documentJDOM, archivoXML); } catch (Exception ex){System.out.println(ex.getMessage());} // Para generar el pdf a partir de un archivo.xsl y un // archivo.xml } } // configure fopFactory as desired FopFactory fopFactory = FopFactory.newInstance(); FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); // configure
Re: Text fill color in external SVG is not preserved
On 13 Jun 2011, at 21:50, honyk wrote: Hi Jan I use external graphics (SVG) in my FO document and when it is processed with FOP, color definition of some texts is ignored (they are black in the output). I can see the correct result in common browsers as well as in the Batik Squiggle utility. I think it is somehow connected to the transformation. Especially it happens at third sibling of the same group. Reduced SVG test case with FO file and final FOP output can be found at http://hroska.cz/other/test_case_fill.zip I use Fop - nightly build on Win7/64 bit + Java 6. Strange indeed. Thanks for the test case. I can confirm the issue on OS X / Java 6. I did a quick debug in o.a.f.svg.NativeTextPainter, and watching the GlyphVectors' TextPaintInfos, the fillPaint seems to be correct for all TextRuns. I do not have the time to dig deeper right now, but this definitely looks like a bug. Would you mind entering a Bugzilla report(*), and attaching your test case there, so we do not lose track of it? Thanks! (*) https://issues.apache.org/bugzilla/enter_bug.cgi?product=Fop All the a, b, c, d labels should be red (first two are red, the rest is black) All the Text (1, 2, 3) should be white (first two are white, the third is black) Is there any workaround? None that I know of... Anyone? Regards Andreas --- - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Problems with FOP and image
Ok i get it, actually the ImageIO library i added because i read in the xmlgrapics that if something like the message org.apache.xmlgraphics.image.loader.ImageException: Cannot load image (no suitable loader/converter combination available)appear i have to add the jar file to the classpath but that all it say no configuration or anything, then i delete the imagenIO libs and still i have the same output in netbeans so xmlgrapics seem to have the problem in the plugins or i have to configure something Rob Sargent-4 wrote: Then it seems to me netbeans (if it's producing good output == assumptionA) is still using something that the command-line isn't. And given assumptionA, you're java code is correct in terms of FOP and your configuration isn't for ImageIO. Show your ImageIO related code and are you sure it's in your app. Use the logger to show a message when you add your loader. Or list all ImageIO services: IIORegistry.getServiceProviders() On 06/13/2011 03:01 PM, Oscar.Flores wrote: ok well i put the xml in scr of my proyect i see that i still have the same issues of the image render of any image i dont now if the xml its in place i put the code down to see if something its missing 15:45:07,827 ERROR [render] Error while processing image: c:\cfd\nombregp.bmp (i mage/bmp) org.apache.xmlgraphics.image.loader.ImageException: Cannot load image (no suitab le loader/converter combination available) for c:\cfd\nombregp.bmp (image/bmp) at org.apache.xmlgraphics.image.loader.ImageManager.getImage(ImageManage import mx.bigdata.sat.cfd.schema.Comprobante; import mx.bigdata.sat.cfd.CFDv2; import mx.bigdata.sat.security.KeyLoader; import org.jdom.*; import org.jdom.input.SAXBuilder; import org.jdom.output.XMLOutputter; import org.jdom.output.Format; import org.jdom.transform.JDOMSource; //Java import java.io.File; import java.io.OutputStream; //JAXP import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.Source; import javax.xml.transform.Result; import javax.xml.transform.stream.StreamSource; import javax.xml.transform.sax.SAXResult; //FOP import org.apache.fop.apps.FOUserAgent; import org.apache.fop.apps.Fop; import org.apache.fop.apps.FopFactory; import org.apache.fop.apps.MimeConstants; //log4j import org.apache.log4j.*; import org.apache.log4j.xml.DOMConfigurator; public final class Main { @SuppressWarnings(unchecked) static Logger logger = Logger.getLogger(Main.class); public static void main(String[] args) throws Exception { DOMConfigurator.configure(D:/Mis documentos/NetBeansProjects/Factura/src/factura/log4j.xml); logger.info(Entering application.); try { File file = new File(args[0]); Comprobante comp = CFDv2.newComprobante(new FileInputStream(file)); CFDv2 cfd = new CFDv2(comp); PrivateKey key = KeyLoader.loadPKCS8PrivateKey(new FileInputStream(args[1]),(args[2])); X509Certificate cert = KeyLoader.loadX509Certificate(new FileInputStream(args[3])); Comprobante sellado = cfd.sellarComprobante(key, cert); String cadena = cfd.getCadenaOriginal(); String sello = sellado.getSello(); // Creamos el builder basado en SAX SAXBuilder builder = new SAXBuilder(); // Construimos el arbol DOM a partir del fichero xml Document documentJDOM = builder.build(new FileInputStream(args[0])); Element raiz = documentJDOM.getRootElement();//toma el nodo raiz del documento. raiz.setAttribute(sello, sello); raiz.setAttribute(certificado, sellado.getCertificado()); //System.out.println(raiz.getAttributeValue(sello)); //System.out.println(raiz.getAttributeValue(certificado)); // Recorremos los hijos de la etiqueta raíz ListElement hijosRaiz = raiz.getChildren(); boolean Bandera=false; for(Element hijo: hijosRaiz) { // Obtenemos el nombre y su contenido de tipo texto String nombre = hijo.getName(); if (nombre.equals(Addenda)) { ListElement subHijo = hijo.getChildren(); for(Element hij: subHijo) { hij.setAttribute(CadenaOriginal, cadena); //System.out.println(CadenaOriginal: +hij.getAttributeValue(CadenaOriginal)); Bandera=true; break; } } if (Bandera) { XMLOutputter out = new XMLOutputter(Format.getPrettyFormat()); File nuevoXML = new
Re: Problems with FOP and image
I'm not sure I'm following correctly: does removing the xmlgraphics jar cause netbeans to behave the same as the command-line run of you app? If so, I suspect netbeans is registering services for you. Your own code will have to make a call to one of the IIORegistry.registerServiceProvider() methods. On 06/13/2011 05:02 PM, Oscar.Flores wrote: Ok i get it, actually the ImageIO library i added because i read in the xmlgrapics that if something like the message org.apache.xmlgraphics.image.loader.ImageException: Cannot load image (no suitable loader/converter combination available)appear i have to add the jar file to the classpath but that all it say no configuration or anything, then i delete the imagenIO libs and still i have the same output in netbeans so xmlgrapics seem to have the problem in the plugins or i have to configure something Rob Sargent-4 wrote: Then it seems to me netbeans (if it's producing good output == assumptionA) is still using something that the command-line isn't. And given assumptionA, you're java code is correct in terms of FOP and your configuration isn't for ImageIO. Show your ImageIO related code and are you sure it's in your app. Use the logger to show a message when you add your loader. Or list all ImageIO services: IIORegistry.getServiceProviders() On 06/13/2011 03:01 PM, Oscar.Flores wrote: ok well i put the xml in scr of my proyect i see that i still have the same issues of the image render of any image i dont now if the xml its in place i put the code down to see if something its missing 15:45:07,827 ERROR [render] Error while processing image: c:\cfd\nombregp.bmp (i mage/bmp) org.apache.xmlgraphics.image.loader.ImageException: Cannot load image (no suitab le loader/converter combination available) for c:\cfd\nombregp.bmp (image/bmp) at org.apache.xmlgraphics.image.loader.ImageManager.getImage(ImageManage import mx.bigdata.sat.cfd.schema.Comprobante; import mx.bigdata.sat.cfd.CFDv2; import mx.bigdata.sat.security.KeyLoader; import org.jdom.*; import org.jdom.input.SAXBuilder; import org.jdom.output.XMLOutputter; import org.jdom.output.Format; import org.jdom.transform.JDOMSource; //Java import java.io.File; import java.io.OutputStream; //JAXP import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.Source; import javax.xml.transform.Result; import javax.xml.transform.stream.StreamSource; import javax.xml.transform.sax.SAXResult; //FOP import org.apache.fop.apps.FOUserAgent; import org.apache.fop.apps.Fop; import org.apache.fop.apps.FopFactory; import org.apache.fop.apps.MimeConstants; //log4j import org.apache.log4j.*; import org.apache.log4j.xml.DOMConfigurator; public final class Main { @SuppressWarnings(unchecked) static Logger logger = Logger.getLogger(Main.class); public static void main(String[] args) throws Exception { DOMConfigurator.configure(D:/Mis documentos/NetBeansProjects/Factura/src/factura/log4j.xml); logger.info(Entering application.); try { File file = new File(args[0]); Comprobante comp = CFDv2.newComprobante(new FileInputStream(file)); CFDv2 cfd = new CFDv2(comp); PrivateKey key = KeyLoader.loadPKCS8PrivateKey(new FileInputStream(args[1]),(args[2])); X509Certificate cert = KeyLoader.loadX509Certificate(new FileInputStream(args[3])); Comprobante sellado = cfd.sellarComprobante(key, cert); String cadena = cfd.getCadenaOriginal(); String sello = sellado.getSello(); // Creamos el builder basado en SAX SAXBuilder builder = new SAXBuilder(); // Construimos el arbol DOM a partir del fichero xml Document documentJDOM = builder.build(new FileInputStream(args[0])); Element raiz = documentJDOM.getRootElement();//toma el nodo raiz del documento. raiz.setAttribute(sello, sello); raiz.setAttribute(certificado, sellado.getCertificado()); //System.out.println(raiz.getAttributeValue(sello)); //System.out.println(raiz.getAttributeValue(certificado)); // Recorremos los hijos de la etiqueta raíz ListElement hijosRaiz = raiz.getChildren(); boolean Bandera=false; for(Element hijo: hijosRaiz) { // Obtenemos el nombre y su contenido de tipo texto String nombre = hijo.getName(); if (nombre.equals(Addenda)) { ListElement subHijo = hijo.getChildren(); for(Element hij: subHijo) { hij.setAttribute(CadenaOriginal, cadena); //System.out.println(CadenaOriginal: +hij.getAttributeValue(CadenaOriginal));
Re: Problems with FOP and image
ok i made a test and tell me that the class is missign but maybe what you say its rigth and it register the handler so i gonna register the services so i do this public static void main(String[] args) throws Exception { DOMConfigurator.configure(D:/Mis documentos/NetBeansProjects/Factura/src/factura/log4j.xml); logger.info(Entering application.); IIORegistry.getDefaultInstance().registerServiceProvider(new CLibJPEGImageReaderSpi()); IIORegistry.getDefaultInstance().registerServiceProvider(new CLibJPEGImageWriterSpi()); also after register my services it telling me that the class CLibJPEGImageReaderSpi() and CLibJPEGImageWriterSpi() is missing but only in command after register mi service, something more has to be done?? Rob Sargent-4 wrote: I'm not sure I'm following correctly: does removing the xmlgraphics jar cause netbeans to behave the same as the command-line run of you app? If so, I suspect netbeans is registering services for you. Your own code will have to make a call to one of the IIORegistry.registerServiceProvider() methods. On 06/13/2011 05:02 PM, Oscar.Flores wrote: Ok i get it, actually the ImageIO library i added because i read in the xmlgrapics that if something like the message org.apache.xmlgraphics.image.loader.ImageException: Cannot load image (no suitable loader/converter combination available)appear i have to add the jar file to the classpath but that all it say no configuration or anything, then i delete the imagenIO libs and still i have the same output in netbeans so xmlgrapics seem to have the problem in the plugins or i have to configure something Rob Sargent-4 wrote: Then it seems to me netbeans (if it's producing good output == assumptionA) is still using something that the command-line isn't. And given assumptionA, you're java code is correct in terms of FOP and your configuration isn't for ImageIO. Show your ImageIO related code and are you sure it's in your app. Use the logger to show a message when you add your loader. Or list all ImageIO services: IIORegistry.getServiceProviders() On 06/13/2011 03:01 PM, Oscar.Flores wrote: ok well i put the xml in scr of my proyect i see that i still have the same issues of the image render of any image i dont now if the xml its in place i put the code down to see if something its missing 15:45:07,827 ERROR [render] Error while processing image: c:\cfd\nombregp.bmp (i mage/bmp) org.apache.xmlgraphics.image.loader.ImageException: Cannot load image (no suitab le loader/converter combination available) for c:\cfd\nombregp.bmp (image/bmp) at org.apache.xmlgraphics.image.loader.ImageManager.getImage(ImageManage import mx.bigdata.sat.cfd.schema.Comprobante; import mx.bigdata.sat.cfd.CFDv2; import mx.bigdata.sat.security.KeyLoader; import org.jdom.*; import org.jdom.input.SAXBuilder; import org.jdom.output.XMLOutputter; import org.jdom.output.Format; import org.jdom.transform.JDOMSource; //Java import java.io.File; import java.io.OutputStream; //JAXP import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.Source; import javax.xml.transform.Result; import javax.xml.transform.stream.StreamSource; import javax.xml.transform.sax.SAXResult; //FOP import org.apache.fop.apps.FOUserAgent; import org.apache.fop.apps.Fop; import org.apache.fop.apps.FopFactory; import org.apache.fop.apps.MimeConstants; //log4j import org.apache.log4j.*; import org.apache.log4j.xml.DOMConfigurator; public final class Main { @SuppressWarnings(unchecked) static Logger logger = Logger.getLogger(Main.class); public static void main(String[] args) throws Exception { DOMConfigurator.configure(D:/Mis documentos/NetBeansProjects/Factura/src/factura/log4j.xml); logger.info(Entering application.); try { File file = new File(args[0]); Comprobante comp = CFDv2.newComprobante(new FileInputStream(file)); CFDv2 cfd = new CFDv2(comp); PrivateKey key = KeyLoader.loadPKCS8PrivateKey(new FileInputStream(args[1]),(args[2])); X509Certificate cert = KeyLoader.loadX509Certificate(new FileInputStream(args[3])); Comprobante sellado = cfd.sellarComprobante(key, cert); String cadena = cfd.getCadenaOriginal(); String sello = sellado.getSello(); // Creamos el builder basado en SAX SAXBuilder builder = new SAXBuilder(); // Construimos el arbol DOM a partir del fichero xml Document documentJDOM = builder.build(new FileInputStream(args[0])); Element raiz = documentJDOM.getRootElement();//toma el nodo raiz del documento. raiz.setAttribute(sello, sello);
Re: Text fill color in external SVG is not preserved
Hi Jan, I use external graphics (SVG) in my FO document and when it is processed with FOP, color definition of some texts is ignored (they are black in the output). I can see the correct result in common browsers as well as in the Batik Squiggle utility. I think it is somehow connected to the transformation. Especially it happens at third sibling of the same group. Reduced SVG test case with FO file and final FOP output can be found at http://hroska.cz/other/test_case_fill.zip I use Fop - nightly build on Win7/64 bit + Java 6. All the a, b, c, d labels should be red (first two are red, the rest is black) All the Text (1, 2, 3) should be white (first two are white, the third is black) I believe this issue is caused by the commit of rev 1095887. I've already reported to the commiter (Jeremias) which, I think, is working on a fix. But you might want to create a bugzilla entry anyway as Andreas suggested. Is there any workaround? If you are familiar with svn und building FOP, you can locally undo the change from the mentioned revision and just re-build FOP. Best regards, Matthias Reischenbacher - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Problems with FOP and image
Some jar to which netbeans has access has those classes. Look in the output of jar tvf each of your jars and see if any of those has the named classes. If you find a jar with those classes make sure it's part of your classpath for you app. Are you making any calls like ImageIO.write(BufferedImage, JPEG, jpegImageFile)? On 06/13/2011 05:31 PM, Oscar.Flores wrote: ok i made a test and tell me that the class is missign but maybe what you say its rigth and it register the handler so i gonna register the services so i do this public static void main(String[] args) throws Exception { DOMConfigurator.configure(D:/Mis documentos/NetBeansProjects/Factura/src/factura/log4j.xml); logger.info(Entering application.); IIORegistry.getDefaultInstance().registerServiceProvider(new CLibJPEGImageReaderSpi()); IIORegistry.getDefaultInstance().registerServiceProvider(new CLibJPEGImageWriterSpi()); also after register my services it telling me that the class CLibJPEGImageReaderSpi() and CLibJPEGImageWriterSpi() is missing but only in command after register mi service, something more has to be done?? Rob Sargent-4 wrote: I'm not sure I'm following correctly: does removing the xmlgraphics jar cause netbeans to behave the same as the command-line run of you app? If so, I suspect netbeans is registering services for you. Your own code will have to make a call to one of the IIORegistry.registerServiceProvider() methods. On 06/13/2011 05:02 PM, Oscar.Flores wrote: Ok i get it, actually the ImageIO library i added because i read in the xmlgrapics that if something like the message org.apache.xmlgraphics.image.loader.ImageException: Cannot load image (no suitable loader/converter combination available)appear i have to add the jar file to the classpath but that all it say no configuration or anything, then i delete the imagenIO libs and still i have the same output in netbeans so xmlgrapics seem to have the problem in the plugins or i have to configure something Rob Sargent-4 wrote: Then it seems to me netbeans (if it's producing good output == assumptionA) is still using something that the command-line isn't. And given assumptionA, you're java code is correct in terms of FOP and your configuration isn't for ImageIO. Show your ImageIO related code and are you sure it's in your app. Use the logger to show a message when you add your loader. Or list all ImageIO services: IIORegistry.getServiceProviders() On 06/13/2011 03:01 PM, Oscar.Flores wrote: ok well i put the xml in scr of my proyect i see that i still have the same issues of the image render of any image i dont now if the xml its in place i put the code down to see if something its missing 15:45:07,827 ERROR [render] Error while processing image: c:\cfd\nombregp.bmp (i mage/bmp) org.apache.xmlgraphics.image.loader.ImageException: Cannot load image (no suitab le loader/converter combination available) for c:\cfd\nombregp.bmp (image/bmp) at org.apache.xmlgraphics.image.loader.ImageManager.getImage(ImageManage import mx.bigdata.sat.cfd.schema.Comprobante; import mx.bigdata.sat.cfd.CFDv2; import mx.bigdata.sat.security.KeyLoader; import org.jdom.*; import org.jdom.input.SAXBuilder; import org.jdom.output.XMLOutputter; import org.jdom.output.Format; import org.jdom.transform.JDOMSource; //Java import java.io.File; import java.io.OutputStream; //JAXP import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.Source; import javax.xml.transform.Result; import javax.xml.transform.stream.StreamSource; import javax.xml.transform.sax.SAXResult; //FOP import org.apache.fop.apps.FOUserAgent; import org.apache.fop.apps.Fop; import org.apache.fop.apps.FopFactory; import org.apache.fop.apps.MimeConstants; //log4j import org.apache.log4j.*; import org.apache.log4j.xml.DOMConfigurator; public final class Main { @SuppressWarnings(unchecked) static Logger logger = Logger.getLogger(Main.class); public static void main(String[] args) throws Exception { DOMConfigurator.configure(D:/Mis documentos/NetBeansProjects/Factura/src/factura/log4j.xml); logger.info(Entering application.); try { File file = new File(args[0]); Comprobante comp = CFDv2.newComprobante(new FileInputStream(file)); CFDv2 cfd = new CFDv2(comp); PrivateKey key = KeyLoader.loadPKCS8PrivateKey(new FileInputStream(args[1]),(args[2])); X509Certificate cert = KeyLoader.loadX509Certificate(new FileInputStream(args[3])); Comprobante sellado = cfd.sellarComprobante(key, cert); String cadena = cfd.getCadenaOriginal(); String sello = sellado.getSello(); // Creamos el builder basado en SAX SAXBuilder builder = new SAXBuilder();