Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
The fit_to_pages_wide and fit_to_pages_tall settings control spreadsheet scaling during printing. These settings ensure printed output fits within specified page dimensions:
Key benefits include:
To configure this in Microsoft Excel:
To configure programmatically:
from aspose.cells import Workbook
# Instantiating a Workbook object
workbook = Workbook("input.xlsx")
# Accessing the first worksheet in the Excel file
worksheet = workbook.worksheets[0]
# Setting the number of pages to which the length of the worksheet will be spanned
worksheet.page_setup.fit_to_pages_tall = 1
# Setting the number of pages to which the width of the worksheet will be spanned
worksheet.page_setup.fit_to_pages_wide = 1
# Save the workbook
workbook.save("out_net.pdf")
Output result:

To force single‑page output:
from aspose.cells import Workbook, PdfSaveOptions
# Instantiating a Workbook object
workbook = Workbook("sample.xlsx")
options = PdfSaveOptions()
# Setting OnePagePerSheet option
options.one_page_per_sheet = True
# Save the workbook with options
workbook.save("OnePagePerSheet.pdf", options)
Output result:

To consolidate columns horizontally:
from aspose.cells import Workbook, PdfSaveOptions
# Instantiating a Workbook object
workbook = Workbook("sample.xlsx")
options = PdfSaveOptions()
# Setting all columns in one page per sheet
options.all_columns_in_one_page_per_sheet = True
# Save the workbook
workbook.save("AllColumnsInOnePagePerSheet.pdf", options)
Output result:
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.