We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

? re Rendering of images

I am attempting to ouput an image of a worksheet. The Print_range defined in the excel file corresponds to a legal size sheet of paper. Printing to hardcopy works fine.

The image file that results is truncated however. I have tried experimenting with various combinations. Currently I use the following options settings
Dim options As New Aspose.Cells.Rendering.ImageOrPrintOptions()
options.HorizontalResolution = 200
options.VerticalResolution = 200
options.OnePagePerSheet = True

    With x.Worksheets("Days").PageSetup
        .PaperSize = PaperSizeType.PaperLetter
        .Orientation = PageOrientationType.Landscape
        .TopMargin = 0.25
        .BottomMargin = 0.25
        .LeftMargin = 0.25
        .RightMargin = 0.25
        .FitToPagesTall = 1
        .FitToPagesWide = 1
     End With

I get an image that appears more like it is formatted to a letter size piece of paper. Am interested in purchasing your product, but worry that this needed functionality (output to image) is not present


Well, Aspose.Cells for .NET will render images for the sheet based on the print preview (of MS Excel) that is shown in Ms Excel. Please either save the Excel file with your desired PageSetup options by Aspose.Cells or perform your required options in MS Excel manually to save the file, now take the preview of the sheet in MS Excel, it should be identical to your output image.
If you still feel that MS Excel’s preview is different than its output image, please attach your template file and output image here, we will check your issue soon and figure it out.

We also recommend you to kindly try our latest version/fix: Aspose.Cells for .NET v7.4.0.2.

Thank you.

I am having the same issue after changing to v

The Print Preview in MS Excel (2003 and 2010) shows the entire sheet. The code I am using currently is

Dim wb As New aspose.Cells.Workbook("TestSave.xls")

Dim ImgOptions As New Aspose.Cells.Rendering.ImageOrPrintOptions

Dim sr As New Aspose.Cells.Rendering.SheetRender(wb.Worksheets(0), ImgOptions)

sr.ToImage(0, "test.bmp")

Dim bmp As System.Drawing.Bitmap = sr.ToImage(0)

Me.PictureBox1.Image = bmp

sr = Nothing


I tested your scenario with v7.4.0.3 (latest fix): Aspose.Cells for .NET v7.4.0.3 it works absolutely fine with it.

Here is my simplest sample code:
Sample code:

Workbook wb = new Aspose.Cells.Workbook(“e:\test2\TestSave.xls”);
ImageOrPrintOptions ImgOptions= new ImageOrPrintOptions();
SheetRender sr = new SheetRender(wb.Worksheets[0], ImgOptions);
sr.ToImage(0, “e:\test2\test.bmp”);

I have attached the output image (BMP) file here, you may see it renders complete page without any truncation or missing portion.

Thank you.

I am still getting the same truncated image. I have used your simple code and version

Are there any machine or framework specific settings that might be causing me problems?

Running VS2010 under Windows 70, tried Framework 3.5 and 4.



It looks strange to us as we could not find any issue and it works fine here.

What is your Display settings in “Appearance and Personalization” under control panel for your windows? Please use “100%” (default) settings if you are using any other settings.

Thank you.

Thanks. That solved the problem.

Is it possible to get around this other than changing the system settings?


Good to know that your issue is resolved.

Well, I am afraid, you have to set your Display settings to “100%” (default)" as Aspose.Cells will give you identical results, other settings might not always give you 100% similar and accurate results.

Thank you.