Free Support Forum - aspose.com

Error: One factory fails for the operation png while saving Slide with saveToSVG / Java

Hi there,



I’ve got an exception when I want to save the first slide by using saveToSVG.



Error: One factory fails for the operation “png”

Occurs in: javax.media.jai.ThreadSafeOperationRegistry

java.lang.reflect.InvocationTargetException

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at javax.media.jai.FactoryCache.invoke(FactoryCache.java:130)

at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1679)

at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeOperationRegistry.java:481)

at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:340)

at com.sun.media.jai.opimage.StreamRIF.create(StreamRIF.java:110)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at javax.media.jai.FactoryCache.invoke(FactoryCache.java:130)

at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1679)

at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeOperationRegistry.java:481)

at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:340)

at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:830)

at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:878)

at javax.media.jai.RenderedOp.getSampleModel(RenderedOp.java:2244)

at com.sun.media.jai.codecimpl.PNGCodec.canEncodeImage(PNGCodec.java:62)

at javax.media.jai.operator.EncodeDescriptor.validateArguments(EncodeDescriptor.java:172)

at javax.media.jai.JAI.createNS(JAI.java:1090)

at javax.media.jai.JAI.create(JAI.java:977)

at javax.media.jai.JAI.create(JAI.java:1672)

at com.aspose.slides.j.do(SourceFile:131)

at com.aspose.slides.Slide.saveToSVG(SourceFile:1480)



I hope you can help!

Dear Pinny3,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

You should see this thread.

http://www.aspose.com/community/forums/thread/114365.aspx

Dear,



I’ve tried this. However, I have to use org.apache.atik to convert the saved SVG of the slide to JPG to put it to a PDF and Batik (org.apache) uses JAI also. This is going to be a pain in the ass to patch all these additional libraries.



Is there any other way?



I hope so, since it is the only outstanding issue on my list. Then we can buy the licenses of your great Aspose.PDF, Word, Cells and Slides.



Looking forward to hearing soon from you!



Regards,



Christian

I’ve now patched the batik classes properly.



How ever I got this exception now:



Error: Cannot decode the image for the type :

Occurs in: com.sun.media.jai.opimage.CodecRIFUtil

java.io.IOException

at com.sun.media.jai.codecimpl.CodecUtils.toIOException(Unknown Source)

at com.sun.media.jai.codecimpl.PNGImageDecoder.decodeAsRenderedImage(Unknown Source)

at com.sun.media.jai.opimage.CodecRIFUtil.create(Unknown Source)

at com.sun.media.jai.opimage.PNGRIF.create(Unknown Source)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at javax.media.jai.FactoryCache.invoke(Unknown Source)

at javax.media.jai.OperationRegistry.invokeFactory(Unknown Source)

at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(Unknown Source)

at javax.media.jai.registry.RIFRegistry.create(Unknown Source)

at com.sun.media.jai.opimage.StreamRIF.create(Unknown Source)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)16.04.2008 17:17:00



Can you help?



Regards,



Christian

Please find attached the PPT I like to transform to PDF.

Why you need patch many libraries? Do you have several JAI in the classpath?

Most probably you should delete native part of JAI.
mlib_jai*.dll for windows
libmlib*.so for unix/linux
In this case our patched version will be used by default.

Well,

Batik, which is needed for the conversation from SVG to JPG has got the same PNGImageDecoder.class in their jars.

Regards,

Christian

After patching the needed Jars for Jai, I’ve got the following error-message if I want to convert the attached PPT to a PDF:



Error: One factory fails for the operation “png”

Occurs in: javax.media.jai.ThreadSafeOperationRegistry

java.lang.reflect.InvocationTargetException

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at javax.media.jai.FactoryCache.invoke(FactoryCache.java:130)

at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1679)

at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeOperationRegistry.java:481)

at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:340)

at com.sun.media.jai.opimage.StreamRIF.create(StreamRIF.java:110)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at javax.media.jai.FactoryCache.invoke(FactoryCache.java:130)

at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1679)

at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeOperationRegistry.java:481)

at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:340)

at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:830)

at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:878)

at javax.media.jai.RenderedOp.getSampleModel(RenderedOp.java:2244)

at com.sun.media.jai.codecimpl.PNGCodec.canEncodeImage(PNGCodec.java:62)

at javax.media.jai.operator.EncodeDescriptor.validateArguments(EncodeDescriptor.java:172)

at javax.media.jai.JAI.createNS(JAI.java:1090)

at javax.media.jai.JAI.create(JAI.java:977)

at javax.media.jai.JAI.create(JAI.java:1672)

at com.aspose.slides.j.do(SourceFile:131)

at com.aspose.slides.Slide.saveToSVG(SourceFile:1480)





How can I resolve this error? What is wrong here?