Hi,
I’m relatively new to Aspose Cells.
I’m trying to save a complete Worksheet to one page.
I’ve found multiple ways to do so:
Workbook wb = new Workbook(“C:\Book1Test.xls”);
Worksheet sheet = wb.Worksheets[0];
Bitmap bitmap = sheet.SheetToImage();
bitmap.Save(“C:\ExampleUsing sheet.SheetToImage.tiff”, ImageFormat.Tiff);
2. From the forum and other sources:
Workbook wb = new Workbook(“C:\Book1Test.xls”);
Worksheet sheet = wb.Worksheets[0];ImageOrPrintOptions imgOptions = new ImageOrPrintOptions();
imgOptions.ImageFormat = System.Drawing.Imaging.ImageFormat.Tiff;
imgOptions.HorizontalResolution = 100;
imgOptions.VerticalResolution = 100;
imgOptions.TiffCompression = TiffCompression.CompressionLZW;
imgOptions.OnePagePerSheet = true;
SheetRender render = new SheetRender(sheet, imgOptions);
render.ToTiff(“ExampleUsing sheetRender.ToTiff.tiff”);
Here is my problem:
The first function is deprecated and should be avoided.
The second method doesn’t print the complete worksheet. The pages gets the size of the WorkSheet, but half of it is empty.
Attached are the examples I used.
Is there a solution to my problem?
Sincerely,
G. Smulders