Adatta Tutte le Colonne del Foglio di Lavoro su una Singola Pagina PDF
Adatta le Colonne del Foglio di Lavoro su una Singola Pagina PDF
PdfSaveOptions.setAllColumnsInOnePagePerSheet garantisce che tutte le colonne di un foglio di calcolo siano rese in una singola pagina PDF, anche se le righe possono espandersi su più pagine a seconda dei dati nel foglio di calcolo.
Il codice di esempio qui sotto mostra come utilizzare la proprietà PdfSaveOptions.setAllColumnsInOnePagePerSheet per rendere un ampio foglio di calcolo con 100 colonne.
// 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(FitAllWorksheetColumns.class); | |
// Create and initialize an instance of Workbook | |
Workbook book = new Workbook(dataDir + "TestBook.xlsx"); | |
// Create and initialize an instance of PdfSaveOptions | |
PdfSaveOptions saveOptions = new PdfSaveOptions(SaveFormat.PDF); | |
// Set AllColumnsInOnePagePerSheet to true | |
saveOptions.setAllColumnsInOnePagePerSheet(true); | |
// Save Workbook to PDF fromart by passing the object of PdfSaveOptions | |
book.save(dataDir + "output.pdf", saveOptions); |