FirstParagraph
محتويات
[
يخفي
]Story.FirstParagraph property
الحصول على الفقرة الأولى في القصة.
public Paragraph FirstParagraph { get; }
أمثلة
يوضح كيفية تنسيق مجموعة من النص باستخدام خاصية الخط الخاصة به.
Document doc = new Document();
Run run = new Run(doc, "Hello world!");
Aspose.Words.Font font = run.Font;
font.Name = "Courier New";
font.Size = 36;
font.HighlightColor = Color.Yellow;
doc.FirstSection.Body.FirstParagraph.AppendChild(run);
doc.Save(ArtifactsDir + "Font.CreateFormattedRun.docx");
يوضح كيفية إنشاء مربع نص وتنسيقه.
Document doc = new Document();
// إنشاء مربع نص عائم.
Shape textBox = new Shape(doc, ShapeType.TextBox);
textBox.WrapType = WrapType.None;
textBox.Height = 50;
textBox.Width = 200;
// قم بتعيين المحاذاة الأفقية والرأسية للنص داخل الشكل.
textBox.HorizontalAlignment = HorizontalAlignment.Center;
textBox.VerticalAlignment = VerticalAlignment.Top;
// أضف فقرة إلى مربع النص وأضف سلسلة من النص سيعرضها مربع النص.
textBox.AppendChild(new Paragraph(doc));
Paragraph para = textBox.FirstParagraph;
para.ParagraphFormat.Alignment = ParagraphAlignment.Center;
Run run = new Run(doc);
run.Text = "Hello world!";
para.AppendChild(run);
doc.FirstSection.Body.FirstParagraph.AppendChild(textBox);
doc.Save(ArtifactsDir + "Shape.CreateTextBox.docx");
أنظر أيضا
- class Paragraph
- class Story
- مساحة الاسم Aspose.Words
- المجسم Aspose.Words