Convert Word Doc to Image with RenderToSize()

I want to convert the attached document to an image; however, using the code below results in an image with a black background. Is there a property that allows me to maintain the background color? ImageSaveOptions does work; however, I would like to have the option to resize the image.

string contentType = fileUpload.PostedFile.ContentType;
System.IO.Stream strmContent = fileUpload.PostedFile.InputStream;
Aspose.Words.Document docSrc = new Aspose.Words.Document(strmContent);
byte[] byteImage=new byte[0];

Aspose.Words.DocumentBuilder builder = new Aspose.Words.DocumentBuilder(docSrc);
Aspose.Words.PageSetup ps = builder.PageSetup;
double width = ps.PageWidth;
double height = ps.PageHeight;
System.IO.MemoryStream msImage = new System.IO.MemoryStream();
using (System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(Convert.ToInt16(width), Convert.ToInt16(height)))
{
using (System.Drawing.Graphics gr = System.Drawing.Graphics.FromImage(bmp))
{
gr.PageUnit = System.Drawing.GraphicsUnit.Pixel;
docSrc.RenderToSize(0, gr, 0, 0, ((float)width), ((float)height));
bmp.Save(msImage, System.Drawing.Imaging.ImageFormat.Jpeg);
}
}
byteImage = msImage.ToArray();
Response.ContentType = "image/jpeg";
Response.BinaryWrite(byteImage);

Hi Tim,

Thanks for your inquiry.

Please see this thread here regarding the background color used in RenderToSize and RenderToScale.

In your case most likely your document has a background color of black. You should use this code below to change it to white before rendering.

doc.PageColor = Color.White;

Thanks,