Converting Word document to image

Hi!

I’m using Aspose.Words to convert Word documents to images. I use this simple code:

var doc = new Aspose.Words.Document(KitTestPath + “Input.docx”);

var options = new Aspose.Words.Saving.ImageSaveOptions(Aspose.Words.SaveFormat.Jpeg);
options.JpegQuality = 100;
options.Resolution = 200;
options.PageCount = 1;

for (int counter = 0; counter < doc.PageCount; counter++)
{
options.PageIndex = counter;
doc.Save(string.Format(“Output_{0}.jpg”, counter), options);
}

When applying this on the attached file the result is a little bit surprising. Part of the image is blue which is not visible in the original Word document. Can you tell what is the problem in this document?

Regards,
Dejan

Hi Dejan,

Thanks for your inquiry. The problem occurs because your Word document actually has a blue background color which becomes invisible when viewed in Print Layout View. In Microsoft Word you can turn On/Off this option by following the path below:

Office Button | Options | Advanced | Show Document Content | Show background colors and images in Print Layout view.

I hope, this helps.

Best regards,

Thanks for your help.

Regards,
Dejan