I'm using Aspose.Cells to create a spreadsheet, then SheetRender.ToImage() to create an image of the sheet which is then inserted into a Word document using Aspose.Words. The image quality is terrible - lines and columns are incorrectly rendered. I checked the .xls and .png (also .jpg) before insertion into the .doc file, so I can completely rule out Aspose.Words.
Here's a screen-shot of the table I'm trying to render, as displayed by Excel: SheetRender_Excel.jpg (attached).
This is the generated .png file: LeBow_GraphicsTmp.png. (Attached).
Here is the .xls (with all other sheets in the workbook removed for confidentiality reasons): 101_Gesamtdaten_14-10-2012_14-35.xls101_Gesamtdaten_14-10-2012_14-35.xls (attached).
Aspose.Cells version information: SheetRender_Version.jpg (attached). Visual Studio 2010, Excel 2007, all software patched to the latest security releases.
This is the code used to generate the .png file:
//
//Define ImageOrPrintOptions
//
Aspose.Cells.Rendering.ImageOrPrintOptions
imgOptions = new Aspose.Cells.Rendering.ImageOrPrintOptions();
//
//Specify the image format
//
imgOptions.ImageFormat = System.Drawing.Imaging.ImageFormat.Png;
//
//Only one page for the whole sheet would be rendered
//
imgOptions.OnePagePerSheet = true;
imgOptions.Quality = 100;
imgOptions.VerticalResolution = 300;
imgOptions.HorizontalResolution = 300;
//
//Render the sheet with respect to specified
image/print options
//
Aspose.Cells.Rendering.SheetRender sr = new Aspose.Cells.Rendering.SheetRender
(wSheet, imgOptions);
String sGraphicsTempFile = String.Format("{0}\\{1}_GraphicsTemp.png",
m_RepositoryPath, m_sUserName);
//
//Render the image for the sheet
//
sr.ToImage (0, sGraphicsTempFile);
//
//Define ImageOrPrintOptions
//
Aspose.Cells.Rendering.ImageOrPrintOptions
imgOptions = new Aspose.Cells.Rendering.ImageOrPrintOptions();
//
//Specify the image format
//
imgOptions.ImageFormat = System.Drawing.Imaging.ImageFormat.Png;
//
//Only one page for the whole sheet would be rendered
//
imgOptions.OnePagePerSheet = true;
imgOptions.Quality = 100;
imgOptions.VerticalResolution = 300;
imgOptions.HorizontalResolution = 300;
//
//Render the sheet with respect to specified
image/print options
//
Aspose.Cells.Rendering.SheetRender sr = new Aspose.Cells.Rendering.SheetRender
(wSheet, imgOptions);
String sGraphicsTempFile = String.Format("{0}\\{1}_GraphicsTemp.png",
m_RepositoryPath, m_sUserName);
//
//Render the image for the sheet
//
sr.ToImage (0, sGraphicsTempFile);
Note: the results are just as bad, with or without imgOptions.OnePagePerSheet set.