قم بتحويل XLS ملف مع صور أو مخططات إلى PDF
Contents
[
Hide
]
يدعم Aspose.Cells تحويل ملفات XLS التي تحتوي على صور ورسوم بيانية إلى وثائق PDF. يمكن أن يعمل Aspose.Cells for .NET بشكل مستقل لتحويل جدول بيانات إلى PDF: Aspose.PDF for .NET غير مطلوب للتحويل. يمكن إجراء العملية في الذاكرة لأن العملية لا تعتمد على ملفات XML المؤقتة أو الوسيطة. هذا يعني أن ملفات Excel الكبيرة ، على سبيل المثال ، تلك التي تحتوي على صور ومخططات وكائنات رسومية أخرى ، يمكن تحويلها بسرعة وكفاءة.
عينة من الرموز
This file contains hidden or 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(); | |
} |
إذا كان جدول البيانات يحتوي على صيغ ، فمن الأفضل استدعاءالمصنف. احسب الصيغة الطريقة قبل التحويل إلى PDF. القيام بذلك يضمن إعادة حساب القيم التابعة للصيغة ، ويتم تقديم القيم الصحيحة في PDF.