@lsl,
Thanks for the sample code, sample video and template file.
Please update your code as following, it will work fine as I tested:
e.g
Sample code:
var workbook = new Workbook(“fail_detail_statistics___sms__2018-07-11_.xlsx”);
Worksheet worksheet = workbook.Worksheets[0];
// Set the print area with your desired range
// Set all margins as 0
worksheet.PageSetup.LeftMargin = 0;
worksheet.PageSetup.RightMargin = 0;
worksheet.PageSetup.TopMargin = 0;
worksheet.PageSetup.BottomMargin = 0;
//
worksheet.AutoFilter.Custom(0, FilterOperatorType.Equal, 3);
worksheet.AutoFilter.Refresh();
AutoFitterOptions autofitterOptions = new AutoFitterOptions();
autofitterOptions.IgnoreHidden = true;
worksheet.AutoFitRows(autofitterOptions);
// Set OnePagePerSheet option as true
ImageOrPrintOptions options = new ImageOrPrintOptions();
options.OnePagePerSheet = true;
options.ImageType = ImageType.Jpeg;
options.HorizontalResolution = 100;
options.VerticalResolution = 100;
// Take the image of your worksheet
SheetRender sr = new SheetRender(worksheet, options);
sr.ToImage(0, "ww.jpg");
workbook.Save("123.xlsx");
Process.Start("ww.jpg");
Let us know if you still find any issue.