utf7charset.provider.CharsetProvider not found

Last post 05-02-2011, 6:01 AM by codewarior. 6 replies.
Sort Posts: Previous Next
  •  04-28-2011, 8:31 AM 299743

    utf7charset.provider.CharsetProvider not found Java

    Attachment: Present (inaccessible)

    Hello,

    I try to convert an emf image to png using the method described in the sample directory (emf2png.java)

    I'm using aspose-metafiles-1.7.1-java library

    I have the following error :

    sun.misc.ServiceConfigurationError: java.nio.charset.spi.CharsetProvider: Provider com.aspose.ms.java.utf7charset.provider.CharsetProvider not found
     at sun.misc.Service.fail(Service.java:129)
     at sun.misc.Service.access$000(Service.java:111)
     at sun.misc.Service$LazyIterator.next(Service.java:273)
     at java.nio.charset.Charset$1.getNext(Charset.java:320)
     at java.nio.charset.Charset$1.hasNext(Charset.java:333)
     at java.nio.charset.Charset$4.run(Charset.java:552)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.nio.charset.Charset.availableCharsets(Charset.java:547)
     at com.aspose.metafiles.MetafileCharsetCollection.do(SourceFile:163)
     at com.aspose.metafiles.MetafileCharsetCollection.do(SourceFile:749)
     at com.aspose.metafiles.MetafileCharsetCollection.<clinit>(SourceFile:740)
     at com.aspose.metafiles.obfuscated.cm.<init>(SourceFile:149)
     at com.aspose.metafiles.EmfMetafile.playMetafile(SourceFile:122)
     at com.aspose.metafiles.EmfMetafile.playMetafile(SourceFile:203)
    ...

    The image is first extrated from the doc file (using aspose.words), and then converted.

    How can I fix this problem ?

    Many thanks

     
  •  04-28-2011, 12:42 PM 299821 in reply to 299743

    Re: utf7charset.provider.CharsetProvider not found

    Hello Vincent,

    Thanks for using our products.

    Can you please share the EMF image so that we can test the scenario at our end. More along, I am not entirely certain about the capabilities of Aspose.Words to directly save this image into PNG format without exporting it first as EMF but I think my fellow worker from respective team would be in better position to answer this query. I have requested him to share his thoughts over this matter.

    We are sorry for this inconvenience.


    Nayyer Shahbaz
    Support Developer, Aspose Sialkot Team
    About Us
    Contact Us

    Keep in touch! We're on Twitter and Facebook
     
  •  04-28-2011, 2:35 PM 299877 in reply to 299743

    Re: utf7charset.provider.CharsetProvider not found

    Hello Vincent,

    Thanks for your patience.

    I have discussed this matter with my fellow worker in Aspose.Words team and as per his comments, currently Aspose.Words does not support the feature of extracting EMF image from DOC file and saving it into PNG format.

    Meanwhile, I am working over this query and will get back to you soon. Please be patient and spare us little time. We are sorry for this delay and inconvenience.


    Nayyer Shahbaz
    Support Developer, Aspose Sialkot Team
    About Us
    Contact Us

    Keep in touch! We're on Twitter and Facebook
     
  •  04-29-2011, 2:16 AM 299953 in reply to 299877

    Re: utf7charset.provider.CharsetProvider not found Java

    Attachment: Present (inaccessible)

    Hello

    I use the following piece of code to extract the image to EMF Format. This image is then stored on the local file system beofre calling the processImage method to convert it to PNG format.

         if (nodePara.getNodeType() == NodeType.SHAPE) {
          
             Shape shape  =(Shape) nodePara;
             if (shape.hasImage()) {

              if (shape.getImageData().getImageType() == ImageType.EMF) {
               byte [] bytes = shape.getImageData().getImageBytes();
               ByteArrayInputStream bais = new ByteArrayInputStream (bytes);

               String fileName = myDir + "image" + imageIndex++  +".emf";
               File output = new File(fileName);
               FileOutputStream fos = new FileOutputStream (output);
               fos.write(bytes);
               fos.close();
               
               processImage(fileName);
              }


             }
         }

    The processImage is exactly the same as the one existing in the emf2png.java sample file. I have attached a zip file containing the emf image stored on the file system after the extraction.

    Vincent

     

     
  •  05-01-2011, 2:44 PM 300728 in reply to 299953

    Re: utf7charset.provider.CharsetProvider not found

    Attachment: Present (inaccessible)

    Hello Vincent,

    Sorry for you replying you late.

    I have tried converting the attached emf file into PNG format while using Aspose.Metafiles for Java 1.7.1 over Windows XP SP3 where I have jdk1.6.0_20 and as per my observations, the PNG image is properly being generated. For your reference, I have also attached the resultant Image that I have generated. Can you please share some details regarding your working environment. We apologize for your inconvenience.

    PS, I have used jai_codec-1.1.3.jar and have created a sample project in Eclipse Galileo to test the scenario.


    Nayyer Shahbaz
    Support Developer, Aspose Sialkot Team
    About Us
    Contact Us

    Keep in touch! We're on Twitter and Facebook
     
  •  05-02-2011, 2:42 AM 300774 in reply to 300728

    Re: utf7charset.provider.CharsetProvider not found

    Hello,

    My environment is the following :

    • Windows 7 Pro
    • Eclipse 3.3.2 (Europa)
    • Jdk 1.6.0_07
    • I have also used jai_codec-1.1.3
    • Aspose.Metafiles for Java 1.7.1

    I'll try this week to upgrade eclipse and jdk versions.

    Vincent

     

     
  •  05-02-2011, 6:01 AM 300808 in reply to 300774

    Re: utf7charset.provider.CharsetProvider not found

    Attachment: Present (inaccessible)

    Hello Vincent,

    I have again tested the scenario while creating a project in Eclipse Galileo over Windows 7 Professional 64Bit where I have jdk1.6.0_20 and I have used Aspose.Metafiles for Java 1.7.1 along with jai_codec-1.1.3.jar and I am unable to notice any problem. The EMF is properly being converted into PNG format. Can you please try upgrading your JDK version may be it resolve this issue.

    We are really sorry for your inconvenience.


    Nayyer Shahbaz
    Support Developer, Aspose Sialkot Team
    About Us
    Contact Us

    Keep in touch! We're on Twitter and Facebook
     
View as RSS news feed in XML