EMF to (SVG / PNG) conversion issue


#1

Hello,

I am evaluating Aspose.Imaging as a possible way to convert EMF files to SVG and render to high-quality PNGs in Java.

With the attached (and my first ever tested) EMF file, the result is lacking in several ways:

  • characters run into each other and are partially wrong
  • the mathematical “root” symbol is incomplete

This erratic conversion behaviour shows both when converting to SVG or to PNG, in identical form.
When I open the EMF file in e.g. GraphicConverter 10 on the Mac (i.e. it also does not use native Windows APIs for EMF rendering), the EMF shows correctly, so all needed fonts seem to be installed on my system.

I am attaching an archive with the source code I am using, the source EMF, and the resulting EMF + PNG.

What is also strange is that the SVG file does consist merely of a pixel image (PNG) instead of the vector objects, so I’m actually losing the vector trait of the EMF format during conversion.

Can anyone point me to what I am doing wrong, and which settings I need to make in Apose.Imaging so that vectors are retained, all objects show and the right fonts are chosen?

Thanks,
Christian
aspose-imaging-test.zip (16.1 KB)


#2

@kris28,

Can you please share complete environment details so that we may further investigate. Also please share which Aspose.Imaging version you are using on your end.


#3

@Adnan.Ahmad,

my Java runtime environment is as follows:

Java runtime environment

awt.toolkit=sun.lwawt.macosx.LWCToolkit
file.encoding=UTF-8
file.encoding.pkg=sun.io
file.separator=/
ftp.nonProxyHosts=local|.local|169.254/16|.169.254/16
gopherProxySet=false
http.nonProxyHosts=local|.local|169.254/16|.169.254/16
java.awt.graphicsenv=sun.awt.CGraphicsEnvironment
java.awt.printerjob=sun.lwawt.macosx.CPrinterJob
java.class.path=***/eclipsebin:***/lib/aspose-imaging-19.3-jdk16.jar
java.class.version=52.0
java.endorsed.dirs=/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/endorsed
java.ext.dirs=/Users/***/Library/Java/Extensions:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/ext:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre
java.io.tmpdir=/var/folders/9m/7jgk6q113296ywv9_963jss80000gq/T/
java.library.path=/Users/***/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
java.runtime.name=Java™ SE Runtime Environment
java.runtime.version=1.8.0_112-b16
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_112
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.8
java.vm.vendor=Oracle Corporation
java.vm.version=25.112-b16
line.separator=

os.arch=x86_64
os.name=Mac OS X
os.version=10.11.6
path.separator=:
socksNonProxyHosts=local|.local|169.254/16|.169.254/16
sun.arch.data.model=64
sun.awt.enableExtraMouseButtons=true
sun.boot.class.path=/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/classes
sun.boot.library.path=/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib
sun.cpu.endian=little
sun.cpu.isalist=
sun.font.fontmanager=sun.font.CFontManager
sun.io.unicode.encoding=UnicodeBig
sun.java.command=EMFToolsAspose /Users/***/test-1.emf /Users/***/test-1.svg
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.country.format=DE
user.dir=/Users/***/
user.home=/Users/s
user.language=en
user.name=

user.timezone=Europe/Berlin

I am testing Apose.Imaging 19.3.

Can you provide some sort of “SVG reference output” (created on your systems) from the sample EMF I supplied previously for me to see what I’ll be able to achieve once my environment is set up optimally?

Thanks so much,
Christian


#4

@kris28,

I have worked with source files shared by you using Aspose.Imaging 19.3 and have been able to observe the issues. A ticket with ID IMAGINGJAVA-1267 for SVG issue and ticket with ID IMAGINGJAVA-1268 for PNG issue has been created in our issue tracking system to further investigate and resolve the issues. This thread has been associated with the tickets so that we may share the notification with you once investigation will be completed.