XLS Dosyasını Resim veya Grafiklerle PDF'e Dönüştür
Contents
[
Hide
]
Aspose.Cells, resim ve çizelgeler içeren XLS dosyalarının PDF belgelerine dönüştürülmesini destekler. Aspose.Cells for .NET, bir elektronik tabloyu PDF’e dönüştürmek için bağımsız olarak çalışabilir: Aspose.PDF for .NET, dönüştürme için gerekli değildir. İşlem, geçici veya aracı XML dosyalarına bağlı olmadığı için bellekte yapılabilir. Bu, örneğin resimler, grafikler ve diğer çizim nesneleri içeren büyük Excel dosyalarının hızlı ve verimli bir şekilde dönüştürülebileceği anlamına gelir.
Basit kod
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); | |
try | |
{ | |
// Get the template excel file path. | |
string designerFile = dataDir + "SampleInput.xls"; | |
// Specify the pdf file path. | |
string pdfFile = dataDir + "Output.out.pdf"; | |
// Open the template excel file | |
Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook(designerFile); | |
// Save the pdf file. | |
wb.Save(pdfFile, SaveFormat.Pdf); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine(e.Message); | |
Console.ReadLine(); | |
} |
Elektronik tablo formüller içeriyorsa, en iyisiWorkbook.CalculateFormula yöntemi PDF’e dönüştürülmeden hemen önce. Bunu yapmak, formüle bağlı değerlerin yeniden hesaplanmasını ve doğru değerlerin PDF’de oluşturulmasını sağlar.