We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Porting application from aspose-metafile to aspose-imaging

I have developed application which uses aspose-metafile Java packet (1.7.0). Since aspose-metafile is discontinued, I have to covert it to aspose-imaging. Is there any document or sample I can use to guide my porting?

Hi Chang,

Thank you for using Aspose products.

I am afraid, currently there isn’t a document that I can refer here to help you with up-gradation of your application. I have logged a ticket (SUPPORT-3763) in this regard, and I will soon share the link here for your kind reference. In the meanwhile, if I can be of any assistance please let me know.

Please note, in Aspose.Imaging for Java API, the MetafileImage class is located in com.aspose.imaging.fileformats.metafile package. You need to load the image using Image.load method and cast the object to MetafileImage type. A sample source code snippet to load a WMF file, and to save it in different format is provided below for your reference,

Java


String filePath = myDir + “sample.wmf”;
MetafileImage mfi = (MetafileImage) Image.load(filePath);
mfi.save(myDir + “example.bmp”, new BmpOptions());

In case you have a specific requirement, please provide your existing project source code. We can look into it to provide further assistance in this regard.

Thank you for your reply. Even though it is quite surprise and disappointed that Aspose did not prepare a porting guidance/path for old customer before deciding to discontinue the Metafile product.


Here are some questions. There may be more in the future.
1. In Metafiles package, there is a class called AsposeLicenseException, which should be caught when set license. I cannot locate it in the imaging package. Can you help?
2. Metafile class in aspose-imaging packet has a method setDefaultRenderingHints(). What is the counterpart in imaging packet or MetafileImage class.
3. Metafile class in aspose-imaging packet has a method playMetafile(), which allows me to transform the image. What is the counterpart in imaging packet or MetafileImage class.

Thank you very much for your help.


Hi Chang,

First of all, please accept my sincere apology for the inconvenience caused. We are already working on the requested documentat and soon it will be added to the online help guide for your future reference.

Regarding your questions, please find the answers as provided below in same sequence,

  1. In Aspose.Imaging for Java API, if the license has not been set properly then the License class will throw the exception of type java.lang.Exception. If an incompatible license has been set then Aspose.Imaging API will continue in evaluation mode.
  2. The method setDefaultRenderingHints was removed from Aspose.Imaging for Java API. In case you have a special requirement concerning the said method, please provide more details of your scenario so we could analyze it on our end to consider adding the method back to the public API.
  3. Class com.aspose.imaging.fileformats.metafile.MetafileImage was replaced by com.aspose.imaging.fileformats.metafile.Metafile starting with Aspose.Imaging for Java 2.1.0 (upcoming release). Whereas the method playMetafile will be part of class com.aspose.imaging.fileformats.metafile.Metafile.

As soon as Aspose.Imaging for Java 2.1.0 is available for public use, we will notify you with the download link for your reference.

Hi again,

Please check the article How to Migrate from Aspose.Metafiles to Aspose.Imaging for Java. Please let us know if you find some information missing or need further elaboration on any aspect of the article so we could further enhance it for a swift transaction from Aspose.Metafiles to Aspose.Imaging for Java API.

Thank you for your continues support and cooperation.