Render Bir PDF Sayfa Başına Excel Çalışma Sayfası - Excel'den PDF'e Dönüştürme
Contents
[
Hide
]
Büyük Microsoft Excel dosyalarıyla çalışırken (örneğin, her biri 50 sütun ve 300 veya daha fazla veri satırı içeren birçok sayfası olan bir çalışma kitabı), çalışma sayfasının boyutundan bağımsız olarak, PDF çıktısının çalışma sayfası başına bir sayfa göstermesini isteyebilirsiniz. . Bu, her sayfanın kökten farklı bir sayfa boyutuna sahip olabileceği anlamına gelir. Bu, Aspose.Cells for .NET kullanılarak elde edilebilir.
Birden çok çalışma sayfası içeren bir Excel dosyasını PDF’e dönüştüren aşağıdaki örnek koda bakın.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); | |
// Initialize a new Workbook | |
// Open an Excel file | |
Workbook workbook = new Workbook(dataDir+ "input.xlsx"); | |
// Implement one page per worksheet option | |
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions(); | |
pdfSaveOptions.OnePagePerSheet = true; | |
// Save the PDF file | |
workbook.Save(dataDir+ "OutputFile.out.pdf", pdfSaveOptions); |
EğerSayfa Başına Bir Sayfa seçeneği ayarlandıdoğru, tüm sayfa içeriği tek bir PDF sayfasına işlenecektir.
E-tablonuz formüller içeriyorsa, aramak en iyisidirWorkbook.CalculateFormula()elektronik tabloyu PDF olarak oluşturmadan hemen önce. Bu, formüle bağlı değerlerin yeniden hesaplanmasını ve doğru değerlerin PDF’de oluşturulmasını sağlar.