Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
The FitToPagesWide and FitToPagesTall settings are used in spreadsheet applications (like Microsoft Excel) to control how a spreadsheet is scaled when printing. These settings help ensure that your printed output fits within a specified number of pages, both horizontally and vertically. Here’s a breakdown of each setting:
Here are some reasons to set FitToPagesWide and FitToPagesTall:
To set the FitToPagesWide and FitToPagesTall settings in Microsoft Excel, follow these steps:
Open your Excel workbook and go to the sheet you want to print.
Go to the Page Layout tab on the Ribbon.
In the Page Setup group, click the small arrow in the bottom-right corner to open the Page Setup dialog box.
In the Page Setup dialog box, go to the Page tab.
Under Scaling, select the option “Fit to” and then specify the number of pages wide and tall you want: Enter the number of pages wide you want in the first box (Fit to x pages wide). Enter the number of pages tall you want in the second box (Fit to y pages tall).

Click OK to apply the settings.
To set FitToPagesWide and FitToPagesTall in a specified worksheet: First, load the sample file, and then you need to modify the PageSetup.getFitToPagesTall() and PageSetup.getFitToPagesWide() properties of the PageSetup object for the desired worksheet. Here is an example in Node.js:
const path = require("path");
const AsposeCells = require("aspose.cells.node");
// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
const filePath = path.join(dataDir, "input.xlsx");
// Instantiating a Workbook object
const workbook = new AsposeCells.Workbook(filePath);
// Accessing the first worksheet in the Excel file
const worksheet = workbook.getWorksheets().get(0);
// Setting the number of pages to which the length of the worksheet will be spanned
worksheet.getPageSetup().setFitToPagesTall(1);
// Setting the number of pages to which the width of the worksheet will be spanned
worksheet.getPageSetup().setFitToPagesWide(1);
// Save the workbook
workbook.save("out_net.pdf");
The output result:

To print Worksheet as one page: First, load the sample file, and then you need to set the PdfSaveOptions.getOnePagePerSheet() property of the PdfSaveOptions object. Here is an example in Node.js:
const path = require("path");
const AsposeCells = require("aspose.cells.node");
// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
const filePath = path.join(dataDir, "sample.xlsx");
// Loads the workbook which contains hidden external links
const workbook = new AsposeCells.Workbook(filePath);
const options = new AsposeCells.PdfSaveOptions();
options.setOnePagePerSheet(true);
// Save the workbook.
workbook.save("OnePagePerSheet.pdf", options);
The output result:

To print all columns of Worksheet in one page: First, load the sample file, and then you need to set the PdfSaveOptions.getAllColumnsInOnePagePerSheet() property of the PdfSaveOptions object. Here is an example in Node.js:
const AsposeCells = require("aspose.cells.node");
const path = require("path");
// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
const filePath = path.join(dataDir, "sample.xlsx");
// Loads the workbook which contains hidden external links
const workbook = new AsposeCells.Workbook(filePath);
const options = new AsposeCells.PdfSaveOptions();
options.setAllColumnsInOnePagePerSheet(true);
// Save the workbook.
workbook.save("AllColumnsInOnePagePerSheet.pdf", options);
The output result:
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.