Free Support Forum - aspose.com

Emf image size issue


#1

hello,

we are using a linq reporting template to insert emf image (using image tag in the template, the object bound contains a System.Drawing.Image property).
if we save our emf into files (basically save the image property into a file), their size is about 50kbytes. when we use aspose to generate the word document, and then unzip the word file, the emf files are 200 kBytes.

As we are trying to insert 1000 images the size of the word document is really too big. This is a blocking issue for us.
Thanks for your help


#2

@miniseb31

Thanks for your inquiry. To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document.
  • Please attach the output Word file that shows the undesired behavior.
  • Please create a standalone console application ( source code without compilation errors ) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.


#3

It appears it is not an aspose issue, we generate the emf file ourself so the problem is in our side.
sorry
sebastien


#4

@miniseb31

Thanks for your feedback. It is nice to hear from you that your problem has been solved. Please let us know if you have any more queries.


#5

sorry actually there is an aspose issue.

AsposeEMF.zip (325.1 KB)

in the sample i have a emf file of 122KB, when i generate the word and unzip it, the emf file is 244KB. how do you save the emf file ?
the emf file had been saved with meta = new Metafile(ms, bufferGraphics.GetHdc(),
rect,
MetafileFrameUnit.Pixel,
EmfType.EmfOnly);


#6

@miniseb31

Thanks for your inquiry. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-18024. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.


#7

Hello,

After a lot of testing on the image insertion with aspose i discoved a lot :

  • Inserting an svg image is by far the best solution : if we insert an System;Drawing.Image with svg format, aspose creates a word with the svg converted in emf.
    We tried to convert ourselves the svg into emf, but we couldnt find a proper solution. If we use svg.net to convert svg to emf, a 40KB svg becomes 120MB emf, and this file becomes 220MB when aspose insert it into word (as explained in this post).
    I couldnt find in the documentation, that this solution is the best.

  • Question: When aspose convert an svg into emf (understandable by ms word), if we unzip word the image is emf. What sort of emf is it ? We can not open it with inkspace

  • if we insert multiple times the same System;Drawing.Image, apparently aspose only insert one image, incredible

I think, based on what aspose is doing with image insertion, we dont need to manipulate emf anymore. We are using svg and it works very well !!!


#8

@miniseb31

It would be great if you please share some more detail about this query. Are you facing any issue with EMF file size or the EMF file is not your desired output?

It seems that you do not want resolution of WORDSNET-18024. If you are happy with SVG image insertion in document, please let us know. We will then close this issue. Thanks for your cooperation.


#9

yes we do not need WORDSNET-18024


#10

@miniseb31

Thanks for your feedback. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.