Free Support Forum - aspose.com

Changing the resolution of an image using Aspose.word.savings.ImageSaveOptions

Hi,

How can i change the resolution of an image to 1700/2200 and 200 dpi using Aspose.word.savings.ImageSaveOptions.It would be great if you provide me with some sample code.

Thanks & Regards,

Brijesh

Hi

Thanks for your request. You can specify resolution using ImageSaveOptions. Please follow the link for more information:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/aspose.words.saving.imagesaveoptions.html

Please see the code below:

// Open document.

Document doc = new Document("in.doc");

// Create imfge save options and set recolution.

ImageSaveOptions opt = new ImageSaveOptions(SaveFormat.Tiff);

opt.Resolution = 72;

// Save to tiff.

doc.Save("out.tiff", opt);

Hope this helps.

Best regards,

Hi,

Thanks a lot for your reply.

Actually my problem is when i am converting .msg file to Tiff image the images in the .msg file are getting strectched off.

Could you please help me in resolving this.Please find the attached image

Thanks & Regards,

Brijesh

Hi Brijesh,

Thank you for additional information. Could you please also attach your source document here? I will check the issue on my side and provide you more information.

Best regards,

Hi,

Thanks for your reply.

Please find the attached source document.

Thanks & Regards,

Brijesh

Hello

Thank you for additional information. Actualy I do not see any images inside the output RTF. Please try using the following code to save your MSG directly to file as RTF:

MapiMessage msg = MapiMessage.FromFile("C:\\Temp\\Outlook.msg");

Stream outputFile = new FileStream("C:\\Temp\\out.rtf", FileMode.Create);

StreamWriter writer = new StreamWriter(outputFile);

writer.Write(msg.BodyRtf);

writer.Close();

outputFile.Close();

So I think this problem is related to Aspose.Network. I use the latest version of Aspose.Words and Aspose.Network for testing.

Also could you please attach the output RTF produced on your side?

Best regards,