isFitToPage property

bool isFitToPage
getter/setter pair

Indcates whether the fit to page is selected.

final Workbook workbook = Workbook();
final Worksheet sheet = workbook.worksheets[0];
sheet.getRangeByName('A1:M40').text = 'PagePrint';
sheet.pageSetup.isFitToPage = true;
final List<int> bytes = workbook.saveAsStream();
saveAsExcel(bytes, 'isFitToPage.xlsx');
workbook.dispose();

Implementation

late bool isFitToPage;