Class ParagraphStyle
نام ها : Aspose.Note جمع آوری: Aspose.Note.dll (25.4.0)
تنظیمات سبک متن مورد استفاده قرار می گیرد اگر هیچ یک از اشیاء متن متن مطابقت در Aspose.Note.RichText.Styles جمع آوری یا این موضوع یک تنظیم مورد نیاز را مشخص نمی کند.
public sealed class ParagraphStyle : Style, IEquatable<ParagraphStyle>
{
public bool IsDefault()
{
}
public void SetNextIndent(Unit value)
{
}
public void SetNextKeepWithNext(bool flag)
{
}
public override int GetHashCode()
{
}
public bool Equals(ParagraphStyle other)
{
}
}
Inheritance
object ← Style ← ParagraphStyle
Implements
اعضای ارثی
Style.GetHashCode() , Style.IsBold , Style.IsItalic , Style.IsUnderline , Style.IsStrikethrough , Style.IsSuperscript , Style.IsSubscript , Style.FontName , Style.FontSize , Style.FontColor , Style.Highlight , Style.FontStyle , object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
بیایید عنوان های صفحه را در میان سایر عنوان ها با افزایش اندازه فونت برجسته کنیم.
string dataDir = RunExamples.GetDataDir_Text();
Document document = new Document(dataDir + "Aspose.one");
foreach (var title in document.Select(e => e.Title.TitleText))
{
title.ParagraphStyle.FontSize = 24;
title.ParagraphStyle.IsBold = true;
foreach (var run in title.TextRuns)
{
run.Style.FontSize = 24;
run.Style.IsBold = true;
}
}
document.Save(Path.Combine(dataDir, "ChangePageTitleStyle.pdf"));
بیایید با برجسته کردن آخرین تغییرات متن را تأکید کنیم.
string dataDir = RunExamples.GetDataDir_Text();
Document document = new Document(dataDir + "Aspose.one");
var richTextNodes = document.GetChildNodes<RichText>().Where(e => e.LastModifiedTime >= DateTime.Today.Subtract(TimeSpan.FromDays(7)));
foreach (var node in richTextNodes)
{
node.ParagraphStyle.Highlight = Color.DarkGreen;
foreach (var run in node.TextRuns)
{
run.Style.Highlight = Color.DarkSeaGreen;
}
}
document.Save(Path.Combine(dataDir, "HighlightAllRecentChanges.pdf"));
با استفاده از الگوی پاراگراف به فرمت متن دستکاری کنید.
var document = new Document();
var page = new Page();
var outline = new Outline();
var outlineElem = new OutlineElement();
var text = new RichText()
{
ParagraphStyle = new ParagraphStyle()
{
FontName = "Courier New",
FontSize = 20
}
}
.Append($"DefaultParagraphFontAndSize{Environment.NewLine}")
.Append($"OnlyDefaultParagraphFont{Environment.NewLine}", new TextStyle() { FontSize = 14 })
.Append("OnlyDefaultParagraphFontSize", new TextStyle() { FontName = "Verdana" });
outlineElem.AppendChildLast(text);
outline.AppendChildLast(outlineElem);
page.AppendChildLast(outline);
document.AppendChildLast(page);
document.Save(Path.Combine(RunExamples.GetDataDir_Text(), "SetDefaultParagraphStyle.one"));
نشان می دهد که چگونه لیست جدید را با شماره گذاری چینی وارد کنید.
string dataDir = RunExamples.GetDataDir_Text();
Aspose.Note.Document doc = new Aspose.Note.Document();
Aspose.Note.Page page = new Aspose.Note.Page(doc);
Outline outline = new Outline(doc);
ParagraphStyle defaultStyle = new ParagraphStyle { FontColor = Color.Black, FontName = "Arial", FontSize = 10 };
OutlineElement outlineElem1 = new OutlineElement(doc) { NumberList = new NumberList("{0})", NumberFormat.ChineseCounting, "Arial", 10) };
RichText text1 = new RichText(doc) { Text = "First", ParagraphStyle = defaultStyle };
outlineElem1.AppendChildLast(text1);
OutlineElement outlineElem2 = new OutlineElement(doc) { NumberList = new NumberList("{0})", NumberFormat.ChineseCounting, "Arial", 10) };
RichText text2 = new RichText(doc) { Text = "Second", ParagraphStyle = defaultStyle };
outlineElem2.AppendChildLast(text2);
OutlineElement outlineElem3 = new OutlineElement(doc) { NumberList = new NumberList("{0})", NumberFormat.ChineseCounting, "Arial", 10) };
RichText text3 = new RichText(doc) { Text = "Third", ParagraphStyle = defaultStyle };
outlineElem3.AppendChildLast(text3);
outline.AppendChildLast(outlineElem1);
outline.AppendChildLast(outlineElem2);
outline.AppendChildLast(outlineElem3);
page.AppendChildLast(outline);
doc.AppendChildLast(page);
dataDir = dataDir + "InsertChineseNumberList_out.one";
doc.Save(dataDir);
نشان می دهد که چگونه برای قرار دادن لیز گلوله جدید.
string dataDir = RunExamples.GetDataDir_Text();
Aspose.Note.Document doc = new Aspose.Note.Document();
Aspose.Note.Page page = new Aspose.Note.Page(doc);
Outline outline = new Outline(doc);
ParagraphStyle defaultStyle = new ParagraphStyle { FontColor = Color.Black, FontName = "Arial", FontSize = 10 };
OutlineElement outlineElem1 = new OutlineElement(doc) { NumberList = new NumberList("*", "Arial", 10) };
RichText text1 = new RichText(doc) { Text = "First", ParagraphStyle = defaultStyle };
outlineElem1.AppendChildLast(text1);
OutlineElement outlineElem2 = new OutlineElement(doc) { NumberList = new NumberList("*", "Arial", 10) };
RichText text2 = new RichText(doc) { Text = "Second", ParagraphStyle = defaultStyle };
outlineElem2.AppendChildLast(text2);
OutlineElement outlineElem3 = new OutlineElement(doc) { NumberList = new NumberList("*", "Arial", 10) };
RichText text3 = new RichText(doc) { Text = "Third", ParagraphStyle = defaultStyle };
outlineElem3.AppendChildLast(text3);
outline.AppendChildLast(outlineElem1);
outline.AppendChildLast(outlineElem2);
outline.AppendChildLast(outlineElem3);
page.AppendChildLast(outline);
doc.AppendChildLast(page);
dataDir = dataDir + "ApplyBulletsOnText_out.one";
doc.Save(dataDir);
نشان می دهد که چگونه لیست جدید را با شماره گذاری وارد کنید.
string dataDir = RunExamples.GetDataDir_Text();
Document doc = new Document();
Aspose.Note.Page page = new Aspose.Note.Page(doc);
Outline outline = new Outline(doc);
ParagraphStyle defaultStyle = new ParagraphStyle { FontColor = Color.Black, FontName = "Arial", FontSize = 10 };
OutlineElement outlineElem1 = new OutlineElement(doc) { NumberList = new NumberList("{0})", NumberFormat.DecimalNumbers, "Arial", 10) };
RichText text1 = new RichText(doc) { Text = "First", ParagraphStyle = defaultStyle };
outlineElem1.AppendChildLast(text1);
OutlineElement outlineElem2 = new OutlineElement(doc) { NumberList = new NumberList("{0})", NumberFormat.DecimalNumbers, "Arial", 10) };
RichText text2 = new RichText(doc) { Text = "Second", ParagraphStyle = defaultStyle };
outlineElem2.AppendChildLast(text2);
OutlineElement outlineElem3 = new OutlineElement(doc) { NumberList = new NumberList("{0})", NumberFormat.DecimalNumbers, "Arial", 10) };
RichText text3 = new RichText(doc) { Text = "Third", ParagraphStyle = defaultStyle };
outlineElem3.AppendChildLast(text3);
outline.AppendChildLast(outlineElem1);
outline.AppendChildLast(outlineElem2);
outline.AppendChildLast(outlineElem3);
page.AppendChildLast(outline);
doc.AppendChildLast(page);
dataDir = dataDir + "ApplyNumberingOnText_out.one";
doc.Save(dataDir);
Constructors
پاراگراف ( )
یک مثال جدید از کلاس Aspose.Note.ParagraphStyle را آغاز می کند.
public ParagraphStyle()
{
}
Properties
Default
پاراگراف سبک را با تنظیمات پیش فرض دریافت کنید.
public static ParagraphStyle Default
{
get;
}
ارزش املاک
Methods
مساوی ( Object )
تعیین می کند که آیا موضوع مشخص شده برابر با موضوع فعلی است یا خیر.
public override bool Equals(object obj)
{
}
Parameters
obj
object
موضوع است.
Returns
سیستم : بولیان
پاراگراف ( ParagraphStyle )
تعیین می کند که آیا موضوع مشخص شده برابر با موضوع فعلی است یا خیر.
public bool Equals(ParagraphStyle other)
{
if (other == null)
return false;
return this.Name == other.Name &&
this.Color == other.Color &&
this.Alignment == other.Alignment &&
this.Format.Equals(other.Format);
}
Parameters
other
ParagraphStyle
موضوع است.
Returns
سیستم : بولیان
بایگانی برچسب ها:
به عنوان یک عملکرد هش برای این نوع عمل می کند.
public override int GetHashCode()
{
}
Returns
سیستم .Int32.