SaveOptions.PageCount
محتويات
[
يخفي
]SaveOptions.PageCount property
يحصل أو يضبط عدد الصفحات التي سيتم حفظها. القيمة الافتراضية هي MaxValue مما يعني أنه سيتم عرض جميع صفحات المستند.
public int PageCount { get; set; }
أمثلة
يظهر كيفية حفظ مستند بتنسيق pdf.
// المسار إلى دليل المستندات.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
// حمّل المستند إلى Aspose.Note.
Document oneFile = new Document(dataDir + "Aspose.one");
// تهيئة كائن PdfSaveOptions
PdfSaveOptions opts = new PdfSaveOptions
{
// تعيين فهرس الصفحة الأولى التي سيتم حفظها
PageIndex = 0,
// تعيين عدد الصفحات
PageCount = 1,
};
// احفظ المستند كملف PDF
dataDir = dataDir + "SaveRangeOfPagesAsPDF_out.pdf";
oneFile.Save(dataDir, opts);
يظهر كيفية حفظ مستند بتنسيق pdf باستخدام إعدادات محددة.
// المسار إلى دليل المستندات.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
// حمّل المستند إلى Aspose.Note.
Document doc = new Document(dataDir + "Aspose.one");
// تهيئة كائن PdfSaveOptions
PdfSaveOptions opts = new PdfSaveOptions
{
// استخدام ضغط Jpeg
ImageCompression = Saving.Pdf.PdfImageCompression.Jpeg,
// جودة ضغط JPEG
JpegQuality = 90
};
dataDir = dataDir + "Document.SaveWithOptions_out.pdf";
doc.Save(dataDir, opts);
يوضح كيفية إنشاء مستند وحفظه بتنسيق html لنطاق محدد من الصفحات.
// المسار إلى دليل المستندات.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
// تهيئة مستند OneNote.
Document doc = new Document();
Page page = doc.AppendChildLast(new Page());
// النمط الافتراضي لجميع النصوص في المستند.
ParagraphStyle textStyle = new ParagraphStyle { FontColor = Color.Black, FontName = "Arial", FontSize = 10 };
page.Title = new Title()
{
TitleText = new RichText() { Text = "Title text.", ParagraphStyle = textStyle },
TitleDate = new RichText() { Text = new DateTime(2011, 11, 11).ToString("D", CultureInfo.InvariantCulture), ParagraphStyle = textStyle },
TitleTime = new RichText() { Text = "12:34", ParagraphStyle = textStyle }
};
// حفظ بتنسيق HTML
dataDir = dataDir + "CreateAndSavePageRange_out.html";
doc.Save(dataDir, new HtmlSaveOptions
{
PageCount = 1,
PageIndex = 0
});
انظر أيضًا
- class SaveOptions
- namespace Aspose.Note.Saving
- assembly Aspose.Note