将所有工作表列放在单个页面上 PDF

在单个页面上调整工作表列 PDF

PdfSaveOptions.AllColumnsInOnePagePerSheet确保工作表中的所有列都呈现到单个 PDF 页面,但根据工作表中的数据,行可能会扩展到多个页面。

下面的示例代码展示了如何使用PdfSaveOptions.AllColumnsInOnePagePerSheet属性呈现 100 列的大型工作表。

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// 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();
// Set AllColumnsInOnePagePerSheet to true
saveOptions.AllColumnsInOnePagePerSheet = true;
// Save Workbook to PDF fromart by passing the object of PdfSaveOptions
dataDir = dataDir+ "output.out.pdf";
book.Save(dataDir, saveOptions);