Free Support Forum - aspose.com

Convert EMF to PNG will generate too many font files under TempFontsGraphics

When I convert EMF files to PNG file, there will be a TempFontsGraphics folder generated under user\AppData\Local\Temp\ and contains around 2GB .ttc font files.
It blocks the conversion which will last long time, and also generated too many temp font files which will occupy the disk and results in the disk full.

Since the EMF file is confidential, so I could not upload the file, but I’m trying to find a similar one. Will upload if have.
All I could tell now is the EMF contains a lot of Japanese words and characters.

Could someone help check the problem at first.

I use win10 platform and Unix platform as well.

image.png (39.4 KB)

@tldyzem

We may not be able to say anything thing concrete here as there is no example and source file. If you have used custom fonts in EMF than they should be in folder specified in code or at system. In order to reduce this you must use system fonts.

Moreover, in order to further investigate this, we will still need source file and used sample code.

Thanks for reply, it’s hard to find a similar EMF, we are trying to ask our customer whether we could send the original issued emf file here for debug. Please hold on.
Thanks

@tldyzem

We will be looking forward to further information shared from your side in this regard.

Finnally, I got that I could upload the issued emf.
please help check the problems for this emf, refer to below code:

  1. it costs almost 5 minutes to convert the image below, it’s too long
  2. there will be a TempFontsGraphics folder generated under user\AppData\Local\Temp, which contains too many font files, and result in the disk full and server down.

Please try both with font or without font installed on system. Problem exits both on win10 and ubuntu.
import com.aspose.imaging.Image;
import com.aspose.imaging.fileformats.emf.EmfImage;
import com.aspose.imaging.imageoptions.PngOptions;
PngOptions pngOpts = new PngOptions();
EmfImage image = (EmfImage)Image.load(emfPath);
image.save(pngPath, pngOpts);

image.zip (26.6 KB)

@tldyzem

Thank you for sharing the information with us. A ticket with ID IMAGINGJAVA-7772 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.