Limitar el número de páginas generadas Conversión de Excel a PDF

Limitar el número de páginas generadas

El siguiente ejemplo muestra cómo renderizar un rango de páginas (3 y 4) en un archivo de Microsoft Excel a PDF.

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
// The path to the documents directory.
String dataDir = Utils.getDataDir(LimitNumberofPagesGenerated.class);
// Open an Excel file
Workbook wb = new Workbook(dataDir + "TestBook.xlsx");
// Instantiate the PdfSaveOption
PdfSaveOptions options = new PdfSaveOptions();
// Print only Page 3 and Page 4 in the output PDF
// Starting page index (0-based index)
options.setPageIndex(2);
// Number of pages to be printed
options.setPageCount(2);
// Save the PDF file
wb.save(dataDir + "outPDF1.pdf", options);