قم بتحويل الرسم البياني إلى PDF بحجم الصفحة المطلوب
Contents
[
Hide
]
سيناريوهات الاستخدام الممكنة
يمكنك إنشاء مخطط Pdf بحجم الصفحة الذي تريده باستخدام Aspose.Cells وتحديد كيف تريد محاذاة المخطط داخل الصفحة مثل أعلى ، أسفل ، وسط ، يسار ، يمين إلخ. بالإضافة إلى ذلك ، يمكن إنشاء مخطط الإخراج في الدفق أو على القرص.
قم بإنشاء مخطط PDF بحجم الصفحة المطلوب
الرجاء مراجعة نموذج التعليمات البرمجية التالي الذي يقوم بتحميل ملفنموذج لملف Excel ، يصل إلى المخطط الأول داخل ورقة العمل ثم يحولها إلىإخراج قوات الدفاع الشعبي بحجم الصفحة المطلوب. توضح لقطة الشاشة التالية أن حجم الصفحة في ملف PDF الناتج هو 7 × 7 كما هو محدد داخل الكود ويتم محاذاة المخطط في المنتصف أفقيًا وعموديًا.
عينة من الرموز
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 | |
//Load sample Excel file containing the chart. | |
Workbook wb = new Workbook(sourceDir + "sampleCreateChartPDFWithDesiredPageSize.xlsx"); | |
//Access first worksheet. | |
Worksheet ws = wb.Worksheets[0]; | |
//Access first chart inside the worksheet. | |
Chart ch = ws.Charts[0]; | |
//Create chart pdf with desired page size. | |
ch.ToPdf(outputDir + "outputCreateChartPDFWithDesiredPageSize.pdf", 7, 7, PageLayoutAlignmentType.Center, PageLayoutAlignmentType.Center); |