Aspose.Imaging WMF To Png conversion not properly

Dear support team,

We are not getting expected out put of WMF to Png conversion at Linux environment. I attached wmf and converted png file in zip format, you will get issues there by comparing wmf and converted png file after extracting zip file. Also i attached Browser Snap shot(WmfT0PngConversionIssues.JPG) of that how its showing after conversion.

Server Information
Tomcat Version JVM Version JVM Vendor OS Name OS Version OS Architecture
Apache Tomcat/6.0.39 1.6.0_30-b30 Sun Microsystems Inc. Linux 2.6.18-371.4.1.el5xen i386

If Aspose.Imaging having such types issues then it will be not help us to resolving our business purpose.

Please look at that issues as soon as possible so that we can move ahead. Let us know if you need more information to reproduce this issues, we will providing to you. so that our aspect will full fill as soon as possible.

From
Nitin Chopkar.

Hi Nitin,

Thank you for contacting Aspose support.

It seems that you are missing fonts that are required to properly render a few gylphs from the shared WMF file. Please execute the following piece of code in a simple console application and provide the output here for further review.

Java


System.out.println(com.aspose.imaging.BuildVersionInfo.ASSEMBLY_VERSION);
java.awt.Font font = new java.awt.Font(java.awt.Font.DIALOG, java.awt.Font.PLAIN, 24);
boolean b = font.canDisplay(’+’);
System.out.println("Can Display + : " + b);
b = font.canDisplay(’-’);
System.out.println("Can Display - : " + b);
b = font.canDisplay(’=’);
System.out.println("Can Display = : " + b);

Out put of provided code:

2.9.1.0
Can Display + : true
Can Display - : true
Can Display = : true

From
Nitin Chopkar

Hi Nitin,

Thank you for providing the output. It appears that you have the required fonts to render all the gylphs. Moreover, I have tested the scenario on CentOS 6.5 x64 against JDK 1.8, and I am able to replicate the problem on my side. I have logged an investigative ticket with Id IMAGING-34936 in our database for the product team’s review. Please allow us some time to properly analyze the presented scenario, and get back to you with updates in this regard.

Hi Nitin,

This is to update you that we have thoroughly investigated the scenario logged earlier as IMAGING-34936. Please note, the incorrect rendering of a few mathematical symbols in your provided WMF is caused due to the default Symbol font installed in the Linux environment. If you replace the said font with the one available in Windows environment, you will be able to get the correct results.

In order to install the Microsoft’s core fonts, please use the instructions as below in terminal.

In order to copy the font from Windows to Linux, please copy the Symbol.ttf from Windows to Linux and use the following statements in terminal.

  • mkdir ~/.fonts
  • cp Symbol.ttf ~/.fonts/
  • fc-cache -fv

Please note, you will require the help from your system administrator in this task as you require the root access for most of the commands. Moreover, they will be able to find the existing Symbol font and replace it with the one from Windows in case installing the Microsoft core fonts does not resolve the problem.

Hi,

As per your reply I had followed the instructions in terminal but when I execute below command
rpmbuild -ba msttcorefonts-2.0-1.spec
Error :- RPM build errors: Bad exit status from /var/tmp/rpm-tmp.79287 (%prep)

Please help

Regards
Anup

Hi Anup,

I have just noticed that the commands I have provided in the previous post are pointing to a bit older spec file (2.0-1) whereas the latest one is 2.5-1 so I think the problem could be due to this difference. Could you please re-run the process while pointing to msttcorefonts-2.5-1.spec? Detailed steps are provided here.

I am sorry for the inconvenience.

Hi,

Thanks for your reply. But still getting same error

Error :-
Resolving netcologne. dl.sourceforge.net… failed: Connection timed out.
wget: unable to resolve host address `netcologne. dl.sourceforge.net’
error: Bad exit status from /var/tmp/rpm-tmp.56474 (%prep)

RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.56474 (%prep)

Please help.

Regards
Anup


Hi Anup,

It appears to be a connectivity problem. In case you do not succeed in several tries, please consider the following.

  • Check your local internal connection
  • Switch to a mirror site close to your physical location. Please note, the mirrors/download sites are very busy sometime so you can search internet to find the suitable mirror site accordingly.

Hi,

Thanks for reply. Issue has been resolved.

Nitin will update you tomorrow.

Thanks again.

Hi,

It is good to know that you are able to bypass the connection error. Sure, we will be looking forward to your test results for the actual scenario.

Hi Babar,
We done with the following things which you sent us, but problem is not resolved still converted png image having same problem.

Setting which you sent:
In order to install the Microsoft’s core fonts, please use the instructions as below in terminal.

In
order to copy the font from Windows to Linux, please copy the
Symbol.ttf from Windows to Linux and use the following statements in
terminal.

  • mkdir ~/.fonts
  • cp Symbol.ttf ~/.fonts/
  • fc-cache -fv

Please look out that. Once again i enclosed wmf and converted png file in zip format(issues.zip).

From

Nitin Chopkar



Hi Nitin,


We are sorry to know that the presented solution didn’t help. Please note, we were able to verify the solution on two different flavors of Linux, that are; Ubuntu 14.04 & CentOS 6.6. Please find the attachment for the resultant PNG generated on CentOS.

In order to look further into this matter, please provide the output of fc-list command from the terminal on your side.

Hi,

Please check attached file.


Regards
Nitin

Hi Nitin,


Thank you for sharing the output. I have compared the results with mine for the required font, and was able to notice one difference. In your provided file, the required font name is Symbols where as on my end it is Symbol.

Please follow the following steps precisely to over come this situation.

  1. Download the attached archive (containing Symbol.ttf) and extract the contents in Downloads folder.
  2. Open a terminal.
  3. Get the access rights of the root using su.
  4. Create a directory using mkdir /usr/share/fonts/msfonts.
  5. Go to the directory containing the Symbol.ttf using cd Downloads.
  6. Copy the file to the directory created in step 4 using cp SYMBOL.TTF /usr/share/fonts/msfonts/.
  7. Build font information cache files using fc-cache -fv.
  8. Re-run the EMF to PNG conversion process.

Please let us know of your feedback.

Hi,

It’s working. Many Many thanks for your help.

But it’s working on my local environment. We have shared hosting. How it’s possible in share hosting environment. (Without root access) ?

Regards
Anup / Nitin

Hi Anup & Nitin,


It is good to know that you are able to resolve the problem. Regarding your recent concerns, I believe you have to contact the system administrator(s) of your hosting provided to repeat the process as root access is required or may be they have any alternative approach.

The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.