Outlook to tiff scale was not working?

Hi,
i need to set scale in outlook to tiff ,if please i need it urgent.

var msg = MailMessage.Load(inputFilePath, new MsgLoadOptions());
var msgStream = new MemoryStream();
msg.Save(msgStream, SaveOptions.DefaultMhtml);
msgStream.Position = 0;
var doc = new Document(msgStream);
doc.Save(outputFilePath, options);

Hi Aravind,

Thanks for your inquriy. You may use Scale property of ImageSaveOptions object as following to set image scale during conversion, it will help you to accomplish the task.

Aspose.Words.Document doc = new Aspose.Words.Document(input);
Aspose.Words.Saving.ImageSaveOptions
options = new Aspose.Words.Saving.ImageSaveOptions(Aspose.Words.SaveFormat.Tiff);
options.Scale = 1.5;
doc.Save(output, options);

Best Regards,

But we can only give upto "2"right?. what about height and width?

Hi Aravind,

ARAVINDDSRC:
But we can only give upto "2"right?

Thanks for your feedback. There is no limitation of scale factor. I have tested with 3 using Aspose.Words for .NET 17.3.0 and unable to notice any issue. However if you are facing any issue then please share your sample code along with document here, we will look into it and will guide you accordingly.

ARAVINDDSRC:
what about height and width?

For setting height and width image, you can use RenderToSize() method of Document class as following.

private static void SaveToImage(Document doc, int pageIndex, string imageName, int width, int height)
{
    using (Bitmap bmp = new Bitmap(width, height))
    {
        // User has some sort of a Graphics object. In this case created from a bitmap.
        using (Graphics gr = Graphics.FromImage(bmp))
        {
            Color backgroundColor = doc.PageColor;
            if (backgroundColor == Color.Empty)
                backgroundColor = Color.White;
            gr.FillRectangle(new System.Drawing.SolidBrush(backgroundColor), 0, 0, width, height);
            gr.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;
            gr.PageUnit = GraphicsUnit.Pixel;
            doc.RenderToSize(pageIndex, gr, 0f, 0f, width, height);
            bmp.Save(imageName);
        }
    }
}

Please feel free to contact us for any further assistance.

Best Regards,