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

Free Support Forum - aspose.com

Excel to tiff -scale as parameter

Hi,


I want convert excel to tiff with scale as parameter,but i cant set scale ,also attached the code i have used in it.

var options = new ImageOrPrintOptions
{
HorizontalResolution = HResol,
VerticalResolution = VResol,
ImageFormat = System.Drawing.Imaging.ImageFormat.Tiff,
};

var workbook = new Workbook(inputFilePath);
foreach (Worksheet ws in workbook.Worksheets)
ws.SetVisible(ws.IsVisible, false);
var wr = new WorkbookRender(workbook, options);
wr.ToImage(outputFilePath);

Thanks in advance

Hi,


Thanks for your query.

What do you mean by scale (as parameter)? Could you elaborate with template Excel file and output sample images as per your requirements, we will check it soon.

Thank you.

Scale what i mean is setting height and width to tiff file that was created.

Hi,


Well, you may try to use ImageOrPrintOptions.SetDesiredSize(width, height) method for your requirements, see the sample code for your reference:
e.g
Sample code:

Workbook wb = new Workbook(TMP_DIR + “test.xlsx”);
ImageOrPrintOptions imgOpt = new ImageOrPrintOptions();
imgOpt.HorizontalResolution = 200;
imgOpt.VerticalResolution = 200;
imgOpt.ImageFormat = ImageFormat.Tiff;
imgOpt.SetDesiredSize(500, 800);
WorkbookRender wr = new WorkbookRender(wb, imgOpt);
wr.ToImage(TMP_DIR + “test.tiff”);

Hope, this helps a bit.

Thank you.