When convert emf with japanese text to png in unix- japanese did not show right

Hi Developer,

when I use aspose to conver emf with japanese text to png in unix, the graph is ok, but the japanese words became messy code. But if I do it in windows, all is OK.

part of output pngs created in window and unix attached .

Attachment: inUnixBad.PNG
Attachment: inwindowsOK.PNG

could you please help?

aspose version : aspose-imaging-2.1.0.0-jdk16.jar

source code:

String inputPath =Thread.currentThread().getContextClassLoader().getResource("").getPath() + "/1.emf";

String outputPath = "1.png";

EmfMetafileImage metafile = new EmfMetafileImage(inputPath);

metafile.save(outputPath, new PngOptions());

Best regards

Hi Lei,


Thank you for contacting Aspose support.

We will require your input EMF file and the details of your environment to evaluate the problem cause on our end. Please provide the sample EMF along with the following details,

  • JDK/JRE Type & Version
  • Operating System Version & Architecture

EMF is attached


[gportal@epfap1d emf]$ java -version
java version "1.6.0_20"
Java™ SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot™ 64-Bit Server VM (build 16.3-b01, mixed mode)


[gportal@epfap1d emf]$ uname -a
Linux epfap1d 2.6.18-348.18.1.el5 #1 SMP Fri Sep 6 12:37:18 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux



Hi Apoorve,


Thank you for sharing the sample file as well as the environment details. Please spare us little time to prepare the equivalent environment as of yours to replicate the problem on our end. We will shortly get back to you with updates in this regard.

Hello,

This is for an urgent production issue at Citigroup. So would appreciate a fast response

Hi,


Sorry for the delayed response.

We have evaluated the presented scenario on the following platforms. Unfortunately, we are unable to replicate the problem so far. The resultant PNG generated in below environments displays the Japanese characters just fine. Please have a look at the attached snapshot.

Ubuntu 12.04

babar@babar-VirtualBox:~$ java -version
java version "1.6.0_31"
OpenJDK Runtime Environment (IcedTea6 1.13.3) (6b31-1.13.3-1ubuntu1~0.12.04.2)
OpenJDK 64-Bit Server VM (build 23.25-b01, mixed mode)

babar@babar-VirtualBox:~$ uname -a
Linux babar-VirtualBox 3.8.0-32-generic #47~precise1-Ubuntu SMP Wed Oct 2 16:19:35 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Ubuntu 14.04

babar@babar-VirtualBox:~$ java -version
java version "1.7.0_51"
OpenJDK Runtime Environment (IcedTea 2.4.6) (7u51-2.4.6-1ubuntu4)
OpenJDK Server VM (build 24.51-b03, mixed mode)

babar@babar-VirtualBox:~$ uname -a
Linux babar-VirtualBox 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:08:14 UTC 2014 i686 i686 i686 GNU/Linux
babar@babar-VirtualBox:~$


Linux Fedora 20

[babar.raza@localhost ~]$ java -version
java version "1.7.0_51"
OpenJDK Runtime Environment (fedora-2.4.5.1.fc20-x86_64 u51-b31)
OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode)

[babar.raza@localhost ~]$ uname -a
Linux localhost 3.13.3-201.fc20.x86_64 #1 SMP Fri Feb 14 19:08:32 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Please note, these environments were readily available therefore we quickly tested the presented scenario on them, but we suspect that simulating the JDK version will enable us to replicate the problem therefore we are already working to setup a fresh VM with specified JDK type/version. We have also logged the problem in our bug tracking system under ticket Id (IMAGING-34158), and requested the core team to investigate the matter on their end. As soon as we have any updates for you, we will post here for your kind reference.

In the meanwhile, please share the original image (without any modification) generated on your end showing the problem, and the Linux Distribution Name/Version using the following command.

$ cat /etc/*release
Red Hat Enterprise Linux Server release 5.9 (Tikanga)
5.9.GSF-A0 SOE Linux Release 01/24/13


I have attached all three things:

original emf in zip
good png
bad png

Hi there,


Thank you for providing the requested information. We have attached the samples to the ticket already associated with this thread for further investigation. As soon as we have some updates in this regard, we will post here for your kind reference.

Hello,

Can you please provide any updates. Appreciate it,

Hi Apoorve,


We are able to replicate the mentioned issue on Linux Fedora 20 with Oracle JDK 1.6.0_45 (please see the environment details at the bottom of this post). We have noticed that the problem has more to do with the JDK version and less with Linux flavor/version. Reason being, we have evaluated the said problem on plenty of different Linux based environments. The results produced with Oracle JDK 7 (1.7.0_55) & OpenJDK 1.7 are always perfect, whereas the results generated with JDK 1.6 exhibit this problem.

We have logged these details to the ticket associated with this thread, and currently looking into it to provide the fix with next major release of Aspose.Imaging for Java. Unfortunately, the release schedule hasn’t been announced yet, although as soon as we schedule the said release, we will post here for your kind reference.

Thank you for your patience and understanding.

Environment Details:
[admin@localhost ~]$ java -version
java version “1.6.0_45”
Java™ SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot™ 64-Bit Server VM (build 20.45-b01, mixed mode)

[admin@localhost ~]$ uname -a
Linux localhost.localdomain 3.14.4-200.fc20.x86_64 #1 SMP Tue May 13 13:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

[admin@localhost ~]$ cat /etc/*release
Fedora release 20 (Heisenbug)
NAME=Fedora
VERSION=“20 (Heisenbug)”
ID=fedora
VERSION_ID=20
PRETTY_NAME=“Fedora 20 (Heisenbug)”
ANSI_COLOR=“0;34”
CPE_NAME=“cpe:/o:fedoraproject:fedora:20”
HOME_URL=“https:// fedoraproject.org/”
BUG_REPORT_URL=“https:// bugzilla.redhat.com/”
REDHAT_BUGZILLA_PRODUCT=“Fedora”
REDHAT_BUGZILLA_PRODUCT_VERSION=20
REDHAT_SUPPORT_PRODUCT=“Fedora”
REDHAT_SUPPORT_PRODUCT_VERSION=20
Fedora release 20 (Heisenbug)

This is a huge problem for us. Any workaround or quicker fix possible?

Hi Apoorve,


First of all, please accept our sincere apologies for the delayed response due to the weekend.

Preliminary investigation suggests that the problem is caused due to the JDK 1.6 not being able to properly handle the Japanese characters in the EMF file. This behavior wasn’t reproduced with JDK 7, therefore one possible workaround is to upgrade the JDK to later version. We can understand, the suggested workaround could be tedious on your end as you are having the said problem on production. Although, if you can, please setup a sandbox with JDK 7 using your original application to see the results.

We have requested the core team to share their detailed analysis on this issue, and possibly a simple workaround. As soon as some news comes in, we will post here for your reference.

We tested with jdk7 and the issue is still there



/xenv/java/X/1.7.0_25l64/bin/java -version
java version "1.7.0_25"
Java™ SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot™ 64-Bit Server VM (build 23.25-b01, mixed mode)

Hi Apoorve,


We have again verified the behavior on two different Linux based platforms with Sun’s JDK 1.7.0_55 & 1.7.0_60. Please note, the issue didn’t replicate on our end with aforesaid JDK versions. Now we are moving forward to setup a new VM with 1.7.0_25 to confirm the resolution. We will keep you posted with updates in this regard.

We tried with the below jdk and still no luck.


[gportal@epfap1d src]$ /xenv/java/X/1.7.0_55l64/bin/java -version
java version "1.7.0_55"
Java™ SE Runtime Environment (build 1.7.0_55-b13)
Java HotSpot™ 64-Bit Server VM (build 24.55-b03, mixed mode)



I got more details about the latest jdk we tried with



[gportal@epfap1d src]$ /xenv/java/X/1.7.0_55l64/bin/java -XshowSettings:properties -version
Property settings:
awt.toolkit = sun.awt.X11.XToolkit
file.encoding = UTF-8
file.encoding.pkg = sun.io
file.separator = /
java.awt.graphicsenv = sun.awt.X11GraphicsEnvironment
java.awt.printerjob = sun.print.PSPrinterJob
java.class.path = .
/opt/gportal/java/lib/dt.jar
/opt/gportal/java/lib/tools.jar
java.class.version = 51.0
java.endorsed.dirs = /xenv/java/X/1.7.0_55l64/jre/lib/endorsed
java.ext.dirs = /xenv/java/X/1.7.0_55l64/jre/lib/ext
/usr/java/packages/lib/ext
java.home = /xenv/java/X/1.7.0_55l64/jre
java.io.tmpdir = /tmp
java.library.path = /usr/java/packages/lib/amd64
/usr/lib64
/lib64
/lib
/usr/lib
java.runtime.name = Java™ SE Runtime Environment
java.runtime.version = 1.7.0_55-b13
java.specification.name = Java Platform API Specification
java.specification.vendor = Oracle Corporation
java.specification.version = 1.7
java.vendor = Oracle Corporation
java.vendor.url = http://java.oracle.com/
java.vendor.url.bug = http:// bugreport.sun.com/bugreport/
java.version = 1.7.0_55
java.vm.info = mixed mode
java.vm.name = Java HotSpot™ 64-Bit Server VM
java.vm.specification.name = Java Virtual Machine Specification
java.vm.specification.vendor = Oracle Corporation
java.vm.specification.version = 1.7
java.vm.vendor = Oracle Corporation
java.vm.version = 24.55-b03
line.separator = \n
os.arch = amd64
os.name = Linux
os.version = 2.6.18-348.18.1.el5
path.separator = :
sun.arch.data.model = 64
sun.boot.class.path = /xenv/java/X/1.7.0_55l64/jre/lib/resources.jar
/xenv/java/X/1.7.0_55l64/jre/lib/rt.jar
/xenv/java/X/1.7.0_55l64/jre/lib/sunrsasign.jar
/xenv/java/X/1.7.0_55l64/jre/lib/jsse.jar
/xenv/java/X/1.7.0_55l64/jre/lib/jce.jar
/xenv/java/X/1.7.0_55l64/jre/lib/charsets.jar
/xenv/java/X/1.7.0_55l64/jre/lib/jfr.jar
/xenv/java/X/1.7.0_55l64/jre/classes
sun.boot.library.path = /xenv/java/X/1.7.0_55l64/jre/lib/amd64
sun.cpu.endian = little
sun.cpu.isalist =
sun.io.unicode.encoding = UnicodeLittle
sun.java.launcher = SUN_STANDARD
sun.jnu.encoding = UTF-8
sun.management.compiler = HotSpot 64-Bit Tiered Compilers
sun.os.patch.level = unknown
user.country = US
user.dir = /export/gportal/icg_portal/dev/rendition/jms/jmswork/emf2pgnTest/src
user.home = /opt/gportal
user.language = en
user.name = gportal
user.timezone =

java version “1.7.0_55”
Java™ SE Runtime Environment (build 1.7.0_55-b13)
Java HotSpot™ 64-Bit Server VM (build 24.55-b03, mixed mode)

Hi Apoorve,


We are sorry to know that the any of the JDK version that are producing correct results on our end are not working for you. One point to note here is that for a few VMs where results are correct, we used the bundled installation package to install JDK as well as NetBeans IDE to minimize the compatibility problems. Anyway, I do not think this could be the cause of failure on your side.

We will shortly respond back with the comparison of JDK properties where results are generated fine.

Hi Apoorve,


Please find the details of JDK 1.7.0_60 that produces correct results on our side.

[admin@localhost ~]$ java -XshowSettings:properties -version
Property settings:
awt.toolkit = sun.awt.X11.XToolkit
file.encoding = UTF-8
file.encoding.pkg = sun.io
file.separator = /
java.awt.graphicsenv = sun.awt.X11GraphicsEnvironment
java.awt.printerjob = sun.print.PSPrinterJob
java.class.path = .
java.class.version = 51.0
java.endorsed.dirs = /home/admin/jdk1.7.0_60/jre/lib/endorsed
java.ext.dirs = /home/admin/jdk1.7.0_60/jre/lib/ext
/usr/java/packages/lib/ext
java.home = /home/admin/jdk1.7.0_60/jre
java.io.tmpdir = /tmp
java.library.path = /usr/java/packages/lib/amd64
/usr/lib64
/lib64
/lib
/usr/lib
java.runtime.name = Java™ SE Runtime Environment
java.runtime.version = 1.7.0_60-b19
java.specification.name = Java Platform API Specification
java.specification.vendor = Oracle Corporation
java.specification.version = 1.7
java.vendor = Oracle Corporation
java.vendor.url = http://java.oracle.com/
java.vendor.url.bug = http:// bugreport.sun.com/bugreport/
java.version = 1.7.0_60
java.vm.info = mixed mode
java.vm.name = Java HotSpot™ 64-Bit Server VM
java.vm.specification.name = Java Virtual Machine Specification
java.vm.specification.vendor = Oracle Corporation
java.vm.specification.version = 1.7
java.vm.vendor = Oracle Corporation
java.vm.version = 24.60-b09
line.separator = \n
os.arch = amd64
os.name = Linux
os.version = 3.11.10-301.fc20.x86_64
path.separator = :
sun.arch.data.model = 64
sun.boot.class.path = /home/admin/jdk1.7.0_60/jre/lib/resources.jar
/home/admin/jdk1.7.0_60/jre/lib/rt.jar
/home/admin/jdk1.7.0_60/jre/lib/sunrsasign.jar
/home/admin/jdk1.7.0_60/jre/lib/jsse.jar
/home/admin/jdk1.7.0_60/jre/lib/jce.jar
/home/admin/jdk1.7.0_60/jre/lib/charsets.jar
/home/admin/jdk1.7.0_60/jre/lib/jfr.jar
/home/admin/jdk1.7.0_60/jre/classes
sun.boot.library.path = /home/admin/jdk1.7.0_60/jre/lib/amd64
sun.cpu.endian = little
sun.cpu.isalist =
sun.desktop = gnome
sun.io.unicode.encoding = UnicodeLittle
sun.java.launcher = SUN_STANDARD
sun.jnu.encoding = UTF-8
sun.management.compiler = HotSpot 64-Bit Tiered Compilers
sun.os.patch.level = unknown
user.country = US
user.dir = /home/admin
user.home = /home/admin
user.language = en
user.name = someuser
user.timezone =

java version “1.7.0_60”
Java™ SE Runtime Environment (build 1.7.0_60-b19)
Java HotSpot™ 64-Bit Server VM (build 24.60-b09, mixed mode)

Unfortunately, we are still unable to isolate the problem cause on our end, although we are trying hard to find the problem cause so we could provide a fix with next major release of Aspose.Imaging for Java. Moreover, I am trying on my end with JDK 1.6 by installing different Japanese fonts on the Linux platform to find out a suitable workaround for the situation. We will keep you posted with updates in this regard.

We are really sorry for the inconvenience caused to you.

We tried both Java 1.7.0_55l64 as well as Java 1.8.0_5l64 and the issue still persists. Other than the Java Version, I only see difference in OS version and nothing else.

Please let me know when this issue can be resolved.

/xenv/java/X/1.7.0_55l64/bin/java -XshowSettings:properties -version

Property settings:

awt.toolkit = sun.awt.X11.XToolkit
file.encoding = UTF-8
file.encoding.pkg = sun.io
file.separator = /
java.awt.graphicsenv = sun.awt.X11GraphicsEnvironment
java.awt.printerjob = sun.print.PSPrinterJob
java.class.path = .
java.class.version = 51.0
java.endorsed.dirs = /net/nyhub1.ny.ssmb.com/global/xenv/java/X/1.7.0_55l64/jre/lib/endorsed
java.ext.dirs = /net/nyhub1.ny.ssmb.com/global/xenv/java/X/1.7.0_55l64/jre/lib/ext
/usr/java/packages/lib/ext
java.home = /net/nyhub1.ny.ssmb.com/global/xenv/java/X/1.7.0_55l64/jre
java.io.tmpdir = /tmp
java.library.path = /usr/java/packages/lib/amd64
/usr/lib64
/lib64
/lib
/usr/lib
java.runtime.name = Java(TM) SE Runtime Environment
java.runtime.version = 1.7.0_55-b13
java.specification.name = Java Platform API Specification
java.specification.vendor = Oracle Corporation
java.specification.version = 1.7
java.vendor = Oracle Corporation
java.vendor.url = http://java.oracle.com/
java.vendor.url.bug = http://bugreport.sun.com/bugreport/
java.version = 1.7.0_55
java.vm.info = mixed mode
java.vm.name = Java HotSpot(TM) 64-Bit Server VM
java.vm.specification.name = Java Virtual Machine Specification
java.vm.specification.vendor = Oracle Corporation
java.vm.specification.version = 1.7
java.vm.vendor = Oracle Corporation
java.vm.version = 24.55-b03
line.separator = \n
os.arch = amd64
os.name = Linux
os.version = 2.6.18-348.18.1.el5
path.separator = :
sun.arch.data.model = 64
sun.boot.class.path = /net/nyhub1.ny.ssmb.com/global/xenv/java/X/1.7.0_55l64/jre/lib/resources.jar
/net/nyhub1.ny.ssmb.com/global/xenv/java/X/1.7.0_55l64/jre/lib/rt.jar
/net/nyhub1.ny.ssmb.com/global/xenv/java/X/1.7.0_55l64/jre/lib/sunrsasign.jar
/net/nyhub1.ny.ssmb.com/global/xenv/java/X/1.7.0_55l64/jre/lib/jsse.jar
/net/nyhub1.ny.ssmb.com/global/xenv/java/X/1.7.0_55l64/jre/lib/jce.jar
/net/nyhub1.ny.ssmb.com/global/xenv/java/X/1.7.0_55l64/jre/lib/charsets.jar
/net/nyhub1.ny.ssmb.com/global/xenv/java/X/1.7.0_55l64/jre/lib/jfr.jar
/net/nyhub1.ny.ssmb.com/global/xenv/java/X/1.7.0_55l64/jre/classes
sun.boot.library.path = /net/nyhub1.ny.ssmb.com/global/xenv/java/X/1.7.0_55l64/jre/lib/amd64
sun.cpu.endian = little
sun.cpu.isalist =
sun.io.unicode.encoding = UnicodeLittle
sun.java.launcher = SUN_STANDARD
sun.jnu.encoding = UTF-8
sun.management.compiler = HotSpot 64-Bit Tiered Compilers
sun.os.patch.level = unknown
user.country = US
user.dir = /home/ck90276
user.home = /home/ck90276
user.language = en
user.name = ck90276
user.timezone =
**/xenv/java/X/1.8.0_5l64/bin/java -XshowSettings:properties –version**

Property settings:

awt.toolkit = sun.awt.X11.XToolkit
file.encoding = UTF-8
file.encoding.pkg = sun.io
file.separator = /
java.awt.graphicsenv = sun.awt.X11GraphicsEnvironment
java.awt.printerjob = sun.print.PSPrinterJob
java.class.path = .
java.class.version = 52.0
java.endorsed.dirs = /net/nyhub1.ny.ssmb.com/global/xenv/java/X/1.8.0_5l64/jre/lib/endorsed
java.ext.dirs = /net/nyhub1.ny.ssmb.com/global/xenv/java/X/1.8.0_5l64/jre/lib/ext
/usr/java/packages/lib/ext
java.home = /net/nyhub1.ny.ssmb.com/global/xenv/java/X/1.8.0_5l64/jre
java.io.tmpdir = /tmp
java.library.path = /usr/java/packages/lib/amd64
/usr/lib64
/lib64
/lib
/usr/lib
java.runtime.name = Java(TM) SE Runtime Environment
java.runtime.version = 1.8.0_05-b13
java.specification.name = Java Platform API Specification
java.specification.vendor = Oracle Corporation
java.specification.version = 1.8
java.vendor = Oracle Corporation
java.vendor.url = http://java.oracle.com/
java.vendor.url.bug = http://bugreport.sun.com/bugreport/
java.version = 1.8.0_05
java.vm.info = mixed mode
java.vm.name = Java HotSpot(TM) 64-Bit Server VM
java.vm.specification.name = Java Virtual Machine Specification
java.vm.specification.vendor = Oracle Corporation
java.vm.specification.version = 1.8
java.vm.vendor = Oracle Corporation
java.vm.version = 25.5-b02
line.separator = \n
os.arch = amd64
os.name = Linux
os.version = 2.6.18-348.18.1.el5
path.separator = :
sun.arch.data.model = 64
sun.boot.class.path = /net/nyhub1.ny.ssmb.com/global/xenv/java/X/1.8.0_5l64/jre/lib/resources.jar
/net/nyhub1.ny.ssmb.com/global/xenv/java/X/1.8.0_5l64/jre/lib/rt.jar
/net/nyhub1.ny.ssmb.com/global/xenv/java/X/1.8.0_5l64/jre/lib/sunrsasign.jar
/net/nyhub1.ny.ssmb.com/global/xenv/java/X/1.8.0_5l64/jre/lib/jsse.jar
/net/nyhub1.ny.ssmb.com/global/xenv/java/X/1.8.0_5l64/jre/lib/jce.jar
/net/nyhub1.ny.ssmb.com/global/xenv/java/X/1.8.0_5l64/jre/lib/charsets.jar
/net/nyhub1.ny.ssmb.com/global/xenv/java/X/1.8.0_5l64/jre/lib/jfr.jar
/net/nyhub1.ny.ssmb.com/global/xenv/java/X/1.8.0_5l64/jre/classes
sun.boot.library.path = /net/nyhub1.ny.ssmb.com/global/xenv/java/X/1.8.0_5l64/jre/lib/amd64
sun.cpu.endian = little
sun.cpu.isalist =
sun.io.unicode.encoding = UnicodeLittle
sun.java.launcher = SUN_STANDARD
sun.jnu.encoding = UTF-8
sun.management.compiler = HotSpot 64-Bit Tiered Compilers
sun.os.patch.level = unknown
user.country = US
user.dir = /home/ck90276
user.home = /home/ck90276
user.language = en
user.name = ck90276
user.timezone =

Hi Vswanathan,


First of all, please accept our sincere apologies for the inconvenience caused to you.

You are right, I have checked my other VMs as well, and there are no notable differences other than JDK version and Linux distribution. Please note, we have successfully tested the possible workaround on many Linux flavors except Red Hat Linux Server, reason being, RHEL it’s not a freeware like other distributions we performed our testing on.

Currently we are focusing on the original issue (with JDK 1.6) to find the problem cause. The ticket attached to this thread is still in analysis phase therefore we cannot share an estimated time frame for the fix at this moment. As soon as we have completed the investigation, we may provide a hotfix or an early release for you to test on your end. Until then please spare us little more time.

Please note, we have elevated the priority of the ticket to the highest most, and have requested the core team to share their investigation results. We will keep you posted with updates in this regard.