Aspose.Cells convert from Excel to Tiff

I am using Aspose.Cells (version: 22.6.1 ) in C#, to Convert from Excel to a Tiff file. but the conversion is not using the whole width available.as you can see the image this is what I have in the CODE:
if you can help me to fit the Excel into the TIFF image all to the right site.

                    worksheet.PageSetup.TopMargin = 0;
                    worksheet.PageSetup.BottomMargin = 0;
                    worksheet.PageSetup.LeftMargin = 0;
                    worksheet.PageSetup.RightMargin = 0;

Aspose.Cells.Rendering.ImageOrPrintOptions options = new Aspose.Cells.Rendering.ImageOrPrintOptions();
options.IsCellAutoFit = false;
options.HorizontalResolution = 300;
options.VerticalResolution = 300;
options.OnePagePerSheet = false;
options.PrintingPage = default;
options.TiffCompression = ccitt4;
Aspose.Cells.PageSetup pageSetup = worksheet.PageSetup;
pageSetup.PrintGridlines = false;
pageSetup.Order = downthenover;

                    pageSetup.RightMargin = 0;
                    pageSetup.FitToPagesWide = 1;

AsposeCells.PNG (7.5 KB)

@jorge1,

Thank you for providing the screenshot. Could you please zip and attach your Excel file? We will review it and try to replicate your desired task.

Hi,

Here is the zip with the Excel file

TEST_Eexel.zip (10.9 KB)

@jorge1

There are two factors that causes the blank on the right side.

  1. Column E which is blank except some left borders is output. You can get rid of column E by setting printarea:
pageSetup.PrintArea = "A1:D56";
  1. The width of the output content is less than the width of the setting paper size. You can use ImageOrPrintOptions.OnePagePerSheet to break the setting paper size.
//change OnePagePerSheet from false to true in your code.
options.OnePagePerSheet = true;

Hi,

Thank you for your time really appreciate.

I will try this and will let you know if this help me. :blush:

~WRD0002.jpg (357 Bytes)

@jorge1,
Thank you for your feedback. If you have any questions, please feel free to contact us.