RE: Hair ripping time
Yes but its jumping out from the line Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,useragent,out); So if I am stepping through the code, I hit that line, press F8 for step over , and its on the finally So the code is jumping from that line all the way out missing all the other lines and not getting caught even though I am trying to catch every exception (to try and debug this - not as a normal thing btw) With catch (Exception ex) Kindest regards Theresa Forster Senior Software Developer -Original Message- From: Rob Sargent [mailto:rsarg...@xmission.com] Sent: 03 June 2011 18:07 To: fop-users@xmlgraphics.apache.org Subject: Re: Hair ripping time That print statement will always be called since it's in the finally block. On 06/03/2011 09:27 AM, Theresa Jayne Forster wrote: This makes no sense its crashing out with no error on this line Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,useragent,out); And it jumps straight to System.out.print(*); The code I am using is as follows public File generatePDFFromXml(File xslFile,File xmlFile) { FopFactory fopFactory = FopFactory.newInstance(); BufferedOutputStream out = null; File tempFile = null; try { fopFactory.setStrictValidation(false); DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder(); Configuration cfg = cfgBuilder.buildFromFile(new File(fopconfig.xml)); fopFactory.setUserConfig(cfg); tempFile = File.createTempFile(W2P, .pdf); out = new BufferedOutputStream(new FileOutputStream(tempFile)); FOUserAgent useragent= fopFactory.newFOUserAgent(); useragent.setOutputFile(tempFile); useragent.setTargetResolution(300); Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,useragent,out); TransformerFactory factory = TransformerFactory.newInstance(); Source xslt = new StreamSource(xslFile); Transformer transformer = factory.newTransformer(xslt); Source src = new StreamSource(xmlFile); Result res = new SAXResult(fop.getDefaultHandler()); transformer.transform(src, res); out.flush(); out.close(); System.out.println(Output File = +tempFile.getAbsolutePath()); } catch (TransformerConfigurationException ex) { ex.printStackTrace(); } catch (TransformerException ex) { ex.printStackTrace(); } catch (FOPException ex) { ex.printStackTrace(); } catch (FileNotFoundException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } catch (Exception ex) { ex.printStackTrace(); } finally { try { System.out.print(*); out.close(); } catch (IOException ex) { } } return tempFile; } Kindest regards Theresa Forster Senior Software Developer ther...@inbrand.co.uk www.inbrand.co.uk Tel: 01483 266500 IMPORTANT NOTE: This transmission has been sent by or on behalf of In Brand Software Ltd. The information in this transmission is for the intended addressee only and is confidential to that intended addressee. If either you know or you ought reasonably to conclude that you are not, or may not be, the intended addressee, you are hereby given notice that any unauthorised dissemination or copying of this transmission and any disclosure or use of the information transmitted is strictly prohibited and may be illegal. In such circumstances we ask for your assistance in notifying us immediately by e-mail, telephone or letter. InBrand Software Ltd Registered in England No. 5131004 Registered Office: The Old Barn, Ewhurst Road, Cranleigh GU6 7EF -Original Message- From: Theresa Jayne Forster [mailto:ther...@inbrand.co.uk] Sent: 03 June 2011 15:42 To: fop-users@xmlgraphics.apache.org Subject: RE: Hair ripping time Tried that same result, it jumps immediately out of the try catch into the finally Kindest regards Theresa Forster Senior Software Developer Seems like you need: Transformer transformer = factory.newTransformer(); transformer.transform(new StreamSource(inputFO)); HTH! Regards Andreas --- - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1375 / Virus Database: 1509/3662 - Release Date: 05/26/11 Internal Virus Database is out of date. - To unsubscribe, e-mail:
RE: Hair ripping time
Thanks for that, it has improved my debugging but it seems to be implying an issue with FOP java.lang.NoSuchMethodError: org.apache.commons.io.filefilter.FileFilterUtils.fileFileFilter()Lorg/apache /commons/io/filefilter/IOFileFilter; at org.apache.fop.fonts.autodetect.FontFileFinder.getFileFilter(FontFileFinder. java:79) at org.apache.fop.fonts.autodetect.FontFileFinder.init(FontFileFinder.java:52 ) at org.apache.fop.fonts.FontDetector.detect(FontDetector.java:69) at org.apache.fop.fonts.FontInfoConfigurator.configure(FontInfoConfigurator.jav a:92) Kindest regards Theresa Forster Senior Software Developer -Original Message- From: Andreas L. Delmelle [mailto:andreas.delme...@telenet.be] Sent: 03 June 2011 21:54 To: fop-users@xmlgraphics.apache.org Subject: Re: Hair ripping time On 03 Jun 2011, at 17:27, Theresa Jayne Forster wrote: Hi Theresa This makes no sense its crashing out with no error on this line Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,useragent,out); And it jumps straight to System.out.print(*); snip / } catch (TransformerConfigurationException ex) { ex.printStackTrace(); } catch (TransformerException ex) { ex.printStackTrace(); } catch (FOPException ex) { ex.printStackTrace(); } catch (FileNotFoundException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } catch (Exception ex) { ex.printStackTrace(); Not as a general practice, but if all else fails: } catch (Throwable t) { t.printStackTrace(); } Hopefully, that will reveal what is happening here. Regards Andreas --- - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1375 / Virus Database: 1509/3662 - Release Date: 05/26/11 Internal Virus Database is out of date. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Hair ripping time
Sounds like a possible classpath issue to me? Do you have commons-io-*.jar on your system? And if so, is it in your classpath? Does adding it to your classpath help? Thanks to a google search, http://javacio.us/search?q=org%2Fapache%2Fcommons%2Fio%2Ffilefilter%2FIOFileFilter+more%3Ajar_filesinline=true appears to point out which jars contain the file and where they can be retrieved from if required, although I have not tested the links. Thanks. -Mike On 06/06/11 09:25, Theresa Jayne Forster wrote: Thanks for that, it has improved my debugging but it seems to be implying an issue with FOP java.lang.NoSuchMethodError: org.apache.commons.io.filefilter.FileFilterUtils.fileFileFilter()Lorg/apache /commons/io/filefilter/IOFileFilter; at org.apache.fop.fonts.autodetect.FontFileFinder.getFileFilter(FontFileFinder. java:79) at org.apache.fop.fonts.autodetect.FontFileFinder.init(FontFileFinder.java:52 ) at org.apache.fop.fonts.FontDetector.detect(FontDetector.java:69) at org.apache.fop.fonts.FontInfoConfigurator.configure(FontInfoConfigurator.jav a:92) Kindest regards Theresa Forster Senior Software Developer Michael Rubin Developer T: +44 20 8238 7400 F: +44 20 8238 7401 mru...@thunderhead.com The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it. -Original Message- From: Andreas L. Delmelle [mailto:andreas.delme...@telenet.be] Sent: 03 June 2011 21:54 To: fop-users@xmlgraphics.apache.org Subject: Re: Hair ripping time On 03 Jun 2011, at 17:27, Theresa Jayne Forster wrote: Hi Theresa This makes no sense its crashing out with no error on this line Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,useragent,out); And it jumps straight to System.out.print(*); snip / } catch (TransformerConfigurationException ex) { ex.printStackTrace(); } catch (TransformerException ex) { ex.printStackTrace(); } catch (FOPException ex) { ex.printStackTrace(); } catch (FileNotFoundException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } catch (Exception ex) { ex.printStackTrace(); Not as a general practice, but if all else fails: } catch (Throwable t) { t.printStackTrace(); } Hopefully, that will reveal what is happening here. Regards Andreas --- - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1375 / Virus Database: 1509/3662 - Release Date: 05/26/11 Internal Virus Database is out of date. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: Hair ripping time
I am running it under Apache Tomcat but I also have commons-io-1.3.2.jar in the Netbeans Libraries folder and its ticked for export. Looking into the war file I think I see the problem though, it has both 1.1 and 1.3.2 of commons-io in the war so it could be a version clash... Time to find and remove all the 1.1 instances. Kindest regards Theresa Forster Senior Software Developer -Original Message- From: Michael Rubin [mailto:mru...@thunderhead.com] Sent: 06 June 2011 09:31 To: fop-users@xmlgraphics.apache.org Subject: Re: Hair ripping time Sounds like a possible classpath issue to me? Do you have commons-io-*.jar on your system? And if so, is it in your classpath? Does adding it to your classpath help? Thanks to a google search, http://javacio.us/search?q=org%2Fapache%2Fcommons%2Fio%2Ffilefilter%2FIOFileFilter+more%3Ajar_filesinline=true appears to point out which jars contain the file and where they can be retrieved from if required, although I have not tested the links. Thanks. -Mike On 06/06/11 09:25, Theresa Jayne Forster wrote: Thanks for that, it has improved my debugging but it seems to be implying an issue with FOP java.lang.NoSuchMethodError: org.apache.commons.io.filefilter.FileFilterUtils.fileFileFilter()Lorg/apache /commons/io/filefilter/IOFileFilter; at org.apache.fop.fonts.autodetect.FontFileFinder.getFileFilter(FontFileFinder. java:79) at org.apache.fop.fonts.autodetect.FontFileFinder.init(FontFileFinder.java:52 ) at org.apache.fop.fonts.FontDetector.detect(FontDetector.java:69) at org.apache.fop.fonts.FontInfoConfigurator.configure(FontInfoConfigurator.jav a:92) Kindest regards Theresa Forster Senior Software Developer Michael Rubin Developer T: +44 20 8238 7400 F: +44 20 8238 7401 mru...@thunderhead.com The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it. -Original Message- From: Andreas L. Delmelle [mailto:andreas.delme...@telenet.be] Sent: 03 June 2011 21:54 To: fop-users@xmlgraphics.apache.org Subject: Re: Hair ripping time On 03 Jun 2011, at 17:27, Theresa Jayne Forster wrote: Hi Theresa This makes no sense its crashing out with no error on this line Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,useragent,out); And it jumps straight to System.out.print(*); snip / } catch (TransformerConfigurationException ex) { ex.printStackTrace(); } catch (TransformerException ex) { ex.printStackTrace(); } catch (FOPException ex) { ex.printStackTrace(); } catch (FileNotFoundException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } catch (Exception ex) { ex.printStackTrace(); Not as a general practice, but if all else fails: } catch (Throwable t) { t.printStackTrace(); } Hopefully, that will reveal what is happening here. Regards Andreas --- - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1375 / Virus Database: 1509/3662 - Release Date: 05/26/11 Internal Virus Database is out of date. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1375 / Virus Database: 1509/3662 - Release Date: 05/26/11 Internal Virus Database is out of date. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: Hair ripping time
Ok Strange, I am running commons-io-1.4 now and its still not working but the fop I compiled up from source is using 1.3.1 so does that mean we are limited to 1.3.1 as there is missing functionality in the later versions? Kindest regards Theresa Forster Senior Software Developer ther...@inbrand.co.uk www.inbrand.co.uk Tel: 01483 266500 IMPORTANT NOTE: This transmission has been sent by or on behalf of In Brand Software Ltd. The information in this transmission is for the intended addressee only and is confidential to that intended addressee. If either you know or you ought reasonably to conclude that you are not, or may not be, the intended addressee, you are hereby given notice that any unauthorised dissemination or copying of this transmission and any disclosure or use of the information transmitted is strictly prohibited and may be illegal. In such circumstances we ask for your assistance in notifying us immediately by e-mail, telephone or letter. InBrand Software Ltd Registered in England No. 5131004 Registered Office: The Old Barn, Ewhurst Road, Cranleigh GU6 7EF -Original Message- From: Theresa Jayne Forster [mailto:ther...@inbrand.co.uk] Sent: 06 June 2011 09:48 To: fop-users@xmlgraphics.apache.org Subject: RE: Hair ripping time I am running it under Apache Tomcat but I also have commons-io-1.3.2.jar in the Netbeans Libraries folder and its ticked for export. Looking into the war file I think I see the problem though, it has both 1.1 and 1.3.2 of commons-io in the war so it could be a version clash... Time to find and remove all the 1.1 instances. Kindest regards Theresa Forster Senior Software Developer -Original Message- From: Michael Rubin [mailto:mru...@thunderhead.com] Sent: 06 June 2011 09:31 To: fop-users@xmlgraphics.apache.org Subject: Re: Hair ripping time Sounds like a possible classpath issue to me? Do you have commons-io-*.jar on your system? And if so, is it in your classpath? Does adding it to your classpath help? Thanks to a google search, http://javacio.us/search?q=org%2Fapache%2Fcommons%2Fio%2Ffilefilter%2FIOFileFilter+more%3Ajar_filesinline=true appears to point out which jars contain the file and where they can be retrieved from if required, although I have not tested the links. Thanks. -Mike On 06/06/11 09:25, Theresa Jayne Forster wrote: Thanks for that, it has improved my debugging but it seems to be implying an issue with FOP java.lang.NoSuchMethodError: org.apache.commons.io.filefilter.FileFilterUtils.fileFileFilter()Lorg/apache /commons/io/filefilter/IOFileFilter; at org.apache.fop.fonts.autodetect.FontFileFinder.getFileFilter(FontFileFinder. java:79) at org.apache.fop.fonts.autodetect.FontFileFinder.init(FontFileFinder.java:52 ) at org.apache.fop.fonts.FontDetector.detect(FontDetector.java:69) at org.apache.fop.fonts.FontInfoConfigurator.configure(FontInfoConfigurator.jav a:92) Kindest regards Theresa Forster Senior Software Developer Michael Rubin Developer T: +44 20 8238 7400 F: +44 20 8238 7401 mru...@thunderhead.com The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it. -Original Message- From: Andreas L. Delmelle [mailto:andreas.delme...@telenet.be] Sent: 03 June 2011 21:54 To: fop-users@xmlgraphics.apache.org Subject: Re: Hair ripping time On 03 Jun 2011, at 17:27, Theresa Jayne Forster wrote: Hi Theresa This makes no sense its crashing out with no error on this line Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,useragent,out); And it jumps straight to System.out.print(*); snip / } catch (TransformerConfigurationException ex) { ex.printStackTrace(); } catch (TransformerException ex) { ex.printStackTrace(); } catch (FOPException ex) { ex.printStackTrace(); } catch (FileNotFoundException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } catch (Exception ex) { ex.printStackTrace(); Not as a general practice, but if all else fails: } catch (Throwable t) { t.printStackTrace(); } Hopefully, that will reveal what is happening here. Regards Andreas --- - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1375 / Virus Database: 1509/3662 - Release Date: 05/26/11 Internal Virus Database is out of
RE: Hair ripping time
Ok, solution found, and I think this needs to be noted down, Using Netbeans, added Frameworks Spring Web MVC JavaServer Faces Struts 1.3.8 Hibernate 3.2.5 The problem is the struts, it comes with commons-io-1.1.jar and doesn’t have one of the methods in the font autodetect code that was implemented in 1.3.1 and up. So I had to go into the library defs in the struts framework and delete the 1.1 and replace it with the 1.3.1 and it now works fine. Kindest regards Theresa Forster Senior Software Developer -Original Message- From: Theresa Jayne Forster [mailto:ther...@inbrand.co.uk] Sent: 06 June 2011 10:54 To: fop-users@xmlgraphics.apache.org Subject: RE: Hair ripping time Sorry to keep posting but its strange and I am trying to understand, when I find something new I am also letting you know so old ground isn’t covered again. 1) Runs stand alone fine, 2) War file contains the commons-io file 3) Running under Tomcat 6 it fails with a Method not found error. 4) could it be due to Tomcat 6 having a different default commons-io in its build somewhere? And if so , where so I can upgrade it? Kindest regards Theresa Forster Senior Software Developer -Original Message- From: Theresa Jayne Forster [mailto:ther...@inbrand.co.uk] Sent: 06 June 2011 10:23 To: fop-users@xmlgraphics.apache.org Subject: RE: Hair ripping time Ok Strange, I am running commons-io-1.4 now and its still not working but the fop I compiled up from source is using 1.3.1 so does that mean we are limited to 1.3.1 as there is missing functionality in the later versions? Kindest regards Theresa Forster Senior Software Developer - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1382 / Virus Database: 1511/3683 - Release Date: 06/05/11 - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1382 / Virus Database: 1511/3683 - Release Date: 06/05/11 - 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
Yeah i think i need your help again i tried tu run the .jar file in the console it work but without images this it what appears 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) i tried download the jai-imagio add to the class path but it dont work Rob Sargent-4 wrote: Very odd. I'm having no problems getting images into pdfs using fop-1.0. On 06/03/2011 11:04 AM, Oscar.Flores wrote: aaa hey thanks for the help the other day, i resolve the problem changing the version of FOP for the 0.95beta instead of the 1.0, it works now it prints the image and its good, thanks and we are in touch if anything else fails jejeje Rob Sargent-4 wrote: Nothing in the log from the transformer? On 06/03/2011 09:47 AM, Oscar.Flores wrote: hi there i have another problem i hope you can help me the pdf that i create with foe has no image, it dont show any of them, the xsl seems to be rigth i tested with EditX and the pdf show me the image, what can it be, i have xmlgraphics-commons-1.5svn, fop 1.0, fop-pdf-images 2.0.1 Snapshot for the render of the image but it don work please help!!! :,( - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org -- View this message in context: http://old.nabble.com/Problems-with-FOP-and-image-tp31766430p31783943.html Sent from the FOP - Users mailing list archive at Nabble.com. - 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
See the javadoc on IIORegistry. With ImageIO you may have to register your handler(s). What does ImageIO.getImageReadersBySuffix() give you. For certain jpegs we don't use ImageIO, rather the classes in com.sun.image.codec.jpeg: try { FileOutputStream fos = new FileOutputStream(file); JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(fos); JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(image.getRaster(), JPEGDecodeParam.COLOR_ID_CMYK); param.setQuality(1, false); encoder.encode(image.getRaster(), param); fos.close(); } catch (Throwable t) { logger.debug(t.getMessage()); } But generally we use ImageIO On 06/06/2011 08:29 AM, Oscar.Flores wrote: Yeah i think i need your help again i tried tu run the .jar file in the console it work but without images this it what appears 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) i tried download the jai-imagio add to the class path but it dont work Rob Sargent-4 wrote: Very odd. I'm having no problems getting images into pdfs using fop-1.0. On 06/03/2011 11:04 AM, Oscar.Flores wrote: aaa hey thanks for the help the other day, i resolve the problem changing the version of FOP for the 0.95beta instead of the 1.0, it works now it prints the image and its good, thanks and we are in touch if anything else fails jejeje Rob Sargent-4 wrote: Nothing in the log from the transformer? On 06/03/2011 09:47 AM, Oscar.Flores wrote: hi there i have another problem i hope you can help me the pdf that i create with foe has no image, it dont show any of them, the xsl seems to be rigth i tested with EditX and the pdf show me the image, what can it be, i have xmlgraphics-commons-1.5svn, fop 1.0, fop-pdf-images 2.0.1 Snapshot for the render of the image but it don work please help!!! :,( - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - 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
Hi what can be the difference between execute the program in netbeans (where it works and print the images and the jar in the console) also i tried the imageIO.getImageReadersBySuffix but i cant interpretate the data y.y, its that or always its true in the boolean variable, and how can i register the handler?? Thanks Rob Sargent-4 wrote: See the javadoc on IIORegistry. With ImageIO you may have to register your handler(s). What does ImageIO.getImageReadersBySuffix() give you. For certain jpegs we don't use ImageIO, rather the classes in com.sun.image.codec.jpeg: try { FileOutputStream fos = new FileOutputStream(file); JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(fos); JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(image.getRaster(), JPEGDecodeParam.COLOR_ID_CMYK); param.setQuality(1, false); encoder.encode(image.getRaster(), param); fos.close(); } catch (Throwable t) { logger.debug(t.getMessage()); } But generally we use ImageIO On 06/06/2011 08:29 AM, Oscar.Flores wrote: Yeah i think i need your help again i tried tu run the .jar file in the console it work but without images this it what appears 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) i tried download the jai-imagio add to the class path but it dont work Rob Sargent-4 wrote: Very odd. I'm having no problems getting images into pdfs using fop-1.0. On 06/03/2011 11:04 AM, Oscar.Flores wrote: aaa hey thanks for the help the other day, i resolve the problem changing the version of FOP for the 0.95beta instead of the 1.0, it works now it prints the image and its good, thanks and we are in touch if anything else fails jejeje Rob Sargent-4 wrote: Nothing in the log from the transformer? On 06/03/2011 09:47 AM, Oscar.Flores wrote: hi there i have another problem i hope you can help me the pdf that i create with foe has no image, it dont show any of them, the xsl seems to be rigth i tested with EditX and the pdf show me the image, what can it be, i have xmlgraphics-commons-1.5svn, fop 1.0, fop-pdf-images 2.0.1 Snapshot for the render of the image but it don work please help!!! :,( - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org -- View this message in context: http://old.nabble.com/Problems-with-FOP-and-image-tp31766430p31786846.html Sent from the FOP - Users mailing list archive at Nabble.com. - 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
On 06/06/2011 02:29 PM, Oscar.Flores wrote: Hi what can be the difference between execute the program in netbeans (where it works and print the images and the jar in the console) Different classes being loaded by Netbeans than the console app. Get Netbeans to show you the full classpath it's using in it's %classpath variable also i tried the imageIO.getImageReadersBySuffix but i cant interpretate the data y.y, its that or always its true in the boolean variable, and how can i register the handler?? Talk to IIORegistry, some thing like IIORegistry.getDefaultInstance().registerServiceProvider(new CLibJPEGImageReaderSpi()); IIORegistry.getDefaultInstance().registerServiceProvider(new CLibJPEGImageWriterSpi()); Note: those are not necessarily the services you have in your setup. Thanks Rob Sargent-4 wrote: See the javadoc on IIORegistry. With ImageIO you may have to register your handler(s). What does ImageIO.getImageReadersBySuffix() give you. For certain jpegs we don't use ImageIO, rather the classes in com.sun.image.codec.jpeg: try { FileOutputStream fos = new FileOutputStream(file); JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(fos); JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(image.getRaster(), JPEGDecodeParam.COLOR_ID_CMYK); param.setQuality(1, false); encoder.encode(image.getRaster(), param); fos.close(); } catch (Throwable t) { logger.debug(t.getMessage()); } But generally we use ImageIO On 06/06/2011 08:29 AM, Oscar.Flores wrote: Yeah i think i need your help again i tried tu run the .jar file in the console it work but without images this it what appears 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) i tried download the jai-imagio add to the class path but it dont work Rob Sargent-4 wrote: Very odd. I'm having no problems getting images into pdfs using fop-1.0. On 06/03/2011 11:04 AM, Oscar.Flores wrote: aaa hey thanks for the help the other day, i resolve the problem changing the version of FOP for the 0.95beta instead of the 1.0, it works now it prints the image and its good, thanks and we are in touch if anything else fails jejeje Rob Sargent-4 wrote: Nothing in the log from the transformer? On 06/03/2011 09:47 AM, Oscar.Flores wrote: hi there i have another problem i hope you can help me the pdf that i create with foe has no image, it dont show any of them, the xsl seems to be rigth i tested with EditX and the pdf show me the image, what can it be, i have xmlgraphics-commons-1.5svn, fop 1.0, fop-pdf-images 2.0.1 Snapshot for the render of the image but it don work please help!!! :,( - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
NoSuchMethodError: org.apache.fop.fonts.FontInfo.setEventListener
Hello Everyone, I am trying to embed FOP into my app according to this article: http://xmlgraphics.apache.org/fop/0.95/embedding.html Actually, my code is here: public void createPDF(ArrayListFile inputFileList, File output) throws Exception { File foFile = createFO(inputFileList); FopFactory fopFactory = FopFactory.newInstance(); //fopFactory.getFontManager().setFontBaseURL(file:///D:); OutputStream out = new BufferedOutputStream(new FileOutputStream(output)); try { Fop fop = fopFactory.newFop(MimeConstants.MIME_FOP_PRINT, out); TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(); Source src = new StreamSource(foFile); Result res = new SAXResult(fop.getDefaultHandler()); transformer.transform(src, res); } finally { out.close(); } } When this method is called, I am getting Exception in thread main java.lang.NoSuchMethodError: org.apache.fop.fonts.FontInfo.setEventListener(Lorg/apache/fop/fonts/FontEve ntListener;)V at org.apache.fop.fo.FOEventHandler.init(FOEventHandler.java:84) at org.apache.fop.area.AreaTreeHandler.init(AreaTreeHandler.java:100) at org.apache.fop.render.RendererFactory.createFOEventHandler(RendererFactory.j ava:359) at org.apache.fop.fo.FOTreeBuilder.init(FOTreeBuilder.java:99) at org.apache.fop.apps.Fop.createDefaultHandler(Fop.java:147) at org.apache.fop.apps.Fop.init(Fop.java:82) at org.apache.fop.apps.FopFactory.newFop(FopFactory.java:271) at org.apache.fop.apps.FopFactory.newFop(FopFactory.java:248) at me.jan.Producer.createPDF(Producer.java:32) I have no idea what to check. I think it is related to fonts but that exception is not very clear to me. Win7/64bit, Java 1.6, Fop1.0 Regards, Jan - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: NoSuchMethodError: org.apache.fop.fonts.FontInfo.setEventListener
Since you are using 1.0 you better find a newer take on embedding fonts. Maybe here http://xmlgraphics.apache.org/fop/trunk/fonts.html#embedding On 06/06/2011 03:28 PM, honyk wrote: Hello Everyone, I am trying to embed FOP into my app according to this article: http://xmlgraphics.apache.org/fop/0.95/embedding.html Actually, my code is here: public void createPDF(ArrayListFile inputFileList, File output) throws Exception { File foFile = createFO(inputFileList); FopFactory fopFactory = FopFactory.newInstance(); //fopFactory.getFontManager().setFontBaseURL(file:///D:); OutputStream out = new BufferedOutputStream(new FileOutputStream(output)); try { Fop fop = fopFactory.newFop(MimeConstants.MIME_FOP_PRINT, out); TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(); Source src = new StreamSource(foFile); Result res = new SAXResult(fop.getDefaultHandler()); transformer.transform(src, res); } finally { out.close(); } } When this method is called, I am getting Exception in thread main java.lang.NoSuchMethodError: org.apache.fop.fonts.FontInfo.setEventListener(Lorg/apache/fop/fonts/FontEve ntListener;)V at org.apache.fop.fo.FOEventHandler.init(FOEventHandler.java:84) at org.apache.fop.area.AreaTreeHandler.init(AreaTreeHandler.java:100) at org.apache.fop.render.RendererFactory.createFOEventHandler(RendererFactory.j ava:359) at org.apache.fop.fo.FOTreeBuilder.init(FOTreeBuilder.java:99) at org.apache.fop.apps.Fop.createDefaultHandler(Fop.java:147) at org.apache.fop.apps.Fop.init(Fop.java:82) at org.apache.fop.apps.FopFactory.newFop(FopFactory.java:271) at org.apache.fop.apps.FopFactory.newFop(FopFactory.java:248) at me.jan.Producer.createPDF(Producer.java:32) I have no idea what to check. I think it is related to fonts but that exception is not very clear to me. Win7/64bit, Java 1.6, Fop1.0 Regards, Jan - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org